django-tree-queries icon indicating copy to clipboard operation
django-tree-queries copied to clipboard

[Request for Info] Difference between path and ordering

Open SafaAlfulaij opened this issue 4 years ago • 1 comments

Hi! I got confused between path and ordering fields now that I'm using UUID as primary keys. I don't know how they should be with integer keys, hence this question. Currently, both fields are exactly equal and contain the uuid of the records. Is this right? Or is it because of my UUID primary keys? And what should each represent? Thanks and sorry if this looks like a basic database question :\

SafaAlfulaij avatar Jun 13 '21 05:06 SafaAlfulaij

Hi @SafaAlfulaij

Yeah, if you don't specify a ordering the siblings will be ordered according to their primary key value.

feincms3 pages use a position field so that content managers may reorder pages in menus on the site (see https://github.com/matthiask/feincms3/blob/ae9ef1aa48062744f3c3fa09f10b4505d5319eac/feincms3/pages.py#L62) and it also offers an interface to do this (see https://github.com/matthiask/feincms3/blob/ae9ef1aa48062744f3c3fa09f10b4505d5319eac/feincms3/admin.py#L54). Here's how this looks: image

I hope this clarifies things.

matthiask avatar Jun 14 '21 07:06 matthiask