Tuesday, March 1, 2011

Re: multi model forms

Yeah, I bet that lastname is required=True (which is default). You
probably want to redefine lastname to avoid that.


On Mar 1, 5:25 am, David De La Harpe Golden
<david.delaharpe.gol...@ichec.ie> wrote:
> On 28/02/11 23:13, django wrote:
>
> > hi guys
> > I am new to django.
>
> > I have got two model User(Django built in ) and a model customer, user
> > is foreign key in customer
>
> > class Customer(models.Model):
> >   user = models.ForeignKey(User, related_name='customers')
> >   street = models.CharField(max_length=200)
> >   city = models.CharField(max_length=100)
> >   postal_code = models.IntegerField()
> >   country = models.CharField(max_length=70)
>
> > mainsiteapp_customer.lastname may not be NULL
>
> Did you change your Customer model definition by any chance? Did it
> used to have its own lastname field?

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment