@owned_by

Hi,
this is a decorator to add to model classes:

     @owned_by('shop__user')
     class Item(models.Model)
         shop = ForeignKey(Shop)
         ...

When Item instance is created and saved, the decorator will assign to the user specified in the field lookup ('shop__user') all permissions on the instance.

If you need only specific pemissions, do this:

    @owned_by('shop__user', ('change_item', 'view_item'))
    ...

I haven't written any tests for this. The docstrings might need improvement.

Please, can you tell me what you I need to add this to your project?