Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#3847 closed (fixed)

Add Finnish localflavor

Reported by: Ville Säävuori <Ville@…> Owned by: Adrian Holovaty
Component: Contrib apps Version: dev
Severity: Keywords: localflavor, l10n, fi
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Patch to add fi module to django.contrib.localflavor: FIZipCodeField and FIMunicipalitySelect.

Tests included.

Attachments (3)

fi_localflavor.diff (34.7 KB ) - added by Ville Säävuori <Ville@…> 17 years ago.
fi_localflavor_unicode.diff (35.1 KB ) - added by Ville Säävuori <Ville@…> 17 years ago.
A better patch (hopefully). This time with unicode strings.
fi_localflavor_social_security_number.patch (3.1 KB ) - added by karsu 17 years ago.
A Finnish social security number field

Download all attachments as: .zip

Change History (16)

by Ville Säävuori <Ville@…>, 17 years ago

Attachment: fi_localflavor.diff added

comment:1 by Simon G. <dev@…>, 17 years ago

Triage Stage: UnreviewedReady for checkin

comment:2 by Malcolm Tredinnick, 17 years ago

Patch needs improvement: set

I would prefer that the second argument in each tuple was marked as a Unicode string (u"..."). The problem with the current method is that Python will convert the second argument to a str object, rather than a unicode object. However, it doesn't attach any information to that object to indicate that it is UTF-8 encoded (rather than some other encoding or just a string of bytes). This can cause problems as the objects become further and further removed from their creation point. Further, you cannot use encode() or decode() on them in their current form (Python fails on ordinal values greater than 127, which happen frequently in UTF-8 strings from non-English locales).

To ease our transition to unicode internally and help avoid encoding problems, marking the strings as unicode objects is a better approach here.

comment:3 by Malcolm Tredinnick, 17 years ago

Triage Stage: Ready for checkinAccepted

comment:4 by Ville Säävuori <Ville@…>, 17 years ago

Thanks for your quick response and comments! I was a little bit uncertain about this, too. I'll modify the patch and add a better one ASAP.

by Ville Säävuori <Ville@…>, 17 years ago

Attachment: fi_localflavor_unicode.diff added

A better patch (hopefully). This time with unicode strings.

comment:5 by Ville Säävuori <Ville@…>, 17 years ago

Keywords: l10n fi added

Just noticed a thread on django-dev about documenting these localflavour add-ons. I'm happy to write docs for this one if needed. There's not much to document at the moment, though :)

comment:6 by Malcolm Tredinnick, 17 years ago

Triage Stage: AcceptedReady for checkin

by karsu, 17 years ago

A Finnish social security number field

comment:7 by karsu, 17 years ago

I added patch for Finnish localflavor. It contains new FISocialSecurityNumber field and regressiontests. Is it possible to add it at the same time? It would be nice to create one patch using FIZipCodeField, FIMunicipalitySelect and FISocialSecurityNumber.

comment:8 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(In [4867]) Fixed #3847 -- Added Finnish localflavor contribution from Ville S?\195?\164?\195?\164vuori.

comment:9 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: closedreopened

Whoops .. the extra patch was added just as I was committing Ville's work. I'll merge it together now. although the final patch here appears to be in an invalid format. "Patch" doesn't like it for some reason. Not to worry, though, I can do it manually.

comment:10 by Ville Säävuori <Ville@…>, 17 years ago

Whoa. Malcolm was fat. I was just merging this other patch to mine. Oh, well :)

It seems that Trac likes only patches with filename ending '.diff'. Or something.

Thanks Malcolm for your efforts on this.

comment:11 by Ville Säävuori <Ville@…>, 17 years ago

Lol. Not fat :D

I'll get mi coat.

comment:12 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: reopenedclosed

(In [4868]) Fixed #3847 -- Added validation support for Finnish social security numbers.
Thanks, karsu.

comment:13 by Adrian Holovaty, 17 years ago

(In [4890]) Documented HttpResponseBadRequest. Refs #3847 and [4867]

Note: See TracTickets for help on using tickets.
Back to Top