Skip to content

Instantly share code, notes, and snippets.

AbstractBase(models.Model):
foo = somefield
class Base(AbstractBase):
c1 = models.OneToOneField('C1', null=True, blank=True)
c2 = models.OneToOneField('C2', null=True, blank=True)
def c(self):
#only one additional query to get the base
if self.c1_id: