python - Django models.Model superclass -
python - Django models.Model superclass -
i create models.model class doesn't became part of database interface other models (i want avoid repeating code).
something that:
class interface(models.model): = models.integerfield() b = models.textfield() class foo(interface): c = models.integerfield() class bar(interface): d = models.charfield(max_length='255')
so database should have foo (with a,b,c collumns) , bar (with a,b,d) not table interface.
"abstract base of operations classes"
abstract base of operations classes useful when want set mutual info number of other models. write base of operations class , set abstract=true
in meta class. model not used create database table. instead, when used base of operations class other models, fields added of kid class.
python django
Comments
Post a Comment