A
A
Andrew2012-12-01 15:05:45
PostgreSQL
Andrew, 2012-12-01 15:05:45

Complex sorting of objects?

Good afternoon!
There is an online store site. It has many, many products and many categories.
There was an idea, is it possible to make a unique sorting of products for each combination of categories?
That is, there are three parameters, parameter1, parameter2, parameter3.
For example, if the user has selected parameter1, he has one sorting, parameter2 - another, three - the third.
I chose parameter 1, parameter 2 - one more.
Haven't figured out yet how to solve this for django without high database load ( postgresql ) and very perverted solutions.
Each parameter is a manytomany relation, that is, many different parameters can be bound.
I would be grateful for any ideas! Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vyacheslav Slinko, 2012-12-01
@KeepYourMind

Sort all options in advance and cache them.

A
Andrew, 2012-12-01
@xmdy

After several hours, a complex solution was found that basically works)
Result - 1 query goes to the database, slightly modified by hand, that is, raw sql is executed)
Who cares about the result?)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question