Задать вопрос

Тел: +7 965 3737 888

400

Просмотров

0

Ответов

DRY with common model fields

If you have many models that all share the same fields, this might be an option. Please note that order matters: Your model need to inherit from TimestampedModelBase first, and models.Model second. The fields are added directly to each model, e.g. while they will be duplicated on the database level, you only have to define them once in your python code.

Not sure if there is a way to automate the call to TimestampedModelInit().

Tested with trunk rev. 5699. There is probably a slight chance that future revisions might break this.

Вопрос полезен? Да0/Нет0
file_2866.py(796.0б)
None