Re: Model Forms Dynamic

2019-05-28 Thread Alexis Roda
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

Re: Model forms

2017-01-24 Thread Vijay Khemlani
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

Re: Model forms

2017-01-24 Thread Fred Chevitarese
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

Re: Model Forms Customization

2011-02-03 Thread hank23
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

Re: Model Forms Customization

2011-02-02 Thread Derek
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

Re: Model Forms

2009-08-27 Thread Siddharth Godbole
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

Re: Model Forms

2009-08-27 Thread Shawn Milochik
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