db_index‎ and custom ordering

18 views
Skip to first unread message

phretor

unread,
Nov 22, 2011, 4:26:07 AM11/22/11
to Django Photologue
Hello!
I am planning to commit some contribution into django-photologue
because I need to do custom, fast ordering on large collections of
photos.

Here is what I plan to do:

* modify the M2M relationship between "Gallery" and "Photo" and make
it through an intermediate model, so that photos can be ordered into
galleries

** https://docs.djangoproject.com/en/1.3/topics/db/models/#extra-fields-on-many-to-many-relationships
** http://stackoverflow.com/questions/1390556/default-ordering-for-m2m-items-by-intermediate-model-field-in-django

* add a "db_index" option to fields such as "title", "date_taken",
"view_count", "date_added", "is_public" to the "ImageModel" and
"Photo" models

Has anyone of you done something in this direction and want to share
thoughts or code?

Thanks! Cheers,
-F

Reply all
Reply to author
Forward
0 new messages