Example #1
0
    def geojson_properties(self, request):
        d = {}
        d['id'] = self.id
        d['title'] = self.title
        d['start_date'] = datetostr(self.start_date)
        d['end_date'] = datetostr(self.end_date)

        return d
Example #2
0
    def _api_serialize(self, request):
        d = {}

        d['created'] = datetostr(self.created)
        d['modified'] = datetostr(self.modified)
        d['uuid'] = self.uuid

        return d
Example #3
0
    def _api_serialize(self, request):
        d = {}

        d['created'] = datetostr(self.created)
        d['modified'] = datetostr(self.modified)
        d['uuid'] = self.uuid

        return d
Example #4
0
    def geojson_properties(self, request):
        d = {}
        d['id'] = self.id
        d['title'] = self.title
        d['start_date'] = datetostr(self.start_date)
        d['end_date'] = datetostr(self.end_date)

        return d
    def geojson_properties(self, request):
        d = {}
        d["id"] = self.id
        d["title"] = self.title
        d["start_date"] = datetostr(self.start_date)
        d["end_date"] = datetostr(self.end_date)

        return d
    def _api_serialize(self, request):
        d = {}

        author = api_serialize(self.author)
        d['author'] = author
        d['created'] = datetostr(self.created)
        d['modified'] = datetostr(self.modified)

        if request:
            d['is_author'] = self.is_author(request.user)
            d['allowed_edit'] = self.allowed_edit(request.user)

        return d
    def _api_serialize(self, request):
        d = {}

        author = api_serialize(self.author)
        d['author'] = author
        d['created'] = datetostr(self.created)
        d['modified'] = datetostr(self.modified)

        if request:
            d['is_author'] = self.is_author(request.user)
            d['allowed_edit'] = self.allowed_edit(request.user)

        return d
    def _api_serialize(self, request=None):
        d = {}
        if self.display_name:
            d['display_name'] = self.display_name

        d['created'] = datetostr(self.created)

        return d
    def _api_serialize(self, request=None):
        d = {}
        if self.display_name:
            d['display_name'] = self.display_name

        d['created'] = datetostr(self.created)

        return d
Example #10
0
    def api_serialize(self, request):
        d = {'joined' : datetostr(self.date_joined)}
        profile = None
        try:
            profile = self.get_profile()
        except ObjectDoesNotExist:
            pass

        if ( profile ):
            d['profile'] = profile.api_serialize(request)

        return d
Example #11
0
    def api_serialize(self, request):
        d = {'joined': datetostr(self.date_joined)}
        profile = None
        try:
            profile = self.get_profile()
        except ObjectDoesNotExist:
            pass

        if (profile):
            d['profile'] = profile.api_serialize(request)

        return d
Example #12
0
    def api_serialize(self, request):
        d = {}
        d['language'] = self.language

        if self.caption:
            d['caption'] = self.caption

        if self.capture_time:
            d['capture_time'] = datetostr(self.capture_time)

        if self.cast:
            d['cast'] = self.cast.get_api_uri()

        return d
Example #13
0
    def api_serialize(self, request):
        d = {}
        d['language'] = self.language

        if self.caption:
            d['caption'] = self.caption

        if self.capture_time:
            d['capture_time'] = datetostr(self.capture_time)

        if self.cast:
            d['cast'] = self.cast.get_api_uri()

        return d 
Example #14
0
    def api_serialize(self, request):
        d = {}

        d['collections'] = []
        for i in self.collection_set.all():
            d['collections'].append(i.get_api_uri())

        if self.datetime:
            d['datetime'] = datetostr(self.datetime)

        d['media'] = reverse('cast_media_api', kwargs={'cast_id':self.id})
        d['comments'] = reverse('cast_comments_api', kwargs={'cast_id':self.id})

        if self.preview_image:
            d['preview_image'] = self.preview_image

        return d
Example #15
0
    def geojson_properties(self, request):
        d = {}
        d['id'] = self.id
        d['title'] = self.title
        d['author'] = {'id' : self.author.id, 'display_name' : self.author.display_name }

        if self.datetime:
            d['datetime'] = datetostr(self.datetime)
        
        if self.preview_image:
            d['preview_image'] = self.preview_image

        if self.thumbnail:
            d['thumbnail'] = self.thumbnail.url

        d['favorites'] = self.favorited_by.count()

        return d
Example #16
0
    def api_serialize(self, request):
        d = {}

        d['collections'] = []
        for i in self.collection_set.all():
            d['collections'].append(i.get_api_uri())

        if self.datetime:
            d['datetime'] = datetostr(self.datetime)

        d['media'] = reverse('cast_media_api', kwargs={'cast_id': self.id})
        d['comments'] = reverse('cast_comments_api',
                                kwargs={'cast_id': self.id})

        if self.preview_image:
            d['preview_image'] = self.preview_image

        return d
Example #17
0
    def geojson_properties(self, request):
        d = {}
        d['id'] = self.id
        d['title'] = self.title
        d['author'] = {
            'id': self.author.id,
            'display_name': self.author.display_name
        }

        if self.datetime:
            d['datetime'] = datetostr(self.datetime)

        if self.preview_image:
            d['preview_image'] = self.preview_image

        if self.thumbnail:
            d['thumbnail'] = self.thumbnail.url

        d['favorites'] = self.favorited_by.count()

        return d
Example #18
0
    def api_serialize(self, request):
        d = {}
        resc = {}
        if self.cover_photo:
            resc['cover_photo'] = LocastContent.serialize_resource(self.cover_photo.url)
        if self.thumbnail:
            resc['thumbnail'] = LocastContent.serialize_resource(self.thumbnail.url)
        if self.animated_render:
            resc['animated_render'] = LocastContent.serialize_resource(self.animated_render.url)
        if self.video_render:
            resc['video_render'] = LocastContent.serialize_resource(self.video_render.url)

        if self.photoset_update_time:
            d['updated'] = datetostr(self.photoset_update_time)

        d['resources'] = resc
        d['frame_delay'] = self.frame_delay
        d['facebook_likes'] = self.facebook_likes
        d['photos'] = reverse('postcard_photo_api', kwargs={'postcard_id':self.id})
        d['authors'] = map(lambda a: a.username,  self.authors)

        return d
Example #19
0
    def api_serialize(self, request):
        d = {}
        d['start_date'] = datetostr(self.start_date)
        d['end_date'] = datetostr(self.end_date)

        return d
Example #20
0
    def api_serialize(self, request):
        d = {}
        d['start_date'] = datetostr(self.start_date)
        d['end_date'] = datetostr(self.end_date)

        return d