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.6.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89ba84f451254b5a0a7f2e272180927e792a4f0ccb3a83c0dd16605834f15afa |
|
MD5 | 53f6c507b6e978a3b290ab7ac8dd27ba |
|
BLAKE2b-256 | 9de08aa4232a973188ffc6486c576cc955793c2b310776d7a0c4291169a35a0c |
Close
Hashes for django_taggit_machinetags-0.6.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19b3db120ebf5c66762ade24affa9bada8a56414f7c3918bdfb37f813d8fccdb |
|
MD5 | c5f3ffaa09814c2f5320f017c179afb7 |
|
BLAKE2b-256 | 76196c885fe660179c551baa13a93a667029d8fb3f81f2fda1db51684958f669 |