mango r234 - in branches/django: . mango



Author: ovitters
Date: Sun Jun 22 22:29:38 2008
New Revision: 234
URL: http://svn.gnome.org/viewvc/mango?rev=234&view=rev

Log:
	* mango/models.py (Foundationmembers, Ftpmirrors): Ensure first_added
	will have the current date. Update the Ftpmirrors to use more specific
	model fields (allowing Django to verify it).


Modified:
   branches/django/   (props changed)
   branches/django/ChangeLog
   branches/django/mango/models.py

Modified: branches/django/mango/models.py
==============================================================================
--- branches/django/mango/models.py	(original)
+++ branches/django/mango/models.py	Sun Jun 22 22:29:38 2008
@@ -46,7 +46,7 @@
     lastname = models.CharField(max_length=50, blank=True)
     email = models.EmailField(max_length=255, blank=True)
     comments = models.TextField(blank=True)
-    first_added = models.DateField()
+    first_added = models.DateField(auto_now_add=True)
     last_renewed_on = models.DateField(null=True, blank=True)
     last_update = models.DateTimeField()
     resigned_on = models.DateField(null=True, blank=True)
@@ -58,16 +58,25 @@
     class Meta:
         model = Foundationmembers
 
+LOCATION_CHOICES = (
+    ('United States and Canada', 'United States and Canada'),
+    ('Australia', 'Australia'),
+    ('Europe', 'Europe'),
+    ('Asia', 'Asia'),
+    ('South America', 'South America'),
+    ('Other', 'Other'),
+)
+
 class Ftpmirrors(models.Model):
     id = models.AutoField(primary_key=True)
-    name = models.CharField(max_length=60, blank=True)
-    url = models.CharField(max_length=300, blank=True)
-    location = models.CharField(max_length=72, blank=True)
-    email = models.CharField(max_length=120, blank=True)
+    name = models.CharField(max_length=60)
+    url = models.URLField(verify_exists=False)
+    location = models.CharField(max_length=72, choices=LOCATION_CHOICES)
+    email = models.EmailField()
     comments = models.TextField(blank=True)
     description = models.TextField(blank=True)
     active = models.BooleanField()
-    last_update = models.DateTimeField(blank=True)
+    last_update = models.DateTimeField(auto_now=True)
     class Meta:
         db_table = u'ftpmirrors'
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]