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
Or if you’re not using south (why are you not using south?):
$ python manage.py syncdb
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.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9831a751b2ef08c2d75f61327231aad62e6def6d494d7e3c4b374a80b84902b7 |
|
MD5 | 11b96affe8dac3d1dfc74eb505ae0af7 |
|
BLAKE2b-256 | f18cd64067e969af356998bfe4541d083e4837de8c747c229869ec0bc3da513a |
Close
Hashes for django_taggit_machinetags-0.4.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 467267c78c6b83a5aa239e5fc2e8087a50dc63eaab820a7807fd895bfd15b8e0 |
|
MD5 | 0a08372f95b9420fdb559293697de2a9 |
|
BLAKE2b-256 | 6f6f2d12d40c02c5e9ee730079718ee5354948ae7ec39a03e354f335aa438a07 |