Here is the definition of the field:

    date_due       = models.DateField(auto_now_add=True)



On Sep 9, 12:57 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Sep 9, 11:49 am, mettwoch <mettw...@pt.lu> wrote:
>
>
>
> > Hi,
>
> > I don't understand why the following code produces an error (see
> > below):
>
> > >>> from django import forms
> > >>> from ishop.bo.models import Document
> > >>> d = Document.objects.get(pk=80000)
> > >>> print d.date_due
> > 2009-08-28
> > >>> class df(forms.ModelForm):
> > >>>     class Meta:
> > >>>         model = Document
> > >>>         fields = ('status', 'date_due', 'number')
> > >>> f = df(instance=d)
> > >>> f.as_table()
>
> > produces the following error
> <snip>
> > AttributeError: 'NoneType' object has no attribute 'label'
>
> > The same code works fine when removing the 'date_due' field from the
> > list of fields to be displayed.
>
> > Thanks for any hint
>
> > Marc
>
> Can you show the Document model definition, or at least the
> declaration of the date_due field?
> --
> DR.
--~--~---------~--~----~------------~-------~--~----~
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