diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-07-30 13:09:01 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-07-30 13:09:01 -0500 |
commit | 3cdf366acfb577e735abc7fee6c8395fa97c8b48 (patch) | |
tree | 7a7287235d3597cebc0272532971726e10110e47 /mediagoblin/db | |
parent | 482d53cd30229798ff58f9d6f3cbb3b86f94f218 (diff) | |
parent | f99b5caeb68cb60d768f0e049388a6f4a8b68ac0 (diff) | |
download | mediagoblin-3cdf366acfb577e735abc7fee6c8395fa97c8b48.tar.lz mediagoblin-3cdf366acfb577e735abc7fee6c8395fa97c8b48.tar.xz mediagoblin-3cdf366acfb577e735abc7fee6c8395fa97c8b48.zip |
Merge branch 'remotes/gullydwarf-cfdv/f360_tagging' (early part) into mergetags
Conflicts:
mediagoblin/config_spec.ini
mediagoblin/edit/views.py
mediagoblin/util.py
Diffstat (limited to 'mediagoblin/db')
-rw-r--r-- | mediagoblin/db/indexes.py | 15 | ||||
-rw-r--r-- | mediagoblin/db/models.py | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/mediagoblin/db/indexes.py b/mediagoblin/db/indexes.py index a832e013..30d43c98 100644 --- a/mediagoblin/db/indexes.py +++ b/mediagoblin/db/indexes.py @@ -90,6 +90,21 @@ MEDIAENTRY_INDEXES = { # Indexing on uploaders and when media entries are created. # Used for showing a user gallery, etc. 'index': [('uploader', ASCENDING), + ('created', DESCENDING)]}, + + 'state_uploader_tags_created': { + # Indexing on processed?, media uploader, associated tags, and timestamp + # Used for showing media items matching a tag search, most recent first. + 'index': [('state', ASCENDING), + ('uploader', ASCENDING), + ('tags.slug', DESCENDING), + ('created', DESCENDING)]}, + + 'state_tags_created': { + # Indexing on processed?, media tags, and timestamp (across all users) + # This is used for a front page tag search. + 'index': [('state', ASCENDING), + ('tags.slug', DESCENDING), ('created', DESCENDING)]}} diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index bad15aca..4ef2d928 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -184,7 +184,7 @@ class MediaEntry(Document): 'media_type': unicode, 'media_data': dict, # extra data relevant to this media_type 'plugin_data': dict, # plugins can dump stuff here. - 'tags': [unicode], + 'tags': [dict], 'state': unicode, # For now let's assume there can only be one main file queued |