Hi devs,

I was in the first steps on implementing the Asset Blueprint [1], and I realized that the asset_relationship module will share a lot of code with the party_relationship module [2], so I was thinking to add a RelationshipMixin to reuse the code for both modules. So basically, this module will replace the PartyRelationAll model, in a more generic way (for example the from_, to, and type fields will be customizable). With this improvement other modules implementing relationships, will only need to define de RelationType and Relation models, and the Mixing will be in charge of computing the relation all (relations + reverse relationships).

I also think this Mixin should be usefull for other modules that want to introduce relations between other models. A good example will be the still not existing module product_relationship, which will define relations between products, for example for cross selling them.

Do you think this is the way to go?

Any comments/suggestions will be welcome.


[1] https://code.google.com/p/tryton/wiki/Assets
[2] http://hg.tryton.org/modules/party_relationship

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

Reply via email to