I would like to create a models.Model class that did not become part of the database, but simply an interface to other models (I want to avoid code repeating).
Something like that:
class Interface(models.Model): a = models.IntegerField() b = models.TextField() class Foo(Interface): c = models.IntegerField() class Bar(Interface): d = models.CharField(max_length='255')
Thus, my database should only have Foo (with columns a, b, c) and Bar (with columns a, b, d), but not a table interface.
source share