What is doing __str__ function in Django?

前端 未结 6 2281
猫巷女王i
猫巷女王i 2021-02-13 13:09

I\'m reading and trying to understand django documentation so I have a logical question.

There is my models.py file

from django.db import mo         


        
6条回答
  •  眼角桃花
    2021-02-13 13:39

    This overrides the default name of the objects of this class, it's something like Author:object which isn't very helpful.

    overriding it gives a more human friendly name of the object like the Author.name

提交回复
热议问题