Quantcast
Channel: Django forms with Foreign keys - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by CrazyGeek for Django forms with Foreign keys

I think you should add required fields in meta class such as class ThreadForm(ModelForm): class Meta: model = Thread fields = ('Books', 'User')Please understand the work flow to use foreign keys in...

View Article



Answer by Daniel Qiu for Django forms with Foreign keys

if you are creating a form for Prices, try putting this in your model form:products = forms.ModelMultipleChoiceField(queryset=Product.objects.all())

View Article

Django forms with Foreign keys

I have scenario in which a user can have multiple books. I can create two different models for user and books and relate them using foreign keys (or one-to-many will be right way ?).I have created a...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images