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-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea2d9959c8191705411b13ff0a3fe2b3fa86c463104490b386ba6ce79aac67a0 |
|
MD5 | fdda2c0b86399787110c5d350df75a07 |
|
BLAKE2b-256 | 78e25fc820258a5d7b241c494d6384b65661b9c4ad691d47c01a56bbcb2a8e08 |
Close
Hashes for django_taggit_machinetags-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a04b4f280525bec3b17cde0813fb8ec396676ed220b622439dac6b474d2c3be6 |
|
MD5 | 847c9a22b5e68ea4e65ebcf6aa75ac25 |
|
BLAKE2b-256 | e7e27e7ed1d09bf5c3826781611777638cff3e52483d0696de85d959e2f719b1 |