[Commits] python.it commit r265 - in
code/pythonisti/trunk/pythonisti: . apps/profile apps/profile/sql
commit a svn.python.it
commit a svn.python.it
Gio 18 Gen 2007 17:41:52 CET
Author: rhymes
Date: Thu Jan 18 17:41:49 2007
New Revision: 265
Added:
code/pythonisti/trunk/pythonisti/apps/profile/
code/pythonisti/trunk/pythonisti/apps/profile/__init__.py
code/pythonisti/trunk/pythonisti/apps/profile/models.py
code/pythonisti/trunk/pythonisti/apps/profile/sql/
code/pythonisti/trunk/pythonisti/apps/profile/sql/country.sql
code/pythonisti/trunk/pythonisti/apps/profile/views.py
Modified:
code/pythonisti/trunk/pythonisti/settings.py
Log:
add profile application stub
Added: code/pythonisti/trunk/pythonisti/apps/profile/__init__.py
==============================================================================
Added: code/pythonisti/trunk/pythonisti/apps/profile/models.py
==============================================================================
--- (empty file)
+++ code/pythonisti/trunk/pythonisti/apps/profile/models.py Thu Jan 18 17:41:49 2007
@@ -0,0 +1,48 @@
+from django.db import models
+from django.contrib.auth.models import User
+
+from pythonisti.apps.geo.models import GeoLocation
+
+class Tag(models.Model):
+ name = models.CharField(blank=False, maxlength=30)
+
+class Country(models.Model):
+ # ISO country code
+ code = models.CharField(maxlength=2, primary_key=2)
+ # ISO name, see:
+ # http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html
+ name = models.CharField(maxlength=50)
+
+class Place(models.Model):
+ country = models.ForeignKey(Country)
+ address = models.CharField(blank=True, maxlength=50)
+ city = models.CharField(blank=False, maxlength=50)
+ # this represents the region, area, district, province or whatever
+ administrative_area = models.CharField(blank=True, maxlength=50)
+ # this makes sense in federal countries like USA
+ state = models.CharField(blank=True, maxlength=50)
+ # the post/zip code itself
+ postcode = models.CharField(blank=True, maxlength=10)
+
+class UserProfile(models.Model):
+ # the user whom this profile belongs to
+ user = models.OneToOneField(User)
+ # the geo-location of the profile
+ geo_location = models.ForeignKey(GeoLocation)
+ # the place where the user lives in
+ place = models.ForeignKey(Place)
+ # the user avatar
+ avatar = models.CharField(maxlength=50, blank=True)
+ # the user specialties
+ tags = models.ManyToManyField(Tag, related_name="users")
+ # the company where the user works
+ company = models.CharField(maxlength=50, blank=True)
+ # is she/he available for hire?
+ for_hire = models.BooleanField(blank=False, default=False)
+ # is she/he available for consultancy or contract work?
+ for_consultancy = models.BooleanField(blank=False, default=False)
+ # when the profile has been created
+ creation_date = models.DateTimeField(auto_now_add=True)
+ # when the profile has been modified
+ last_modified = models.DateTimeField(auto_now=True)
+
Added: code/pythonisti/trunk/pythonisti/apps/profile/sql/country.sql
==============================================================================
--- (empty file)
+++ code/pythonisti/trunk/pythonisti/apps/profile/sql/country.sql Thu Jan 18 17:41:49 2007
@@ -0,0 +1,244 @@
+INSERT INTO profile_country VALUES ('AFGHANISTAN', 'AF')
+INSERT INTO profile_country VALUES ('ÅLAND ISLANDS', 'AX')
+INSERT INTO profile_country VALUES ('ALBANIA', 'AL')
+INSERT INTO profile_country VALUES ('ALGERIA', 'DZ')
+INSERT INTO profile_country VALUES ('AMERICAN SAMOA', 'AS')
+INSERT INTO profile_country VALUES ('ANDORRA', 'AD')
+INSERT INTO profile_country VALUES ('ANGOLA', 'AO')
+INSERT INTO profile_country VALUES ('ANGUILLA', 'AI')
+INSERT INTO profile_country VALUES ('ANTARCTICA', 'AQ')
+INSERT INTO profile_country VALUES ('ANTIGUA AND BARBUDA', 'AG')
+INSERT INTO profile_country VALUES ('ARGENTINA', 'AR')
+INSERT INTO profile_country VALUES ('ARMENIA', 'AM')
+INSERT INTO profile_country VALUES ('ARUBA', 'AW')
+INSERT INTO profile_country VALUES ('AUSTRALIA', 'AU')
+INSERT INTO profile_country VALUES ('AUSTRIA', 'AT')
+INSERT INTO profile_country VALUES ('AZERBAIJAN', 'AZ')
+INSERT INTO profile_country VALUES ('BAHAMAS', 'BS')
+INSERT INTO profile_country VALUES ('BAHRAIN', 'BH')
+INSERT INTO profile_country VALUES ('BANGLADESH', 'BD')
+INSERT INTO profile_country VALUES ('BARBADOS', 'BB')
+INSERT INTO profile_country VALUES ('BELARUS', 'BY')
+INSERT INTO profile_country VALUES ('BELGIUM', 'BE')
+INSERT INTO profile_country VALUES ('BELIZE', 'BZ')
+INSERT INTO profile_country VALUES ('BENIN', 'BJ')
+INSERT INTO profile_country VALUES ('BERMUDA', 'BM')
+INSERT INTO profile_country VALUES ('BHUTAN', 'BT')
+INSERT INTO profile_country VALUES ('BOLIVIA', 'BO')
+INSERT INTO profile_country VALUES ('BOSNIA AND HERZEGOVINA', 'BA')
+INSERT INTO profile_country VALUES ('BOTSWANA', 'BW')
+INSERT INTO profile_country VALUES ('BOUVET ISLAND', 'BV')
+INSERT INTO profile_country VALUES ('BRAZIL', 'BR')
+INSERT INTO profile_country VALUES ('BRITISH INDIAN OCEAN TERRITORY', 'IO')
+INSERT INTO profile_country VALUES ('BRUNEI DARUSSALAM', 'BN')
+INSERT INTO profile_country VALUES ('BULGARIA', 'BG')
+INSERT INTO profile_country VALUES ('BURKINA FASO', 'BF')
+INSERT INTO profile_country VALUES ('BURUNDI', 'BI')
+INSERT INTO profile_country VALUES ('CAMBODIA', 'KH')
+INSERT INTO profile_country VALUES ('CAMEROON', 'CM')
+INSERT INTO profile_country VALUES ('CANADA', 'CA')
+INSERT INTO profile_country VALUES ('CAPE VERDE', 'CV')
+INSERT INTO profile_country VALUES ('CAYMAN ISLANDS', 'KY')
+INSERT INTO profile_country VALUES ('CENTRAL AFRICAN REPUBLIC', 'CF')
+INSERT INTO profile_country VALUES ('CHAD', 'TD')
+INSERT INTO profile_country VALUES ('CHILE', 'CL')
+INSERT INTO profile_country VALUES ('CHINA', 'CN')
+INSERT INTO profile_country VALUES ('CHRISTMAS ISLAND', 'CX')
+INSERT INTO profile_country VALUES ('COCOS (KEELING) ISLANDS', 'CC')
+INSERT INTO profile_country VALUES ('COLOMBIA', 'CO')
+INSERT INTO profile_country VALUES ('COMOROS', 'KM')
+INSERT INTO profile_country VALUES ('CONGO', 'CG')
+INSERT INTO profile_country VALUES ('CONGO, THE DEMOCRATIC REPUBLIC OF THE', 'CD')
+INSERT INTO profile_country VALUES ('COOK ISLANDS', 'CK')
+INSERT INTO profile_country VALUES ('COSTA RICA', 'CR')
+INSERT INTO profile_country VALUES ('CÔTE D\'IVOIRE', 'CI')
+INSERT INTO profile_country VALUES ('CROATIA', 'HR')
+INSERT INTO profile_country VALUES ('CUBA', 'CU')
+INSERT INTO profile_country VALUES ('CYPRUS', 'CY')
+INSERT INTO profile_country VALUES ('CZECH REPUBLIC', 'CZ')
+INSERT INTO profile_country VALUES ('DENMARK', 'DK')
+INSERT INTO profile_country VALUES ('DJIBOUTI', 'DJ')
+INSERT INTO profile_country VALUES ('DOMINICA', 'DM')
+INSERT INTO profile_country VALUES ('DOMINICAN REPUBLIC', 'DO')
+INSERT INTO profile_country VALUES ('ECUADOR', 'EC')
+INSERT INTO profile_country VALUES ('EGYPT', 'EG')
+INSERT INTO profile_country VALUES ('EL SALVADOR', 'SV')
+INSERT INTO profile_country VALUES ('EQUATORIAL GUINEA', 'GQ')
+INSERT INTO profile_country VALUES ('ERITREA', 'ER')
+INSERT INTO profile_country VALUES ('ESTONIA', 'EE')
+INSERT INTO profile_country VALUES ('ETHIOPIA', 'ET')
+INSERT INTO profile_country VALUES ('FALKLAND ISLANDS (MALVINAS)', 'FK')
+INSERT INTO profile_country VALUES ('FAROE ISLANDS', 'FO')
+INSERT INTO profile_country VALUES ('FIJI', 'FJ')
+INSERT INTO profile_country VALUES ('FINLAND', 'FI')
+INSERT INTO profile_country VALUES ('FRANCE', 'FR')
+INSERT INTO profile_country VALUES ('FRENCH GUIANA', 'GF')
+INSERT INTO profile_country VALUES ('FRENCH POLYNESIA', 'PF')
+INSERT INTO profile_country VALUES ('FRENCH SOUTHERN TERRITORIES', 'TF')
+INSERT INTO profile_country VALUES ('GABON', 'GA')
+INSERT INTO profile_country VALUES ('GAMBIA', 'GM')
+INSERT INTO profile_country VALUES ('GEORGIA', 'GE')
+INSERT INTO profile_country VALUES ('GERMANY', 'DE')
+INSERT INTO profile_country VALUES ('GHANA', 'GH')
+INSERT INTO profile_country VALUES ('GIBRALTAR', 'GI')
+INSERT INTO profile_country VALUES ('GREECE', 'GR')
+INSERT INTO profile_country VALUES ('GREENLAND', 'GL')
+INSERT INTO profile_country VALUES ('GRENADA', 'GD')
+INSERT INTO profile_country VALUES ('GUADELOUPE', 'GP')
+INSERT INTO profile_country VALUES ('GUAM', 'GU')
+INSERT INTO profile_country VALUES ('GUATEMALA', 'GT')
+INSERT INTO profile_country VALUES ('GUERNSEY', 'GG')
+INSERT INTO profile_country VALUES ('GUINEA', 'GN')
+INSERT INTO profile_country VALUES ('GUINEA-BISSAU', 'GW')
+INSERT INTO profile_country VALUES ('GUYANA', 'GY')
+INSERT INTO profile_country VALUES ('HAITI', 'HT')
+INSERT INTO profile_country VALUES ('HEARD ISLAND AND MCDONALD ISLANDS', 'HM')
+INSERT INTO profile_country VALUES ('HOLY SEE (VATICAN CITY STATE)', 'VA')
+INSERT INTO profile_country VALUES ('HONDURAS', 'HN')
+INSERT INTO profile_country VALUES ('HONG KONG', 'HK')
+INSERT INTO profile_country VALUES ('HUNGARY', 'HU')
+INSERT INTO profile_country VALUES ('ICELAND', 'IS')
+INSERT INTO profile_country VALUES ('INDIA', 'IN')
+INSERT INTO profile_country VALUES ('INDONESIA', 'ID')
+INSERT INTO profile_country VALUES ('IRAN, ISLAMIC REPUBLIC', 'OF')
+INSERT INTO profile_country VALUES ('IR', 'IRAQ')
+INSERT INTO profile_country VALUES ('IQ', 'IRELAND')
+INSERT INTO profile_country VALUES ('IE ISLE OF MAN', 'IM')
+INSERT INTO profile_country VALUES ('ISRAEL', 'IL')
+INSERT INTO profile_country VALUES ('ITALY', 'IT')
+INSERT INTO profile_country VALUES ('JAMAICA', 'JM')
+INSERT INTO profile_country VALUES ('JAPAN', 'JP')
+INSERT INTO profile_country VALUES ('JERSEY', 'JE')
+INSERT INTO profile_country VALUES ('JORDAN', 'JO')
+INSERT INTO profile_country VALUES ('KAZAKHSTAN', 'KZ')
+INSERT INTO profile_country VALUES ('KENYA', 'KE')
+INSERT INTO profile_country VALUES ('KIRIBATI', 'KI')
+INSERT INTO profile_country VALUES ('KOREA, DEMOCRATIC PEOPLE\'S REPUBLIC OF', 'KP')
+INSERT INTO profile_country VALUES ('KOREA, REPUBLIC OF', 'KR')
+INSERT INTO profile_country VALUES ('KUWAIT', 'KW')
+INSERT INTO profile_country VALUES ('KYRGYZSTAN', 'KG')
+INSERT INTO profile_country VALUES ('LAO PEOPLE\'S DEMOCRATIC REPUBLIC', 'LA')
+INSERT INTO profile_country VALUES ('LATVIA', 'LV')
+INSERT INTO profile_country VALUES ('LEBANON', 'LB')
+INSERT INTO profile_country VALUES ('LESOTHO', 'LS')
+INSERT INTO profile_country VALUES ('LIBERIA', 'LR')
+INSERT INTO profile_country VALUES ('LIBYAN ARAB JAMAHIRIYA', 'LY')
+INSERT INTO profile_country VALUES ('LIECHTENSTEIN', 'LI')
+INSERT INTO profile_country VALUES ('LITHUANIA', 'LT')
+INSERT INTO profile_country VALUES ('LUXEMBOURG', 'LU')
+INSERT INTO profile_country VALUES ('MACAO', 'MO')
+INSERT INTO profile_country VALUES ('MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF', 'MK')
+INSERT INTO profile_country VALUES ('MADAGASCAR', 'MG')
+INSERT INTO profile_country VALUES ('MALAWI', 'MW')
+INSERT INTO profile_country VALUES ('MALAYSIA', 'MY')
+INSERT INTO profile_country VALUES ('MALDIVES', 'MV')
+INSERT INTO profile_country VALUES ('MALI', 'ML')
+INSERT INTO profile_country VALUES ('MALTA', 'MT')
+INSERT INTO profile_country VALUES ('MARSHALL ISLANDS', 'MH')
+INSERT INTO profile_country VALUES ('MARTINIQUE', 'MQ')
+INSERT INTO profile_country VALUES ('MAURITANIA', 'MR')
+INSERT INTO profile_country VALUES ('MAURITIUS', 'MU')
+INSERT INTO profile_country VALUES ('MAYOTTE', 'YT')
+INSERT INTO profile_country VALUES ('MEXICO', 'MX')
+INSERT INTO profile_country VALUES ('MICRONESIA, FEDERATED STATES OF', 'FM')
+INSERT INTO profile_country VALUES ('MOLDOVA, REPUBLIC OF', 'MD')
+INSERT INTO profile_country VALUES ('MONACO', 'MC')
+INSERT INTO profile_country VALUES ('MONGOLIA', 'MN')
+INSERT INTO profile_country VALUES ('MONTENEGRO', 'ME')
+INSERT INTO profile_country VALUES ('MONTSERRAT', 'MS')
+INSERT INTO profile_country VALUES ('MOROCCO', 'MA')
+INSERT INTO profile_country VALUES ('MOZAMBIQUE', 'MZ')
+INSERT INTO profile_country VALUES ('MYANMAR', 'MM')
+INSERT INTO profile_country VALUES ('NAMIBIA', 'NA')
+INSERT INTO profile_country VALUES ('NAURU', 'NR')
+INSERT INTO profile_country VALUES ('NEPAL', 'NP')
+INSERT INTO profile_country VALUES ('NETHERLANDS', 'NL')
+INSERT INTO profile_country VALUES ('NETHERLANDS ANTILLES', 'AN')
+INSERT INTO profile_country VALUES ('NEW CALEDONIA', 'NC')
+INSERT INTO profile_country VALUES ('NEW ZEALAND', 'NZ')
+INSERT INTO profile_country VALUES ('NICARAGUA', 'NI')
+INSERT INTO profile_country VALUES ('NIGER', 'NE')
+INSERT INTO profile_country VALUES ('NIGERIA', 'NG')
+INSERT INTO profile_country VALUES ('NIUE', 'NU')
+INSERT INTO profile_country VALUES ('NORFOLK ISLAND', 'NF')
+INSERT INTO profile_country VALUES ('NORTHERN MARIANA ISLANDS', 'MP')
+INSERT INTO profile_country VALUES ('NORWAY', 'NO')
+INSERT INTO profile_country VALUES ('OMAN', 'OM')
+INSERT INTO profile_country VALUES ('PAKISTAN', 'PK')
+INSERT INTO profile_country VALUES ('PALAU', 'PW')
+INSERT INTO profile_country VALUES ('PALESTINIAN TERRITORY, OCCUPIED', 'PS')
+INSERT INTO profile_country VALUES ('PANAMA', 'PA')
+INSERT INTO profile_country VALUES ('PAPUA NEW GUINEA', 'PG')
+INSERT INTO profile_country VALUES ('PARAGUAY', 'PY')
+INSERT INTO profile_country VALUES ('PERU', 'PE')
+INSERT INTO profile_country VALUES ('PHILIPPINES', 'PH')
+INSERT INTO profile_country VALUES ('PITCAIRN', 'PN')
+INSERT INTO profile_country VALUES ('POLAND', 'PL')
+INSERT INTO profile_country VALUES ('PORTUGAL', 'PT')
+INSERT INTO profile_country VALUES ('PUERTO RICO', 'PR')
+INSERT INTO profile_country VALUES ('QATAR', 'QA')
+INSERT INTO profile_country VALUES ('RÉUNION', 'RE')
+INSERT INTO profile_country VALUES ('ROMANIA', 'RO')
+INSERT INTO profile_country VALUES ('RUSSIAN FEDERATION', 'RU')
+INSERT INTO profile_country VALUES ('RWANDA', 'RW')
+INSERT INTO profile_country VALUES ('SAINT HELENA', 'SH')
+INSERT INTO profile_country VALUES ('SAINT KITTS AND NEVIS', 'KN')
+INSERT INTO profile_country VALUES ('SAINT LUCIA', 'LC')
+INSERT INTO profile_country VALUES ('SAINT PIERRE AND MIQUELON', 'PM')
+INSERT INTO profile_country VALUES ('SAINT VINCENT AND THE GRENADINES', 'VC')
+INSERT INTO profile_country VALUES ('SAMOA', 'WS')
+INSERT INTO profile_country VALUES ('SAN MARINO', 'SM')
+INSERT INTO profile_country VALUES ('SAO TOME AND PRINCIPE', 'ST')
+INSERT INTO profile_country VALUES ('SAUDI ARABIA', 'SA')
+INSERT INTO profile_country VALUES ('SENEGAL', 'SN')
+INSERT INTO profile_country VALUES ('SERBIA', 'RS')
+INSERT INTO profile_country VALUES ('SEYCHELLES', 'SC')
+INSERT INTO profile_country VALUES ('SIERRA LEONE', 'SL')
+INSERT INTO profile_country VALUES ('SINGAPORE', 'SG')
+INSERT INTO profile_country VALUES ('SLOVAKIA', 'SK')
+INSERT INTO profile_country VALUES ('SLOVENIA', 'SI')
+INSERT INTO profile_country VALUES ('SOLOMON ISLANDS', 'SB')
+INSERT INTO profile_country VALUES ('SOMALIA', 'SO')
+INSERT INTO profile_country VALUES ('SOUTH AFRICA', 'ZA')
+INSERT INTO profile_country VALUES ('SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS', 'GS')
+INSERT INTO profile_country VALUES ('SPAIN', 'ES')
+INSERT INTO profile_country VALUES ('SRI LANKA', 'LK')
+INSERT INTO profile_country VALUES ('SUDAN', 'SD')
+INSERT INTO profile_country VALUES ('SURINAME', 'SR')
+INSERT INTO profile_country VALUES ('SVALBARD AND JAN MAYEN', 'SJ')
+INSERT INTO profile_country VALUES ('SWAZILAND', 'SZ')
+INSERT INTO profile_country VALUES ('SWEDEN', 'SE')
+INSERT INTO profile_country VALUES ('SWITZERLAND', 'CH')
+INSERT INTO profile_country VALUES ('SYRIAN ARAB REPUBLIC', 'SY')
+INSERT INTO profile_country VALUES ('TAIWAN, PROVINCE OF CHINA', 'TW')
+INSERT INTO profile_country VALUES ('TAJIKISTAN', 'TJ')
+INSERT INTO profile_country VALUES ('TANZANIA, UNITED REPUBLIC OF', 'TZ')
+INSERT INTO profile_country VALUES ('THAILAND', 'TH')
+INSERT INTO profile_country VALUES ('TIMOR-LESTE', 'TL')
+INSERT INTO profile_country VALUES ('TOGO', 'TG')
+INSERT INTO profile_country VALUES ('TOKELAU', 'TK')
+INSERT INTO profile_country VALUES ('TONGA', 'TO')
+INSERT INTO profile_country VALUES ('TRINIDAD AND TOBAGO', 'TT')
+INSERT INTO profile_country VALUES ('TUNISIA', 'TN')
+INSERT INTO profile_country VALUES ('TURKEY', 'TR')
+INSERT INTO profile_country VALUES ('TURKMENISTAN', 'TM')
+INSERT INTO profile_country VALUES ('TURKS AND CAICOS ISLANDS', 'TC')
+INSERT INTO profile_country VALUES ('TUVALU', 'TV')
+INSERT INTO profile_country VALUES ('UGANDA', 'UG')
+INSERT INTO profile_country VALUES ('UKRAINE', 'UA')
+INSERT INTO profile_country VALUES ('UNITED ARAB EMIRATES', 'AE')
+INSERT INTO profile_country VALUES ('UNITED KINGDOM', 'GB')
+INSERT INTO profile_country VALUES ('UNITED STATES', 'US')
+INSERT INTO profile_country VALUES ('UNITED STATES MINOR OUTLYING ISLANDS', 'UM')
+INSERT INTO profile_country VALUES ('URUGUAY', 'UY')
+INSERT INTO profile_country VALUES ('UZBEKISTAN', 'UZ')
+INSERT INTO profile_country VALUES ('VANUATU', 'VU')
+INSERT INTO profile_country VALUES ('VENEZUELA', 'VE')
+INSERT INTO profile_country VALUES ('VIET NAM', 'VN')
+INSERT INTO profile_country VALUES ('VIRGIN ISLANDS, BRITISH', 'VG')
+INSERT INTO profile_country VALUES ('VIRGIN ISLANDS, U.S.', 'VI')
+INSERT INTO profile_country VALUES ('WALLIS AND FUTUNA', 'WF')
+INSERT INTO profile_country VALUES ('WESTERN SAHARA', 'EH')
+INSERT INTO profile_country VALUES ('YEMEN', 'YE')
+INSERT INTO profile_country VALUES ('ZAMBIA', 'ZM')
+INSERT INTO profile_country VALUES ('ZIMBABWE', 'ZW')
Added: code/pythonisti/trunk/pythonisti/apps/profile/views.py
==============================================================================
--- (empty file)
+++ code/pythonisti/trunk/pythonisti/apps/profile/views.py Thu Jan 18 17:41:49 2007
@@ -0,0 +1 @@
+# Create your views here.
Modified: code/pythonisti/trunk/pythonisti/settings.py
==============================================================================
--- code/pythonisti/trunk/pythonisti/settings.py (original)
+++ code/pythonisti/trunk/pythonisti/settings.py Thu Jan 18 17:41:49 2007
@@ -71,7 +71,8 @@
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
- 'pythonisti.apps.geo'
+ 'pythonisti.apps.geo',
+ 'pythonisti.apps.profile',
)
# i18m is enabled by default, we don't need it now, so disable it
Maggiori informazioni sulla lista
Commits