Machine tagging built upon django-taggit
Project description
Overview
This package provides machine tagging (i.e. property:value tagging) built on top of django-taggit.
Installation
Grab from PyPI with:
$ pip install django-taggit-machinetags
Update your installed apps:
INSTALLED_APPS = ( ... 'taggit', 'taggit_machinetags', ... )
And run the migrations:
$ python manage.py migrate
Usage
Usage is the same as taggit, but tags can now be specified as, colon-separated, property-value pairs.
# models.py from django.db import models from taggit_machinetags.managers import MachineTaggableManager class MyModel(models.Model): name = models.CharField(...) tags = MachineTaggableManager() # >>> instance = MyModel.objects.all()[0] >>> instance.tags.add('Property:Value') >>> instance.tags.add('Taggy:McTag') >>> instance.tags.get(namespace='Property') <MachineTag: Property:Value> >> MyModel.objects.filter(tags__slug='taggy:mctag') <MyModel:...>
Creating a tag with the string ‘Property:Value’ results in a MachineTag with the namespace namespace=Property, name=Value, namespace_slug=property, name_slug=value, and slug=property:value.
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
Close
Hashes for django-taggit-machinetags-0.8.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83f7ac79e39dc749f1b2adbfe8e5f7eaba546167b256e693fbe40a1f7ee6c400 |
|
MD5 | 8806700d7af5e19c1fb76d932d8bc81f |
|
BLAKE2b-256 | b61654220ebb66b6c93b85f5e972359e7678b2770f9344fdbbcf3e19bac44427 |
Close
Hashes for django_taggit_machinetags-0.8.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6306efb4b7be8bbd5b7f1d7b8edfc06cb0486370bd5a6fb3dca89beb54560a2 |
|
MD5 | 210681e225c1599a7d4153e8ae6a2b6d |
|
BLAKE2b-256 | a86f6149caca6e4cf0b6045d3c0ab7346eac29f51bb9a148690fe65df9726588 |