How to move readonly_fields on top of page?

382 views
Skip to first unread message

Karol Ołtarzewski

unread,
Nov 4, 2018, 4:16:24 PM11/4/18
to Django users
Good morning guys.

I have a problem namely:
I have to place readonly_fields on top of /admin/<something>/<something>/change page, higher than normal fields.
I was looking through docs and I can't find proper function to achieve that.

What I have to do to reach my goal?

Joel

unread,
Nov 5, 2018, 1:08:42 AM11/5/18
to django...@googlegroups.com
Explain. What do you mean move on top of page? 

--
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/2d680835-393a-4011-8599-495ef8d3da29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nelson Varela

unread,
Nov 5, 2018, 3:02:03 AM11/5/18
to Django users
Yeah. If you define read only fields in django model admin it places the read only fields after non-readonly fields by default in the change view

Shashank Singh

unread,
Nov 5, 2018, 6:17:39 AM11/5/18
to django...@googlegroups.com
Override fields and add readonly_fields first.

Karol Ołtarzewski

unread,
Nov 5, 2018, 9:33:36 AM11/5/18
to django...@googlegroups.com
I want to place normal fields below readonly_fields


Shashank Singh

unread,
Nov 5, 2018, 9:37:14 AM11/5/18
to django...@googlegroups.com
fields = ['a', 'b', 'c']
readonly_fields = ['a', 'b']
A and b will appear before c.

Reply all
Reply to author
Forward
0 new messages