diff options
author | xray7224 <jessica@megworld.co.uk> | 2013-09-02 19:25:24 +0100 |
---|---|---|
committer | Jessica Tallon <jessica@megworld.co.uk> | 2014-07-22 23:13:14 +0100 |
commit | 98596dd072597c5d9c474e882f57407817d049f5 (patch) | |
tree | 27c3e20040d8e76ac6cf41c6a7b1fa17d0a8afc4 /mediagoblin/db/models.py | |
parent | 37f070b06786c20f320231bc467b35ccab6270dc (diff) | |
download | mediagoblin-98596dd072597c5d9c474e882f57407817d049f5.tar.lz mediagoblin-98596dd072597c5d9c474e882f57407817d049f5.tar.xz mediagoblin-98596dd072597c5d9c474e882f57407817d049f5.zip |
Support for the comments endpoint
Diffstat (limited to 'mediagoblin/db/models.py')
-rw-r--r-- | mediagoblin/db/models.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index 91efc0b6..4377f60f 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -455,7 +455,9 @@ class MediaEntry(Base, MediaEntryMixin): }, "fullImage":{ "url": request.host_url + self.original_url[1:], - } + }, + "published": self.created.isoformat(), + "updated": self.created.isoformat(), } if show_comments: @@ -465,7 +467,13 @@ class MediaEntry(Base, MediaEntryMixin): # we only want to include replies if there are any. context["replies"] = { "totalItems": total, - "items": comments + "items": comments, + "url": request.urlgen( + "mediagoblin.federation.object.comments", + objectType=self.objectType, + uuid=self.slug, + qualified=True + ), } return context |