questions regarding Django's "localflavor" packages, which offer additional functionality for particular countries or cultures.
Questions tagged [django-localflavor]
17 questions
10
votes
3 answers
How to fix Django South issue with regards to localflavor in Django 1.5?
I'm starting a new project and I'm using Django 1.5. I found out that the localflavor stuff has been removed from Django 1.5 and is now a separate installable package. So I installed it. In my models.py I'm importing the U.S. localflavors to get my…

user338413
- 689
- 2
- 8
- 20
8
votes
3 answers
How to fix localflavor deprecation warning in django 1.5?
I've migrated an existing django 1.3 to django 1.5. everything seems ok. However, I have a deprecation warning due to localflavor when i lauch python manage.py runserver
...\env\lib\site-packages\django\contrib\loca lflavor__init__.py:2:
…

luc
- 41,928
- 25
- 127
- 172
2
votes
0 answers
Specify default state for django-localflavor's USStateSelect field?
I am working on a Django project and using django-localflavor to implement state selection into my app. My user base will primarily be located in New York state. Is there a way to specify NY as the default state for the USStateSelect widget (and…

Nicole Marie
- 159
- 2
- 12
2
votes
1 answer
Why can't I set my Django Model's USPhoneNumberField to null=True, blank=True?
My Django Model:
from localflavor.us.forms import USPhoneNumberField
class Profile(models.Model):
cellPhone = USPhoneNumberField(null=True, blank=True,)
This gives me the following error when I do a manage.py syncdb:
cellPhone =…

Saqib Ali
- 11,931
- 41
- 133
- 272
2
votes
1 answer
django localflavor USStateSelect() inital value
I'm trying to use the django localflavor widget USStateSelect() in a form, but I want the widget to have Nebraska selected by default. The Widget only accepts an attrs arg, so I'm trying to understand what attributes I have to set to get the…

Anthony Roberts
- 1,971
- 1
- 19
- 34
2
votes
1 answer
django localflavor for international site
Looks like the general usage of localflavor is import the country specific package:
from localflavor.nz.forms import NZRegionSelect
What if I have a site that supports multiple countries? Is there generic proxy to be country agnostic, something…

James Lin
- 25,028
- 36
- 133
- 233
2
votes
1 answer
django format date on user supplied locale
I'm trying to set up the formatting of dates in templates based on a locale supplied by the user. As the rest of the page will remain in the original local ('en'), I only want my users'
supplied data to be formatted.
for example, dates.
users in…

yarbelk
- 7,215
- 6
- 29
- 37
1
vote
2 answers
django-localflavor fields not showing up in Django admin models?
I am trying to implement django-localflavors into my Django app.
I import USStateSelect & USZipCodeField at the beginning of my models.py and then include them as a field in my model along with other fields, like so:
from localflavor.us.forms…

Nicole Marie
- 159
- 2
- 12
1
vote
1 answer
Django 1.7, localflavor 1.1 USStateSelect()
I am using Django 1.7 and just installed localflavor 1.1. Now, while creating a default user, I want to use the USStateSelect() field. While creating a Nurse, which extends default user, I am getting all kinds of errors. Here is my current…

zamud
- 15
- 4
1
vote
1 answer
Django local flavor select widget list
My question is pretty siemple, but is being hard for me to find an easy way to do this.
I have a website where I need to make three dropdowns:
One for countrys
One for regions
One for sub-regions
My website has multiple languages. What I need to…

Lucas
- 597
- 3
- 15
0
votes
1 answer
Django localflavor field overwrite breaks form
I have the following form, which generates a Value error upon submition.
ValueError at /en/orders/create/
The view orders.views.order_create didn't return an HttpResponse object. It returned None instead.
my form:
from django import forms
from…

Petru Tanas
- 1,087
- 1
- 12
- 36
0
votes
1 answer
Django Query by State Name instead of 2 char abbreviation
I have a model that has a MULTISELECTFIELD where the user can select which states relate to them. It uses django-localflavor in the backend and so on the form they choose 'TEXAS' and 'TX' is stored on the database. I'm using this Q query to find the…

Micah Pearce
- 1,805
- 3
- 28
- 61
0
votes
0 answers
Django 1.11 Invalid Literal for ManytoMany field when saving form
I have a model that has a many to many field. When I try to save it, it errors out with a invalid literal for int() with base 10: 'A' error. From other posts I've read it looks like it's something to do with the CharField in my forms.py. In my…

Micah Pearce
- 1,805
- 3
- 28
- 61
0
votes
1 answer
Django - How to call localflavor US_STATES in HTML
How do you make a drop down menu that contains all of the options in localflavor's US_STATES?
I can see how to create a model that contains a field that uses the localflavor option US_STATES.
class State(models.Model):
states =…

Micah Pearce
- 1,805
- 3
- 28
- 61
0
votes
1 answer
Django and strftime best practices
Could someone please comment on best practices regarding formatting dates in Django?
More specifically I am trying to get the current day (Monday, Tuesday,...) translated in the current active language in Django.
Using x.strftime('%A') always yields…

tdma
- 182
- 1
- 12