Hi All,

does anybody have experience with the following data model and could advise 
which Django tools fit it best?

Background:
I have two types of Components (Core and Complex) that share many 
attributes and methods, but also have their own, specific data fields and 
methods.

What complicates the design is the fact, that ComplexComponent might have 
CoreComponents assigned to it. A CoreComponent instance might be a 
"self-standing" entity without any relation to ComplexComponent, but there 
are also CoreComponents created only for the purpose of "building" 
ComplexComponents.
ComplexComponent (although complex :) ) might (or might not) use 
CoreComponents in its structure ("complexity" comes then from a different, 
unrelated feature).

99.99% of the time I need to be able to handle instances of CoreComponent 
(self-standing entities) and instances of ComplexComponent (with their 
linked core components) separately in different views/areas of my 
application, however I can envision some special use cases where I would 
need to use aggregation on both types to return data for some dash board 
type of views (e.g. average cost of all components created this year).
Also, when a ComplexComponent is handled/displayed in the view, I need to 
be able to access CoreComponents that "compose" it (if applicable).

I'm trying to figure out what Django tools to use for modelling this setup 
and would be thankful to hear your take on that problem.

My current setup uses base Component concrete model and 
CoreComponent/ComplexComponent deriving from it (and also being concrete 
models).
I end up with three different tables. Having core components and complex 
components in separate tables seemed right initially, but I know this 
approach might be difficult to handle down the road, so I'm thinking about 
restructuring it and using e.g. Proxy models instead? If I rebuild these 
models now, I would prefer to do it "right".

Does anybody have experience with a similar (the same?) design and could 
advise what would be the best tool in Django to implement this?

Below a simplified view of the classes in scope (only for demonstration 
purpose).

Many thanks for any feedback.

Have a nice day!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/36e6d27b-fd5d-4891-b999-0863a81ade85n%40googlegroups.com.

Reply via email to