Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
robplatek committed Jun 5, 2010
0 parents commit 3cdc802
Show file tree
Hide file tree
Showing 946 changed files with 99,158 additions and 0 deletions.
Empty file added README
Empty file.
Empty file added __init__.py
Empty file.
22 changes: 22 additions & 0 deletions backends.py
@@ -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

17 changes: 17 additions & 0 deletions countries/.svn/all-wcprops
@@ -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
105 changes: 105 additions & 0 deletions countries/.svn/entries
@@ -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

1 change: 1 addition & 0 deletions countries/.svn/format
@@ -0,0 +1 @@
9
Empty file.
65 changes: 65 additions & 0 deletions countries/.svn/text-base/models.py.svn-base
@@ -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 added countries/__init__.py
Empty file.
Binary file added countries/__init__.pyc
Binary file not shown.
7 changes: 7 additions & 0 deletions countries/admin.py
@@ -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 added countries/admin.pyc
Binary file not shown.
17 changes: 17 additions & 0 deletions countries/fixtures/.svn/all-wcprops
@@ -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
96 changes: 96 additions & 0 deletions countries/fixtures/.svn/entries
@@ -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

1 change: 1 addition & 0 deletions countries/fixtures/.svn/format
@@ -0,0 +1 @@
9
21 changes: 21 additions & 0 deletions countries/fixtures/.svn/text-base/UPDATED.txt.svn-base
@@ -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

0 comments on commit 3cdc802

Please sign in to comment.