[EMAIL PROTECTED] ha scritto:
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


Ottimo!

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)
+

Io direi di rendere name la primary key.

+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)
+

Come detto altrove, la mia idea era che administrative_area rappresentasse, negli stati federali, lo stato.

Io aggiungerei dei commenti anche in address e city.
Address indica solo la via, o anche (per l'Italia) il paese?

city indica (per l'Italia) il paese o la provincia di appartenenza?

[...]
>

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')

Una curiosità: ma che lingua è usata?
Ci sono caratteri accentati, quindi non è inglese.

> [...]

Un'altra cosa da fare in futuro è di convertire il file in CSV, giusto per avere testo con entropia minima.



Saluti  Manlio Perillo
_______________________________________________
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python

Rispondere a