Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-yin committed Sep 15, 2024
1 parent 00632ad commit a872e7b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/source/formify_helper.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Unlike other form rendering packages, below template tags

```bash
{% form_tag %}
{% render_form %}
{% render_submit %}
{% render_field %}
Expand Down Expand Up @@ -34,6 +35,7 @@ FORMIFY = {
Leveraging Python OOP, you can override some methods of the formify helper to customize the rendering behavior.

```bash
{% form_tag %} -> formify_helper.render_form_tag
{% render_form %} -> formify_helper.render_form
{% render_submit %} -> formify_helper.render_submit
{% render_field %} -> formify_helper.render_field
Expand Down
22 changes: 21 additions & 1 deletion docs/source/tags.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
# Template Tags

A typical case of using formify in a template is like this:

```html
{% load formify %}

{% form_tag form action=url %}

{% csrf_token %}

{% render_form form %}

{% render_submit text='Submit' css_class="btn btn-primary" %}

{% endform_tag %}
```

## form_tag

This tag is to render the form tag, it can help add some attributes to the form tag from the parameters from the template tag.

## render_form

This tag can render form or formset.
This tag can render `form` or `formset`.

It will iterate and render all form fields automatically.

Expand Down

0 comments on commit a872e7b

Please sign in to comment.