Ticket #6690: modelforms.patch
File modelforms.patch, 721 bytes (added by , 17 years ago) |
---|
-
docs/modelforms.txt
358 358 359 359 Chances are these notes won't affect you unless you're trying to do something 360 360 tricky with subclassing. 361 362 Dynamically creating ModelForms 363 ------------------------------- 364 365 In some cased the model or the fields aren't known in advance. 366 Using Python's dynamic class creation such cases can easily be handled. 367 368 >>> # Dynamically create a ModelForm subclass 369 ... MyMeta = type("MyMeta", (), {'model': MyModel, 'fields': ('field1', 'field2')}) 370 ... MyForm = type("MyForm", (ModelForm,), {"Meta": MyMeta})