Skip to main content

Machine tagging built upon django-taggit

Project description

https://badge.fury.io/py/django-taggit-machinetags.png https://travis-ci.org/lpomfrey/django-taggit-machinetags.png?branch=master https://coveralls.io/repos/lpomfrey/django-taggit-machinetags/badge.png?branch=master

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


Download files

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

Source Distribution

django-taggit-machinetags-0.9.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

django_taggit_machinetags-0.9.0-py2.py3-none-any.whl (13.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-taggit-machinetags-0.9.0.tar.gz.

File metadata

  • Download URL: django-taggit-machinetags-0.9.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for django-taggit-machinetags-0.9.0.tar.gz
Algorithm Hash digest
SHA256 e0f7576bd4d0154c237e04922701b523d7b3c7bde3256fbedb001930da4850ba
MD5 d22b1598831bd5375bd6cf1f2ca9a95c
BLAKE2b-256 1cc2d2197ddd14d404dbe1f3601f3782ba661af5935045179442f55a293895c0

See more details on using hashes here.

Provenance

File details

Details for the file django_taggit_machinetags-0.9.0-py2.py3-none-any.whl.

File metadata

  • Download URL: django_taggit_machinetags-0.9.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for django_taggit_machinetags-0.9.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c4acf7b0856ef14c7254727490d01eaac6468338819d77622acc4aa8d0acac80
MD5 3ebf9057840bfcb98033b706e44e3bc0
BLAKE2b-256 d292a80246eff1356d37b464cb93cf284d4e7f86891a21514462425a54ba65ac

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page