On Tue, Mar 17, 2009 at 9:20 AM, TP <tommi.pres...@gmail.com> wrote:
>
> Right I have now changed to use __unicode__
>
> This looks like:
>
>
> from django.db import models
>
> class Poll(models.Model):
>    question = models.CharField(max_length=200)
>    pub_date = models.DateTimeField('date published')
>    def __unicode__(self):
>        return self.question
>    def was_published_today(self):
>        return self.pub_date.date() == datetime.date.today()
>
>
> class Choice(models.Model):
>    poll = models.ForeignKey(Poll)
>    choice = models.CharField(max_length=200)
>    votes = models.IntegerField()
>    def __unicode__(self):
>        return self.choice
>
> This still does not work, any advice?

What exactly do you mean when you say "does not work"?.

Remember that if you are testing this with the interactive shell
(manage.py shell) you need to restart it to see the efefct of the
changes you perform in model.py.

HTH

-- 
Ramiro Morales
http://rmorales.net

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to