On 06 Aug 12:46, Sergi Almacellas Abellana wrote:
> 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.

I don't see such example as a relationship.

> Do you think this is the way to go?

Normally having just 2 use cases is not enough to factorize.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Attachment: pgpoEclwqgHl5.pgp
Description: PGP signature

Reply via email to