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

models and model forms #5

Open
farcepest opened this issue Oct 25, 2017 · 0 comments
Open

models and model forms #5

farcepest opened this issue Oct 25, 2017 · 0 comments

Comments

@farcepest
Copy link

If you feed .convert_form() a ModelForm, it will likely seem to hang if the ModelForm contains any ModelChoiceField and there is a significant amount of data in the queryset of those fields. Recommending explicit treatment of ModelChoiceField in .convert_formfield() so that you get either type is whatever type the model's pk is (usually integer) or possibly a url (or both); Model._meta.pk tells you what field this is.

to get a model form from a model, use modelform_factory() from django.forms

I'll try to make a PR at some point

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

1 participant