Hi,

In the example you give I see some identeation problems. It should
rather be:

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 Admin:
        pass

'class Admin' should be at the same indentation level as your class
attribute, e.g. 'question' or 'pub_date'.

On Jun 27, 4:54 pm, Moodie <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've been going over this, but for some reason the Polls app is not
> showing up in the admin after adding 'class Admin: pass' to the poll
> model. I've searched through this user group, and have tried all the
> things suggested, but am still not having much luck. My models.py page
> looks like this:
>
> from django.db import models
> import datetime
>
> 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 Admin:
>                 pass
>
> class Choice(models.Model):
>     poll = models.ForeignKey(Poll)
>     choice = models.CharField(max_length=200)
>     votes = models.IntegerField()
>     def __unicode__(self):
>         return self.choice
>
> Any help would be great.
> (ps running the latest trunk)
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to