ambitioninc/django-entity — pull request #44 by wesleykendall (2014-09-21 20:48:28+00:00)
Title: Entity Tagging

@Wilduck @robdmc this extends Djagno Entity to be built around tags instead of types.

The primary deficiency encountered with filtering by the entity content type was related to the fact that different entities had to be stored in different models. This can be problematic when modeling a grouping of entities that already distinguishes its type in some other form than its Django model.

I went ahead and added the ``is_sub_to_any`` query in this PR since it has been useful. I also stripped out various entity filtering capabilities that were provided directly on top of models or directly on top of the super and sub entities returned by respective get_super_entities and get_sub_entities commands. I did this because those interfaces were seldom used. I instead opted for making our manager/queryset interface the primary way of filtering entities.

You'll notice that I changed is_any_type to is_any_tag since tagging is a superset of types. There is no direct need for entity types now other than to grab the concrete entity stored on disk.

I went ahead and made an EntityTag manager. I think this will be beneficial later on when we want to do various queries to the tags, such as listing all tags that have relationships sub to other tags. We have already come across this use case quite often. For now I have left out some of these useful queries since this change is already pretty large.

One other note - entity tags will work by default and will use the values from the content types of entities, so no changes are needed on any user's part other than changing any usage of is_any_type to is_any_tag