[Django]-Django listing model fields in order

3👍

Django’s built-in functions may help:

from django.forms.models import fields_for_model

...
fields = fields_for_model(UserInfo).keys()

returns

['concerning', 'title', 'first_name', ...]
👤Selcuk

Leave a comment