ambitioninc/django-entity — pull request #31 by wesleykendall (2014-06-10 05:42:54+00:00)
Title: Major enhancements in Django Entity

@Wilduck @jmcriffey

This PR includes major enhancements to Django Entity and introduces backwards-incompatible changes:
- Entity syncing is extremely fast now. It is still linear to the number of entities, but only syncs entity relationships one time. This takes the previous query counts for about 120 entities down from 3000 to just a couple hundred.
- Syncing single entities is also really fast as well since the user can now cache all related values in querysets when configuring entities
- Entity configuration is totally different. Previously, we had to make a model inherit from an entity mixin. This was very restrictive since we couldn't mirror things like Django Groups. Now, entities are explicitly registered with their configs using a pattern similar to how a user registers an admin with a model in Django.
- Many to many fields are watched now. If an M2M changed signal happens, the model that has the M2M will resync.
- Models can watch other models for changes. For example, assume an account points to a user that has a m2m to groups and the account wants those groups as super entities. The account can now watch the user model for when its groups change and the sync will still be kicked off
- The interface to django entity is more clear. The use of the words 'any' and 'all' are in the interface now so that users know they are searching for entities that are sub entities of all super entities provided (for example)

I updated the docs to try to be clear on the changes. Let me know if there is any major confusion in the docs. Django entity is a pretty big package now with a lot of functionality. The docs are still going to need more work after this.

@wesokes @jaredlewis @joshmarlow feel free to take a look if you have time too