Skip to content

Commit 84db553

Browse files
authored
Update README.rst
1 parent d7fed6d commit 84db553

File tree

1 file changed

+8
-24
lines changed

1 file changed

+8
-24
lines changed

README.rst

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ You can be creative with these variables: e.g. a context processor could
103103
set a default CSS error class on all fields rendered by
104104
``{% render_field %}``.
105105

106-
107106
attr
108107
----
109108
Adds or replaces any single html attribute for the form field.
@@ -127,7 +126,6 @@ Examples:
127126
<!-- attributes with double colon Vuejs output: v-bind:class="{active:ValueEnabled}" -->
128127
{{ form.search_query|attr:"v-bind::class:{active:ValueEnabled}" }}
129128

130-
131129
add_class
132130
---------
133131

@@ -176,7 +174,6 @@ Example:
176174
'add_class' filter is just a shortcut for 'append_attr' filter that
177175
adds values to the 'class' attribute.
178176

179-
180177
remove_attr
181178
-----------
182179
Removes any single html attribute for the form field.
@@ -190,7 +187,6 @@ Example:
190187
<!-- removes autofocus attribute from field element -->
191188
{{ form.title|remove_attr:"autofocus" }}
192189

193-
194190
add_label_class
195191
---------------
196192

@@ -205,7 +201,6 @@ Example:
205201
<!-- add 2 extra css classes to field label element -->
206202
{{ form.title|add_label_class:"label_class_1 label_class_2" }}
207203

208-
209204
add_error_class
210205
---------------
211206

@@ -221,7 +216,6 @@ Example:
221216
<!-- add 'error-border' css class on field error -->
222217
{{ form.title|add_error_class:"error-border" }}
223218

224-
225219
add_error_attr
226220
--------------
227221

@@ -250,7 +244,6 @@ Example:
250244
<!-- add 'is-required' css class on field required -->
251245
{{ form.title|add_required_class:"is-required" }}
252246

253-
254247
field_type and widget_type
255248
--------------------------
256249

@@ -275,7 +268,6 @@ Output:
275268
<input id="id_name" type="text" name="name" maxlength="100" />
276269
</div>
277270

278-
279271
Mixing render_field and filters
280272
===============================
281273

@@ -294,7 +286,6 @@ returns:
294286

295287
<input name="category" placeholder="Profession" readonly="readonly" type="text">
296288

297-
298289
Filter chaining
299290
===============
300291

@@ -337,17 +328,17 @@ With 'rightmost filter wins' rule it wouldn't be possible to override
337328
``|attr:"foo:default_foo"`` in main template.
338329

339330
Rendering form error messages
340-
===============================
331+
=============================
341332

342333
This app can render the following form error messages:
343334

344335
1. Field related errors
345-
2. Non-Field related errors
346-
3. All form errors - Displays all field and non-field related errors. If related to a specific field the name is dispayed above the error, if the error is a general form error, displays __all__
347-
336+
2. Non-field related errors
337+
3. All form errors - Displays all field and Non-field related errors. If related to a specific field the name is dispayed above the error, if the error is a general form error, displays __all__
348338

349339
Field related errors
350340
--------------------
341+
351342
To render field related errors in your form:
352343

353344
Example:
@@ -359,8 +350,6 @@ Example:
359350
<span class="text-danger">{{ error }}</span>
360351
{% endfor %}
361352

362-
363-
364353
Example usage:
365354

366355
.. code-block:: html+django
@@ -373,10 +362,9 @@ Example usage:
373362
{% endfor %}
374363
{% endfor %}
375364

365+
Non-field related errors
366+
------------------------
376367

377-
378-
Non-Field related errors
379-
--------------------
380368
Render general form errors:
381369

382370
Example:
@@ -388,7 +376,6 @@ Example:
388376
<span class="text-danger"> {{ form.non_field_errors }}</span>
389377
{% endif %}
390378

391-
392379
Example usage:
393380

394381
.. code-block:: html+django
@@ -401,10 +388,9 @@ Example usage:
401388
{% endfor %}
402389
{% endfor %}
403390

404-
405-
406391
All form errors
407-
--------------------
392+
---------------
393+
408394
Render all form errors:
409395

410396
Example:
@@ -414,8 +400,6 @@ Example:
414400
{% load widget_tweaks %}
415401
{{ form.errors }}
416402

417-
418-
419403
Contributing
420404
============
421405

0 commit comments

Comments
 (0)