El 22/04/15 a les 16:34, Prakash Pandey ha escrit:
Hello folks,

I am working on a module which enables historization on tryton models
dynamically, by dynamic I mean - you can define models in tryton
configuration and history will be enabled for them. Module name is
audit_trail[1]. I am doing a weird hack to make this work[2], working
though!. I had a discussion with pokoli on IRC[3] and he suggested if
tryton could have some mechanism to apply inheritance in all classes in
the pool. So when the pool is loading you can play with the classes to
register, in my case inject _history = True to some classes?

I am not sure how useful this feature would be and the areas where we
can use this. Thoughts please?

For me this is a good improvement in order to add functionalities to all the models in the database. One example:

- Allow to add tags to all the models in the database.

So we can add a TaggableMixin, and override all the classes in the pool.

For impelmenting this we can add a list of hooks that will be called after registering all the classes of the pool. Of course a method for the modules to register the hooks is also required.


--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Reply via email to