Tag-creation forms for django-taggit
Project description
=============
django-taggit-forms
=============
.. image:: https://travis-ci.org/akiraakaishi/django-taggit-forms.svg?branch=master
:target: https://travis-ci.org/akiraakaishi/django-taggit-forms
.. image:: https://coveralls.io/repos/akiraakaishi/django-taggit-forms/badge.svg?branch=master
:target: https://coveralls.io/r/akiraakaishi/django-taggit-forms?branch=master
.. image:: https://codeclimate.com/github/akiraakaishi/django-taggit-forms/badges/gpa.svg
:target: https://codeclimate.com/github/akiraakaishi/django-taggit-forms/badges/gpa.svg
``django-taggit-forms`` handles form submissions to create a tag by use of the ``django-taggit`` package.
Usage
======
Add ``'taggit_forms'`` to your ``INSTALLED_APPS``.
(Make sure that ``taggit`` and ``django.contrib.contenttypes`` are also included in ``INSTALLED_APPS``.)
In your root ``urls.py``, include ``'taggit_forms.urls'`` with the namespace ``'taggit_forms'``.
.. code:: python
urlpatterns = patterns('',
# your urls
url(r'^taggit_forms/', include('taggit_forms.urls', namespace='taggit_forms')),
)
Then, create your model to be tagged with:
.. code:: python
class MyModel(models.Model):
tags = TaggableManager()
Then, in your templates, render a tag-creation form for an instance of ``MyModel`` with the template tag ``render_tag_form``::
{% load taggitforms%}
{% render_tag_form my_obj %}
The form is rendered with the template ``taggit_forms/form.html``.
Altenatively, use the template tag ``get_tag_form`` to assign the form as a context variable::
{% get_tag_form my_obj as tag_form %}
{% for field in tag_form %}
{{ field }}
{% endfor %}
django-taggit-forms
=============
.. image:: https://travis-ci.org/akiraakaishi/django-taggit-forms.svg?branch=master
:target: https://travis-ci.org/akiraakaishi/django-taggit-forms
.. image:: https://coveralls.io/repos/akiraakaishi/django-taggit-forms/badge.svg?branch=master
:target: https://coveralls.io/r/akiraakaishi/django-taggit-forms?branch=master
.. image:: https://codeclimate.com/github/akiraakaishi/django-taggit-forms/badges/gpa.svg
:target: https://codeclimate.com/github/akiraakaishi/django-taggit-forms/badges/gpa.svg
``django-taggit-forms`` handles form submissions to create a tag by use of the ``django-taggit`` package.
Usage
======
Add ``'taggit_forms'`` to your ``INSTALLED_APPS``.
(Make sure that ``taggit`` and ``django.contrib.contenttypes`` are also included in ``INSTALLED_APPS``.)
In your root ``urls.py``, include ``'taggit_forms.urls'`` with the namespace ``'taggit_forms'``.
.. code:: python
urlpatterns = patterns('',
# your urls
url(r'^taggit_forms/', include('taggit_forms.urls', namespace='taggit_forms')),
)
Then, create your model to be tagged with:
.. code:: python
class MyModel(models.Model):
tags = TaggableManager()
Then, in your templates, render a tag-creation form for an instance of ``MyModel`` with the template tag ``render_tag_form``::
{% load taggitforms%}
{% render_tag_form my_obj %}
The form is rendered with the template ``taggit_forms/form.html``.
Altenatively, use the template tag ``get_tag_form`` to assign the form as a context variable::
{% get_tag_form my_obj as tag_form %}
{% for field in tag_form %}
{{ field }}
{% endfor %}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-taggit-forms-0.1.1.tar.gz
.
File metadata
- Download URL: django-taggit-forms-0.1.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e49c97c83f15d1f91f652857ae8420060441d343b57f218cc5a17dced2e980c |
|
MD5 | 191c231dd4ef3906a86181eba42ad817 |
|
BLAKE2b-256 | a73f6da4cfa05b6340f8060c705bd28b7a912484904cf46dec6082843002c969 |
File details
Details for the file django_taggit_forms-0.1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: django_taggit_forms-0.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c44288693b92ba50866992dfacc75419898d281906a4d3f9de146136601b8f0a |
|
MD5 | d2d935de0910d94dda7ad19ba250f0ee |
|
BLAKE2b-256 | 470d0f8ee4a826d660248e34b951707f9477096bf64dd254391f003858848951 |