← Back to team overview

ubuntu-accomplishments-contributors team mailing list archive

django model inheritance dilemma

 

Hi,

I have a bit of a dilemma. We have an AccomplishmentBase model, which
is extended by Accomplishment and AccomplishmentProposal models, with
common properties in AccomplishmentBase and custom extra properties
are in the children. A bit of a problem here is that Accomplishment
should have some built in uniqueness checks, maybe application +
descriptor should be unique together. At the same time, there should
be no uniqueness checks on AccomplishmentProposal. Right now there are
no uniqueness checks, which is fine for AccomplishmentProposal, but
Accomplishment needs extra care.

How can we do this nicely in Django? Any ideas are welcome!

Thanks,
Janos

PS: on a related note, we put .application in Accomplishment, but
maybe it's better in AccomplishmentBase? Just wondering...
-- 
Janos Gyerik
http://www.janosgyerik.com/


Follow ups