> What stage of the tutorial, exactly, did this error occur at? Could
> you also please copy and paste the contents of your models.py file
> with your response?
>
> Jay P.

I am on part 2, 'Custominze the Admin Change List'.  (http://
www.djangoproject.com/documentation/tutorial02/#customize-the-admin-change-list)

Here is my copy of models.

thanks, mateo


from django.db import models
import datetime

class Poll(models.Model):
        question = models.CharField(maxlength=200)
        pub_date = models.DateTimeField('date published')

        def __str__(self):
                return self.question

        def was_published_today(self):
                return self.pub_date.date() == datetime.date.today()
        was_published_today.short_description = 'Published today?'

        class Admin:
            list_display = ('question', 'pub_date', 'was_published_today')
            list_filter = ['pub_date']
            search_fields = ['question']
            date_hierarchy = 'pub_date'
            fields = (
            (None, {'fields': ('question',)}),
            ('Date information', {'fields': ('pub_date',), 'classes':
'collapse'}),
        )


class Choice(models.Model):
        poll = models.ForeignKey(Poll, edit_inline=models.TABULAR,
num_in_admin=3)
        choice = models.CharField(maxlength=200, core=True)
        votes = models.IntegerField(core=True)





--~--~---------~--~----~------------~-------~--~----~
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