Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to use custom ModelForm #8

Open
yakky opened this issue Jan 3, 2015 · 2 comments
Open

Document how to use custom ModelForm #8

yakky opened this issue Jan 3, 2015 · 2 comments

Comments

@yakky
Copy link
Collaborator

yakky commented Jan 3, 2015

In https://github.com/ella/django-appdata/blob/master/app_data/forms.py#L248 a model_form is created from standard modelform_factory, but sometimes you'd want to provide a custom ModelForm.
Adding a model_form argument and generating the model form only if empty, would allow this.
I can provide a PR for this

@honzakral
Copy link
Member

A PR would be welcome.

I originally envisioned people would just use the **kwargs part that we pass to the factory that can contain a form which will then be used as a superclass for the generated ModelForm (inside modelform_factory) but that is probably too complicated in some cases.

@yakky
Copy link
Collaborator Author

yakky commented Jan 3, 2015

Have I really been so dumb?
Obviously the form kwargs works nicely!
I reworded the title, as probably it'd be useful to document how to do this (even if it's standard Django stuff)

@yakky yakky changed the title Allow using custom ModelForm Document how to use custom ModelForm Jan 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants