0

I have a question about how to design a django model. Here is the problem. I have one model, which is a table of URLs that can be submitted to my app. I also, through a many to many relationship, have made the ability to combine the URLs into 'collections'. This works just fine however, I would like to add the ability to order and reorder the links in a collection. So for example, the list of links id [a,b,c,d]. User1 creates a collection of [d,a,c], while User2 creates a collection of [a,c,d], and User3 creates a collection of [c,d,b]. Is there a simple way to add this functionality with my current design?

I am using python3, django1.8 and postgres, if that matters at all.

Thanks in advance.

1 Answer 1

1

You can make a ManyToManyField connect via an intermediary model. This model can control the sorting of the entries. Take a look at for example this question and answer: Django ManyToManyField ordering using through?.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.