When I showed the Vote, PostVote, and CommentVote models to some of my colleagues (as part of a discussion about the viability of model inheritance in Django), there was some criticism of the extra join involved in our current approach, and generic foreign keys (which I recall briefly considering at the start of the project before shying away because Django's way of doing that looked complicated) was suggested as a superior alternative. What if we switch to do it that way (that is, our models would look mostly the same except that Vote would have a Meta class with abstract = True, and CommentVote and PostVote would have the appropriate GenericForeignKeys instead of ForeignKeys) by means of writing a terrifyingly complicated but super-educational grand schema/data migration?
When I showed the
Vote,PostVote, andCommentVotemodels to some of my colleagues (as part of a discussion about the viability of model inheritance in Django), there was some criticism of the extra join involved in our current approach, and generic foreign keys (which I recall briefly considering at the start of the project before shying away because Django's way of doing that looked complicated) was suggested as a superior alternative. What if we switch to do it that way (that is, our models would look mostly the same except thatVotewould have aMetaclass withabstract = True, andCommentVoteandPostVotewould have the appropriateGenericForeignKeys instead ofForeignKeys) by means of writing a terrifyingly complicated but super-educational grand schema/data migration?