import re
from datetime import datetime
+from pytz import UTC
from werkzeug.utils import cached_property
from mediagoblin import mg_globals
return self.content
def serialize(self, request):
+ published = UTC.localize(self.published)
+ updated = UTC.localize(self.updated)
obj = {
"id": self.id,
"actor": self.get_actor.serialize(request),
"verb": self.verb,
- "published": self.published.isoformat(),
- "updated": self.updated.isoformat(),
+ "published": published.isoformat(),
+ "updated": updated.isoformat(),
"content": self.content,
"url": self.get_url(request),
"object": self.get_object.serialize(request),
from mediagoblin.tools.common import import_component
import six
+from pytz import UTC
_log = logging.getLogger(__name__)
def serialize(self, request):
+ published = UTC.localize(self.created)
user = {
"id": "acct:{0}@{1}".format(self.username, request.host),
+ "oublished": published.isoformat(),
"preferredUsername": self.username,
"displayName": "{0}@{1}".format(self.username, request.host),
"objectType": self.object_type,
def serialize(self, request, show_comments=True):
""" Unserialize MediaEntry to object """
author = self.get_uploader
+ published = UTC.localize(self.created)
+ updated = UTC.localize(self.created)
context = {
"id": self.id,
"author": author.serialize(request),
"fullImage":{
"url": request.host_url + self.original_url[1:],
},
- "published": self.created.isoformat(),
- "updated": self.created.isoformat(),
+ "published": published.isoformat(),
+ "updated": updated.isoformat(),
"pump_io": {
"shared": False,
},
)
def serialize(self, request):
+ published = UTC.localize(self.published)
+ updated = UTC.localize(self.updated)
return {
"id": self.id,
"displayName": self.name,
- "published": self.published.isoformat(),
- "updated": self.updated.isoformat(),
+ "published": published.isoformat(),
+ "updated": updated.isoformat(),
"objectType": self.object_type,
}