vixi, mesma mensagem do commit anterior...
[cascardo/eventmanager.git] / eventos / models.py
index adcbaa2..39c68e2 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: utf-8; -*-
+# -*- coding: utf8; -*-
 """
 Copyright (C) 2007 Lincoln de Sousa <lincoln@archlinux-br.org>
 
@@ -18,7 +18,11 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.
 """
 from django.db import models
+from django.contrib.localflavor.br.br_states import STATE_CHOICES as _states
 
+# bad hack!
+STATE_CHOICES = [(x, unicode(y).encode('utf8')) for x, y in _states]
+del _states
 
 class Evento(models.Model):
     nome = models.CharField(maxlength=100)
@@ -29,7 +33,7 @@ class Evento(models.Model):
     nome_contato = models.CharField('Nome do contato', maxlength=100)
     telefone = models.CharField(maxlength=100)
     cidade = models.CharField(maxlength=100)
-    uf = models.CharField(maxlength=100) # TODO: should became a combobox
+    uf = models.CharField(maxlength=2, choices=STATE_CHOICES)
     rua = models.CharField(maxlength=100)
     numero = models.CharField('NĂºmero', maxlength=10)
     info_adicional = models.TextField()
@@ -42,7 +46,7 @@ class Evento(models.Model):
         )
 
     def __str__(self):
-        return self.name
+        return self.nome
 
 
 class AreaDeInteresse(models.Model):
@@ -63,9 +67,9 @@ class Palestrante(models.Model):
     nome = models.CharField(maxlength=100)
     email = models.CharField(maxlength=100)
 
-    telefone_residencial = models.CharField(maxlength=11)
-    telefone_celular = models.CharField(maxlength=11)
-    telefone_comercial = models.CharField(maxlength=11)
+    telefone_residencial = models.CharField(maxlength=11, blank=True)
+    telefone_celular = models.CharField(maxlength=11, blank=True)
+    telefone_comercial = models.CharField(maxlength=11, blank=True)
 
     rua = models.CharField(maxlength=100)
     numero = models.CharField(maxlength=10)