How to rework list of items (model instances page) in AdminSite?
7 views
Skip to first unread message
Dominis
unread,
Jun 15, 2012, 4:23:48 AM6/15/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
Hello. I try to make a simple structured model of data (categories for articles instances) and now cant find right way to reorder/rebuild list of elements, which rendering in admin site. Explain: It's easy to switch ordering by 'ordering = ['field_name']', but it's just an order. I need to change algorithm which choose order of elements for render. I need make tree such structure -root_category_1 --child_category_1 --child_category_2 --child_category_3 -root_category_2 --child_category_1 --child_category_2 etc. In addition i need to order elemnts in that branches. But i think it's not hard... So how can i do it? In documentation i find nice way - use queryset function. But it should to return queryset... and i can't create structure what i need in one queryset... How can i solve it?