Created
March 27, 2015 10:59
-
-
Save mrvdb/112dd7f7034843af94f5 to your computer and use it in GitHub Desktop.
Allow to get one entry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/mediagoblin/plugins/api/views.py b/mediagoblin/plugins/api/views.py | |
index 2334106..987261e 100644 | |
--- a/mediagoblin/plugins/api/views.py | |
+++ b/mediagoblin/plugins/api/views.py | |
@@ -104,6 +104,11 @@ def get_entries(request): | |
# TODO: Make it possible to fetch unprocessed media, or media in-processing | |
entries = entries.filter_by(state=u'processed') | |
+ # allow getting one entry | |
+ m_id = int(request.GET.get('id') or 0) | |
+ if m_id: | |
+ entries = entries.filter_by(id=m_id) | |
+ | |
# TODO: Add sort order customization | |
entries = entries.order_by(request.db.MediaEntry.created.desc()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment