Groups
Groups
Sign in
Groups
Groups
Django users
Conversations
About
Send feedback
Help
Django form build.
12 views
Skip to first unread message
Tsolmon Narantsogt
unread,
Oct 8, 2014, 4:38:44 PM
10/8/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
Hello everyone , im new in django.
So i wanna add multi product on company. my question is how to build product form. (adding multi)
a. class Company(models.Model):
product=models.ManyToManyField(Product,verbose_name = u'Products')
Thanks.
Collin Anderson
unread,
Oct 8, 2014, 4:59:57 PM
10/8/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
You'll probably want to look at formsets:
https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#django.forms.models.BaseModelFormSet
Can products belong to multiple companies?
If not, I recommend having a models.ForeignKey(Company) on your Product model instead of the ManyToManyField.
Reply all
Reply to author
Forward
0 new messages