-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added full names and numerical codes for Swedish counties #117
Open
dessibelle
wants to merge
8
commits into
django:master
Choose a base branch
from
dessibelle:master
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Commits on Sep 10, 2014
-
Added dictionaries for numerical county codes and full county names.
I have added the following dictionaries and functions to se_counties: NUMERICAL_COUNTY_CODES contains the numerical two-digit couty codes which has more or less replaced the alphabetical codes nowadays. Also, these numerical codes is always the leading digits in the codes for municipailites and smaller subdivisions, which can be beneficial. FULL_COUNTY_NAMES contains the full names of each county. The current labels given in SE_COUNTIES is good when it is obvioius to the user that he/she is selecting a county, but they are not identical to the full county name. Also, in Swedish the county names differ somewhat, e.g. "Skåne län" as opposed to the more generic "Stockholms län" (ending with genitive case s), which the Swedish i18n should honor. numerical_county_code() and full_county_name() are simply accessor methods for the above dictionaries, returning the corresponding values given a alphabetical county code. For backwards compatibility I have chosen to keep both the alphabetical codes and the shortened names (lacking the "county"-part) in the original SE_COUNTIES list, although I guess one could argue numerical codes and full names would be a better option.
Configuration menu - View commit details
-
Copy full SHA for 958c0fe - Browse repository at this point
Copy the full SHA 958c0feView commit details -
Added @county_decorator() which adds a few accessor methods to models
The decorator adds get_FIELDNAME_numerical_code() and get_FIELDNAME_full_name() methods to django models for all FIELDNAME values supplied in the field_names tuple. Ideally this can be used on all model fields that uses COUNTY_CHOICES for the choices argument. @county_decorator(field_names('field',)) class MyClass: field = models.CharField(choices=se_counties=COUNTY_CHOICES)
Configuration menu - View commit details
-
Copy full SHA for b222b24 - Browse repository at this point
Copy the full SHA b222b24View commit details
Commits on Sep 11, 2014
-
Configuration menu - View commit details
-
Copy full SHA for a15abc3 - Browse repository at this point
Copy the full SHA a15abc3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 703a53f - Browse repository at this point
Copy the full SHA 703a53fView commit details
Commits on Nov 21, 2014
-
Removed class decorator and added SECountyField to handle model acces…
…sors for full county name and numerical codes. Also renamed `FULL_COUNTY_NAMES` and `NUMERICAL_COUNTY_CODES` in `se_counties.py` into `NUMERICAL_COUNTY_CODE_CHOICES` and `FULL_COUNTY_NAME_CHOICES` respectively, as well as converted them both to tuple lists rather than dicts in order for them to be supplied as the `chocies` argument for the field.
Configuration menu - View commit details
-
Copy full SHA for c4c4462 - Browse repository at this point
Copy the full SHA c4c4462View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2bda725 - Browse repository at this point
Copy the full SHA 2bda725View commit details -
Configuration menu - View commit details
-
Copy full SHA for ca6bbb7 - Browse repository at this point
Copy the full SHA ca6bbb7View commit details -
Configuration menu - View commit details
-
Copy full SHA for a7dff89 - Browse repository at this point
Copy the full SHA a7dff89View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.