V
V
Vladimir Kuts2016-09-14 14:52:18
Django
Vladimir Kuts, 2016-09-14 14:52:18

How to sort correctly?

There is a certain model (hundreds of thousands of records)
In the view we get a certain selection (a bunch of filters superimposed on each other) of the model (say, tens of thousands with pagination)
There is a user who displays instances of this model in the form of cards.
The user changes the order of displayed cards on his desktop. And keeps order.
Now, in any selection, if these cards fall into the selection, they should be displayed in the order in which the user placed them. If he put a certain card first, then when he gets into any sample, it should be given out first.
The question is how to organize the order of displaying cards for the user without dropping performance during the selection.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2016-09-15
@sim3x

As an option

class CustomBullshit(Model):
   user = ForeignKey(User)
   bullshit = ForeignKey(Bullshit)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question