Django - Overriding the Model.create() method?

后端 未结 7 962
忘了有多久
忘了有多久 2020-12-04 08:36

The Django docs only list examples for overriding save() and delete(). However, I\'d like to define some extra processing for my models onl

7条回答
  •  情深已故
    2020-12-04 09:36

    You can override the create method with a custom manager or add a classmethod on the model class. https://docs.djangoproject.com/en/1.11/ref/models/instances/#creating-objects

提交回复
热议问题