Define an order for ManyToManyField with Django

后端 未结 5 698
清酒与你
清酒与你 2020-12-13 02:15

Is there a way to define the order of objects related through a ManyToManyField?

Example:

  • ArticleContainer1 contains in this order :
    article

5条回答
  •  忘掉有多难
    2020-12-13 02:50

    I use that plugin: https://github.com/jazzband/django-sortedm2m
    This works just fine
    I had some troubles with migrations because i hadn't read usage of the plugin, pay attention on it

提交回复
热议问题