Django - Function inside a model. How to call it from a view?

前端 未结 5 739
悲&欢浪女
悲&欢浪女 2021-02-05 12:43

I\'m designing a model in Django but I don\'t know if this is the best way. I have a model called \"History\" and inside this model I\'ve a specialized function that will handle

5条回答
  •  天命终不由人
    2021-02-05 13:09

    I think that it is most appropriate to use custom manager https://docs.djangoproject.com/en/dev/topics/db/managers/ for this problems.

提交回复
热议问题