Re: Updating mixin subclassed instances

2016-11-02 Thread Radek Svarz
@Vijay, thanks. I also had a similar idea, but I was surprised it was not somewhere already implemented. Then I found __subclasses__() as mentioned here http://stackoverflow.com/questions/40353219/updating-django-mixin-subclassed-instances/40353284#40353284 It works (Python 3.3, Django 1.8) ;

Re: Updating mixin subclassed instances

2016-11-01 Thread Vijay Khemlani
You could use a metaclass to keep track of all the classes that inherit from a given one, in a pure Python way it would be something like this class PluginMeta(type): # we use __init__ rather than __new__ here because we want # to modify attributes of the class *after* they have been #

Updating mixin subclassed instances

2016-10-31 Thread Radek Svarz
Hi, I am using my custom permission mixin on several of my apps's models (not all). For the case when I need to merge from the "old - context" permission to the "new - context" permission I want to have function which changes the corresponding permission reference attribute in all models, whic