Something like that?
def model_form_factory(model_class):
class MyModelForm(forms.ModelForm):
class Meta:
model = model_class
return MyModelForm
AuthorForm = model_form_factory(Author)
BookForm = model_form_factory(Book)
Missatge de Yoo del dia dt., 28 de maig 2019
Crispy forms is also good
http://django-crispy-forms.readthedocs.io/en/latest/
On 1/24/17, Fred Chevitarese wrote:
> Hey!
>
> I use this app to make my job easier :P
> https://github.com/dyve/django-bootstrap3
>
> Just install it and follow the instructions ;)
>
>
> Cheers!
>
>
>
> *"*
> *São os
Hey!
I use this app to make my job easier :P
https://github.com/dyve/django-bootstrap3
Just install it and follow the instructions ;)
Cheers!
*"*
*São os homens que mais me surpreendem na humanidade. Porque perdem a saúde
para juntar dinheiro, depois perdem dinheiro para recuperar a saúde. E
Thanks. I'll take a look at the articles.
On Feb 2, 3:42 am, Derek wrote:
> The same question was asked on
> stackoverflow:http://stackoverflow.com/questions/2303268/djangos-forms-form-vs-form...
> Its a good explanation - I liked the bit at the end:
> "The similarities are that they both genera
The same question was asked on stackoverflow:
http://stackoverflow.com/questions/2303268/djangos-forms-form-vs-forms-modelform
Its a good explanation - I liked the bit at the end:
"The similarities are that they both generate sets of form inputs
using widgets, and both validate data sent by the bro
Yup It worked! I saved the form with excluded foreign key with commit=False.
Then set the proper instance to foreign key and then saved. It worked just
fine.
Thanks for the help :)
On Thu, Aug 27, 2009 at 10:47 PM, Shawn Milochik wrote:
>
> There are different options, depending on whether the i
There are different options, depending on whether the instance of B is
a required part of A's model.
1. You can add an "exclude" section to your ModelForm of A. Validate
BForm, validate AForm, then take the resulting instance of A and set
it's 'b' attribute to the resulting instance of BFor
7 matches
Mail list logo