Django

Code

Changeset 6803

Show
Ignore:
Timestamp:
12/01/07 13:31:53 (1 year ago)
Author:
adrian
Message:

Edited docs/newforms.txt changes from [6740]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/newforms.txt

    r6802 r6803  
    757757~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    758758 
    759 You may wish to show a visitor which fields are required. Here is the above 
    760 example modified to insert an asterix after the label of each required field:: 
     759It's common to show a user which fields are required. Here's an example of how 
     760to do that, using the above example modified to insert an asterisk after the 
     761label of each required field:: 
    761762 
    762763    <form method="post" action=""> 
     
    773774 
    774775The ``{% if field.field.required %}*{% endif %}`` fragment is the relevant 
    775 addition here. It adds the asterix only if the field is required. Note that we 
    776 check ``field.field.required`` and not ``field.required``. In the template, 
    777 ``field`` is a ``newforms.forms.BoundField`` instance, which holds the actual 
    778 ``Field`` instance in its ``field`` attribute. 
     776addition here. It adds the asterisk only if the field is required. 
     777 
     778Note that we check ``field.field.required`` and not ``field.required``. In the 
     779template, ``field`` is a ``newforms.forms.BoundField`` instance, which holds 
     780the actual ``Field`` instance in its ``field`` attribute. 
    779781 
    780782Binding uploaded files to a form