{{{
class Book(models.Model):
pass
class Chapter(models.Model):
book = models.ForeignKey(Book, on_delete=models.CASCADE)
class Meta:
order_with_respect_to = 'book'
}}}
It would be very nice to add some obvious features to this feature, for
example:
* `book.get_chapter_order()` returns the IDs of the chapters. Why not the
chapter objects itself?
* Given a chapter, we can get the next and the previous chapters, but we
can't easily get that chapter's order.
* It would be very nice to be able to add a chapter directly in a specific
position, pretty much like python's `insert`. For example:
`book.insert_chapter(chapter, 3)`
I know it's a very broad request, but, if you guys like the idea, I'd love
to take a look if I can add the functions myself (one at a time, to get
your approval on each of them).
--
Ticket URL: <https://code.djangoproject.com/ticket/29156>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Someday/Maybe
Comment:
Ideally, a ticket should propose one feature rather than several. I'm not
sure what complexity might be involved in these issues, but I guess we
could evaluate a patch.
--
Ticket URL: <https://code.djangoproject.com/ticket/29156#comment:1>