Skip to main content

Tag-creation forms for django-taggit

Project description


.. image::

.. image::

.. image::

``django-taggit-forms`` handles form submissions to create a tag by use of the ``django-taggit`` package.


Add ``'taggit_forms'`` to your ``INSTALLED_APPS``.
(Make sure that ``taggit`` and ``django.contrib.contenttypes`` are also included in ``INSTALLED_APPS``.)
In your root ````, 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-taggit-forms, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size django_taggit_forms-0.1.1-py2.py3-none-any.whl (7.7 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size django-taggit-forms-0.1.1.tar.gz (4.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page