Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3cdc802
Showing
946 changed files
with
99,158 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from django.conf import settings | ||
from django.contrib.auth.models import User | ||
|
||
class EmailOrUsernameModelBackend(object): | ||
def authenticate(self, username=None, password=None): | ||
if '@' in username: | ||
kwargs = {'email': username} | ||
else: | ||
kwargs = {'username': username} | ||
try: | ||
user = User.objects.get(**kwargs) | ||
if user.check_password(password): | ||
return user | ||
except User.DoesNotExist: | ||
return None | ||
|
||
def get_user(self, user_id): | ||
try: | ||
return User.objects.get(pk=user_id) | ||
except User.DoesNotExist: | ||
return None | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
K 25 | ||
svn:wc:ra_dav:version-url | ||
V 31 | ||
/svn/!svn/ver/2/trunk/countries | ||
END | ||
__init__.py | ||
K 25 | ||
svn:wc:ra_dav:version-url | ||
V 43 | ||
/svn/!svn/ver/2/trunk/countries/__init__.py | ||
END | ||
models.py | ||
K 25 | ||
svn:wc:ra_dav:version-url | ||
V 41 | ||
/svn/!svn/ver/2/trunk/countries/models.py | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
9 | ||
|
||
dir | ||
4 | ||
http://django-countries.googlecode.com/svn/trunk/countries | ||
http://django-countries.googlecode.com/svn | ||
|
||
|
||
|
||
2007-08-22T15:13:42.143324Z | ||
2 | ||
zodizz | ||
|
||
|
||
svn:special svn:externals svn:needs-lock | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
9723214f-3838-0410-87e3-5b3a9cbdf46e | ||
|
||
utils | ||
dir | ||
|
||
__init__.py | ||
file | ||
|
||
|
||
|
||
|
||
2009-10-17T18:14:44.000000Z | ||
d41d8cd98f00b204e9800998ecf8427e | ||
2007-08-22T15:13:42.143324Z | ||
2 | ||
zodizz | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
0 | ||
|
||
fixtures | ||
dir | ||
|
||
templatetags | ||
dir | ||
|
||
models.py | ||
file | ||
|
||
|
||
|
||
|
||
2009-10-17T18:14:44.000000Z | ||
18eb974f9ce8770afafe42cfabfeb01d | ||
2007-08-22T15:13:42.143324Z | ||
2 | ||
zodizz | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
2098 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
from django.db import models | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
class Country(models.Model): | ||
""" | ||
International Organization for Standardization (ISO) 3166-1 Country list | ||
* ``iso`` = ISO 3166-1 alpha-2 | ||
* ``name`` = Official country names used by the ISO 3166/MA in capital letters | ||
* ``printable_name`` = Printable country names for in-text use | ||
* ``iso3`` = ISO 3166-1 alpha-3 | ||
* ``numcode`` = ISO 3166-1 numeric | ||
Note:: | ||
This model is fixed to the database table 'country' to be more general. | ||
Change ``db_table`` if this cause conflicts with your database layout. | ||
Or comment out the line for default django behaviour. | ||
""" | ||
iso = models.CharField(_('ISO alpha-2'), max_length=2, primary_key=True) | ||
name = models.CharField(_('Official name (CAPS)'), max_length=128) | ||
printable_name = models.CharField(_('Country name'), max_length=128) | ||
iso3 = models.CharField(_('ISO alpha-3'), max_length=3, null=True) | ||
numcode = models.PositiveSmallIntegerField(_('ISO numeric'), null=True) | ||
|
||
class Meta: | ||
db_table = 'country' | ||
verbose_name = _('Country') | ||
verbose_name_plural = _('Countries') | ||
ordering = ('name',) | ||
|
||
class Admin: | ||
list_display = ('printable_name', 'iso',) | ||
|
||
def __unicode__(self): | ||
return self.printable_name | ||
|
||
|
||
class UsState(models.Model): | ||
""" | ||
United States Postal Service (USPS) State Abbreviations | ||
Note:: | ||
This model is fixed to the database table 'usstate' to be more general. | ||
Change ``db_table`` if this cause conflicts with your database layout. | ||
Or comment out the line for default django behaviour. | ||
""" | ||
id = models.AutoField(primary_key=True) | ||
name = models.CharField(_('State name'), max_length=50, null=False) | ||
abbrev = models.CharField(_('Abbreviation'), max_length=2, null=False) | ||
|
||
class Meta: | ||
db_table = 'usstate' | ||
verbose_name = _('US State') | ||
verbose_name_plural = _('US States') | ||
ordering = ('name',) | ||
|
||
class Admin: | ||
list_display = ('name', 'abbrev',) | ||
|
||
def __unicode__(self): | ||
return self.name |
Empty file.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from django.contrib import admin | ||
from models import * | ||
|
||
class CountryAdmin(admin.ModelAdmin): | ||
"""admin class""" | ||
admin.site.register(Country, CountryAdmin) | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
K 25 | ||
svn:wc:ra_dav:version-url | ||
V 40 | ||
/svn/!svn/ver/2/trunk/countries/fixtures | ||
END | ||
initial_data.xml | ||
K 25 | ||
svn:wc:ra_dav:version-url | ||
V 57 | ||
/svn/!svn/ver/2/trunk/countries/fixtures/initial_data.xml | ||
END | ||
UPDATED.txt | ||
K 25 | ||
svn:wc:ra_dav:version-url | ||
V 52 | ||
/svn/!svn/ver/2/trunk/countries/fixtures/UPDATED.txt | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
9 | ||
|
||
dir | ||
4 | ||
http://django-countries.googlecode.com/svn/trunk/countries/fixtures | ||
http://django-countries.googlecode.com/svn | ||
|
||
|
||
|
||
2007-08-22T15:13:42.143324Z | ||
2 | ||
zodizz | ||
|
||
|
||
svn:special svn:externals svn:needs-lock | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
9723214f-3838-0410-87e3-5b3a9cbdf46e | ||
|
||
initial_data.xml | ||
file | ||
|
||
|
||
|
||
|
||
2009-10-17T18:14:44.000000Z | ||
3cee44bb24b081b1052ae36f5d6a78c8 | ||
2007-08-22T15:13:42.143324Z | ||
2 | ||
zodizz | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
94250 | ||
|
||
UPDATED.txt | ||
file | ||
|
||
|
||
|
||
|
||
2009-10-17T18:14:44.000000Z | ||
c34787ec277a044bf1c28ebf2c4156a2 | ||
2007-08-22T15:13:42.143324Z | ||
2 | ||
zodizz | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
502 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
========================================= | ||
Django Countries initial_data.xml Fixture | ||
========================================= | ||
|
||
Country list | ||
------------ | ||
|
||
Last updated: 2007-08-20 - 244 countries. | ||
|
||
From these two resources: | ||
- http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/index.html | ||
- http://unstats.un.org/unsd/methods/m49/m49alpha.htm | ||
|
||
|
||
US States | ||
--------- | ||
|
||
List last updated: 2007-08-20 - 59+6=65 states | ||
|
||
From: | ||
- http://www.usps.com/ncsc/lookups/usps_abbreviations.html |
Oops, something went wrong.