reg: Django model sequense of the fields

23 views
Skip to first unread message

Amitesh Sahay

unread,
May 8, 2019, 11:52:47 AM5/8/19
to Django Users
Hello Users, 

I am seeing a very strange issue with my Django models. 
in my models.py, I have 21 fields. Out of them , the 6th field is DASHBoard. However, when I see those fields in my postgres DB through PgAdminIII, it is listed at the very end of the list. 

Sorry, for security reasons I couldn't give the list of the fields here.

Could there be any explanation for this situation?

Regards,
Amitesh Sahay

Vinicius Assef

unread,
May 8, 2019, 11:56:34 AM5/8/19
to django...@googlegroups.com
Is it a problem?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1048828608.1995499.1557330720573%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.

Jani Tiainen

unread,
May 9, 2019, 6:57:22 AM5/9/19
to django...@googlegroups.com
Hi.

There is no correlation between field order in your model and order in database or database tools.

They though accidentally be the same. 

--

Akash Sinha

unread,
May 17, 2019, 8:16:51 AM5/17/19
to django...@googlegroups.com
Hello 

This happens for 2 reasons

1st. Those fields might be Foreign key, Foreign key fields are shown at the end in DB.


2nd.  You have added those fields later in our model class, if you will add new fields in model.py file those fields will be listed at the end.




Test Bot

unread,
May 17, 2019, 9:44:01 AM5/17/19
to django...@googlegroups.com
[Just Curious] would it matter in any way what the position of field is in the respective tables.

Akash Sinha

unread,
May 18, 2019, 4:01:28 AM5/18/19
to django...@googlegroups.com
Position doesn't matters.

Reply all
Reply to author
Forward
0 new messages