Your create view do not accept owner as a input and according to your models, owner can be null. That's the problem. Include owner to your create view fields as shown below. Also you may consider making owner mandatory as mentioned in my previous response.
class CreateDog(CreateView):
model = Dog
fields = ('name', 'bday', 'owner')
template_name = 'animals/dog_create.html'
class CreateCat(CreateView):
model = Cat
fields = ('name', 'bday', 'owner')
template_name = 'animals/cat_create.html'
Thanks
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/340fa5fd-1475-4355-821c-82404b71b6bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment