Django

Code

Ticket #3847 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

Add Finnish localflavor

Reported by: Ville Säävuori <Ville@Unessa.net> Assigned to: adrian
Milestone: Component: Contrib apps
Version: SVN Keywords: localflavor, l10n, fi
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 1

Description

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

Tests included.

Attachments

fi_localflavor.diff (34.7 kB) - added by Ville Säävuori <Ville@Unessa.net> on 03/27/07 22:01:52.
fi_localflavor_unicode.diff (35.1 kB) - added by Ville Säävuori <Ville@Unessa.net> on 03/28/07 13:09:00.
A better patch (hopefully). This time with unicode strings.
fi_localflavor_social_security_number.patch (3.1 kB) - added by karsu on 03/30/07 04:52:07.
A Finnish social security number field

Change History

03/27/07 22:01:52 changed by Ville Säävuori <Ville@Unessa.net>

  • attachment fi_localflavor.diff added.

03/28/07 08:27:03 changed by Simon G. <dev@simon.net.nz>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Ready for checkin.
  • needs_tests changed.
  • needs_docs changed.

03/28/07 08:50:56 changed by mtredinnick

  • needs_better_patch set to 1.

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.

03/28/07 08:51:04 changed by mtredinnick

  • stage changed from Ready for checkin to Accepted.

03/28/07 12:05:57 changed by Ville Säävuori <Ville@Unessa.net>

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.

03/28/07 13:09:00 changed by Ville Säävuori <Ville@Unessa.net>

  • attachment fi_localflavor_unicode.diff added.

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

03/29/07 22:29:00 changed by Ville Säävuori <Ville@Unessa.net>

  • keywords changed from localflavor to localflavor, l10n, fi.

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 :)

03/30/07 03:12:12 changed by mtredinnick

  • stage changed from Accepted to Ready for checkin.

03/30/07 04:52:07 changed by karsu

  • attachment fi_localflavor_social_security_number.patch added.

A Finnish social security number field

03/30/07 04:57:57 changed by karsu

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.

03/30/07 05:04:23 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

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

03/30/07 05:07:06 changed by mtredinnick

  • status changed from closed to reopened.
  • resolution deleted.

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.

03/30/07 05:12:42 changed by Ville Säävuori <Ville@Unessa.net>

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.

03/30/07 05:13:22 changed by Ville Säävuori <Ville@Unessa.net>

Lol. Not fat :D

I'll get mi coat.

03/30/07 05:18:16 changed by mtredinnick

  • status changed from reopened to closed.
  • resolution set to fixed.

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

04/01/07 00:18:48 changed by adrian

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


Add/Change #3847 (Add Finnish localflavor)




Change Properties
Action