taigaio/taiga-back — pull request #51 by ikame (2014-06-18 09:15:49+00:00)
Title: Tags using pg arrays

New module `taiga.base.tags` with the following api:

* `TaggedMixin` model mixin that provides a `tags` field.
* `filter(, **filters)` function that filters a
queryset as usual but that also support pgarray-specific filters:

* **contains** `tags.filter(MyModel, contains=["foo"])`
* **contained** `tags.filter(MyModel, contained_by=["foo"])`
* **overlap** `tags.filter(TaggedModel, overlap=["bar"])`
* **len** `tags.filter(TaggedModel, len=2)` `tags.filter(TaggedModel, len__lt=2)`
* **index** `ags.filter(TaggedModel, index__1="bar")`