in SQL, or Django ORM, what's the conventional way to have an ordered one-to-many?

前端 未结 5 669
暗喜
暗喜 2021-02-06 07:12

Say I wanted to have a project, and one-to-many with to-do items, and wanted to re-order the to-do items arbitrarily?

In the past, I\'ve added a numbered order field, a

5条回答
  •  甜味超标
    2021-02-06 08:02

    This is a late answer to the question, but I just wanted to chime in and point out that B-Trees are a great data structure for this sort of thing, especially if your access patterns don't require you to retrieve the entire list at once.

    http://en.wikipedia.org/wiki/B-tree

提交回复
热议问题