models fields in django code example
Example 1: primary key django model
class Garden(models.Model):
garden_id = models.IntegerField(primary_key=True)
Example 2: django model fields list
from posts.model import BlogPost
all_fields = BlogPost._meta.fields
#or
all_fields = BlogPost._meta.get_fields()