Skip to content

models and model forms #5

Open
Open
@farcepest

Description

@farcepest

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions