Code

Opened 6 years ago

Closed 6 years ago

#6427 closed (fixed)

created localflavor.at

Reported by: Bela Hausmann <post@…> Owned by: zerok
Component: contrib.localflavor Version: master
Severity: Keywords: localflavor, austria
Cc: zerok@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I created a basic localflavor for Austria (AT).
For now only a Provinces Select and ZipCode field.

Attachments (8)

at_provinces.py (1.1 KB) - added by Bela Hausmann <post@…> 6 years ago.
localflavor.at.at_provinces
forms.py (636 bytes) - added by Bela Hausmann <post@…> 6 years ago.
localflavor.at.forms
at_provinces.2.py (1.3 KB) - added by Bela Hausmann <post@…> 6 years ago.
New version with english Names
locale.de.diff (29.9 KB) - added by Horst Gutmann <zerok@…> 6 years ago.
Changes to the German locales
localflavor.at.diff (6.2 KB) - added by Horst Gutmann <zerok@…> 6 years ago.
New localflavor.at
localflavor.at-2.diff (6.2 KB) - added by Horst Gutmann <zerok@…> 6 years ago.
Some final changes to the documentation to clarify the origin of the whole SSN checker
localflavor.at-3.diff (6.2 KB) - added by Horst Gutmann <zerok@…> 6 years ago.
Updated contrib/localflavor addition to the post-r7971 world
localflavor.at-4.diff (4.1 KB) - added by Horst Gutmann <zerok@…> 6 years ago.
Updated patch for the post-r8087 world

Download all attachments as: .zip

Change History (19)

Changed 6 years ago by Bela Hausmann <post@…>

localflavor.at.at_provinces

Changed 6 years ago by Bela Hausmann <post@…>

localflavor.at.forms

comment:1 Changed 6 years ago by Bela Hausmann <post@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

the utf8 upload didn't work, so here again at_provinces.py

# -*- coding: utf-8 -*-
"""
A list of all nine provinces in Austria, see also: http://en.wikipedia.org/wiki/ISO_3166-2:AT
In the comments there are their english names, if they are not the same as the german ones.
Vienna is moved to the top, because it's the capital of Austria
"""

from django.utils.translation import ugettext_lazy as _

# after ISO_3166-2
PROVINCE_CHOICES = (
	('9', _(u'Wien')),		# Vienna
	('1', _(u'Burgenland')),
	('2', _(u'Kärnten')),		# Carinthia
	('3', _(u'Niederösterreich')),	# Lower Austria
	('4', _(u'Oberösterreich')),	# Upper Austria
	('5', _(u'Salzburg')),
	('6', _(u'Steiermark')),	# Styria
	('7', _(u'Tirol')),		# Tyrol
	('8', _(u'Vorarlberg')),
)

# alternative keys using initials (not used in forms)
PROVINCE_CHOICES_INITIALS = (
	('W', _(u'Wien')),		# Vienna
	('B', _(u'Burgenland')),
	('K', _(u'Kärnten')),		# Carinthia
	('N', _(u'Niederösterreich')),	# Lower Austria
	('O', _(u'Oberösterreich')),	# Upper Austria
	('S', _(u'Salzburg')),
	('St', _(u'Steiermark')),	# Styria
	('T', _(u'Tirol')),		# Tyrol
	('V', _(u'Vorarlberg')),
)


comment:2 Changed 6 years ago by tvrg

  • Has patch set
  • Needs tests set

comment:3 Changed 6 years ago by jacob

  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 6 years ago by Horst Gutmann <zerok@…>

  • Cc zerok@… added

Shouldn't normally the province name be stored here in English if translatable? At least that's how its done in the German and Swiss packages.

comment:5 Changed 6 years ago by Bela Hausmann <post@…>

Yes, I didn't notice that. Attached a new version.

Changed 6 years ago by Bela Hausmann <post@…>

New version with english Names

comment:6 Changed 6 years ago by Horst Gutmann <zerok@…>

  • Owner changed from nobody to zerok

comment:7 Changed 6 years ago by Horst Gutmann <zerok@…>

  • Keywords localflavor, added; localflavor removed
  • Needs tests unset

Removed some of Bela's lists since they are never used in the bundled forms.py and also added regression tests for all fields as well as a new field for handling Austrian social security numbers.

As requested by jezdez the result is split into two patches. One that includes the actual localflavor implementation, the other is for changes to the German locales.

Changed 6 years ago by Horst Gutmann <zerok@…>

Changes to the German locales

Changed 6 years ago by Horst Gutmann <zerok@…>

New localflavor.at

comment:8 Changed 6 years ago by Horst Gutmann <zerok@…>

I also contacted Bela to check if the removal of his 2 additional lists is OK for him. If he agrees this one would IMO be ready.

comment:9 Changed 6 years ago by Bela Hausmann <post@…>

It's fine by me!

Changed 6 years ago by Horst Gutmann <zerok@…>

Some final changes to the documentation to clarify the origin of the whole SSN checker

Changed 6 years ago by Horst Gutmann <zerok@…>

Updated contrib/localflavor addition to the post-r7971 world

Changed 6 years ago by Horst Gutmann <zerok@…>

Updated patch for the post-r8087 world

comment:10 Changed 6 years ago by Horst Gutmann <zerok@…>

localflavor.at-4.diff adds the ATSocialSecurityNumberField to Bernd's patch in #7686 and fixes some minor typos (as well as uses absolute imports).

This does *not* include any changes to the German locales, because there are other updates required in there as well that probably should be coordinated more closely with jezdez.

comment:11 Changed 6 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [8113]) Fixed #6427 -- Added some more features to the Austrian localflavor.
Thanks, Horst Gutmann.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.