Ticket #6690: modelforms.patch

File modelforms.patch, 721 bytes (added by jdetaeye, 9 years ago)

modelforms documentation update

  • docs/modelforms.txt

    359359Chances are these notes won't affect you unless you're trying to do something
    360360tricky with subclassing.
     362Dynamically creating ModelForms
     365In some cased the model or the fields aren't known in advance.
     366Using Python's dynamic class creation such cases can easily be handled.
     368    >>> # Dynamically create a ModelForm subclass
     369    ... MyMeta = type("MyMeta", (), {'model': MyModel, 'fields': ('field1', 'field2')})
     370    ... MyForm = type("MyForm", (ModelForm,), {"Meta": MyMeta})
Back to Top