4 _meta method

1. Obtain the application name where the model table

models.Book._meta.app_label

2. Get the table corresponding to the model name string lowercase

models.Book._meta.model_name

Gets the field objects

models.Book._meta.get_field('title')

Gets a field object verbose_name property when you do not specify when the default is the name of the string field

models.Book._meta.get_field('price').verbose_name

Guess you like

Origin www.cnblogs.com/huanghongzheng/p/11294834.html