Thanks, Malcolm, but I've been looking at this, and I'm in way over my head here. I found the USStateField in django.contrib.localflavor.us.forms and the associated state in us_states I attempted to create a StateProvinceField that looked more or less like the USStateField, appending my Canadian provinces to the states dictionary. And that's where it went belly up. It didn't work, but I didn't get any error message, so I'm not sure where I went wrong. Definitely not sure about appending the Canada dictionary to the US one. In other words, I just really don't have a clue what I'm doing here.
On Aug 17, 11:41 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2007-08-17 at 20:50 +0000, [EMAIL PROTECTED] wrote: > > I'm using USStateField, but am running into Canadian addresses. > > Is there maybe a NorthAmericanStateOrProvinceField? > > > I guess I could add the provinces and their abbreviations to the list > > of states, but I hate to do that. > > > Should I extend USStateField somehow? > > > Or should I throw my hands up and just make it a two-character > > CharField? > > Have a look at the source. You'll see it's very simple to create your > own version of USStateField and the associated widget. You can import > the US state data, append you Canadian province data to it and then pass > that to a new widget. Creating widgets and subclassing existing ones is > easy in newforms. It's very class-oriented. > > Regards, > Malcolm > > -- > Monday is an awful way to spend 1/7th of your > life.http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---