Django

Code

Ticket #7292: modelform.patch

File modelform.patch, 1.0 kB (added by programmerq, 6 months ago)
  • a/docs/form_preview.txt

    old new  
    6969 
    7070       ...and add the following line to the appropriate model in your URLconf:: 
    7171 
    72            (r'^post/$', SomeModelFormPreview(forms.models.form_for_model(SomeModel))), 
    73  
    74        Or, if you already have a Form class defined for the model:: 
    75  
    7672           (r'^post/$', SomeModelFormPreview(SomeModelForm)), 
    7773 
     74       Where ``SomeModelForm`` is a Form class or ModelForm class defined for 
     75       the model. 
     76 
    7877    4. Run the Django server and visit ``/post/`` in your browser. 
    7978 
    8079.. _template loader docs: ../templates_python/#loader-types