forked from geomin/django-countria
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HOWTO.txt
29 lines (22 loc) · 868 Bytes
/
HOWTO.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
1. Checkout the code
2. Add 'countria' to your INSTALLED_APPS:
INSTALLED_APPS = (
#.....
'countria',
#.....
)
3. Add it to your models like:
================================================================
from django.db import models
from django.contrib.auth.models import User
from countria.models import *
class UserProfile(models.Model):
user = models.ForeignKey(User, unique=True)
country = models.ForeignKey(Country)
city = models.ForeignKey(City)
#etc.
===============================================================
4. Run ./manage.py syncdb
You can add MAX_COUNTRY_NAME_LENGTH to your settings.py to force the length of the country name.
Done!
To query countria is standard django queries http://docs.djangoproject.com/en/dev/topics/db/queries/