Ejemplo n.º 1
0
 def jsonable(self):
     return {
         'id': unicode(self.id),
         'from_id': unicode(self.from_id),
         'to_id': unicode(self.to_id),
         'action': unicode(self.action),
         'created_at': unicode(format_date(self.created_at)),
         'deleted_at': unicode(format_date(self.deleted_at)),
         'deleted': unicode(self.deleted),
     }
Ejemplo n.º 2
0
 def jsonable(self):
     return {
         'id': unicode(self.id),
         'from_id': unicode(self.from_id),
         'to_id': unicode(self.to_id),
         'action': unicode(self.action),
         'created_at': unicode(format_date(self.created_at)),
         'deleted_at': unicode(format_date(self.deleted_at)),
         'deleted': unicode(self.deleted),
     }
Ejemplo n.º 3
0
    def to_dict(obj):
        assert isinstance(obj, Tutorial)

        return {
            'id': unicode(obj.id),
            'title': unicode(obj.name),
            'slug': unicode(obj.slug),
            'created_at': unicode(format_date(obj.created_at)),
            'generated_at': unicode(format_date(obj.generated_at)),
            'keywords': unicode(obj.keywords),
            'content': unicode(obj.content),
            'content_html': unicode(obj.content_html),
            'meta_description': unicode(obj.meta_description),
            'upvote_count': obj.upvote_count or 0,
            'spam': obj.spam
        }
Ejemplo n.º 4
0
    def to_dict(obj):
        assert isinstance(obj, Tutorial)

        return {
            'id': unicode(obj.id),
            'title': unicode(obj.name),
            'slug': unicode(obj.slug),
            'created_at': unicode(format_date(obj.created_at)),
            'generated_at': unicode(format_date(obj.generated_at)),
            'keywords': unicode(obj.keywords),
            'content': unicode(obj.content),
            'content_html': unicode(obj.content_html),
            'meta_description': unicode(obj.meta_description),
            'upvote_count': obj.upvote_count or 0,
            'spam': obj.spam
        }
Ejemplo n.º 5
0
 def jsonable(self):
     return {
         'id': unicode(self.id),
         'name': unicode(self.name),
         'slug': unicode(self.slug),
         'created_at': unicode(format_date(self.created_at)),
         'projects': unicode(self.projects),
         'follower_count': unicode(self.follower_count)
     }
Ejemplo n.º 6
0
 def jsonable(self):
     return {
         'id': unicode(self.id),
         'name': unicode(self.name),
         'slug': unicode(self.slug),
         'post_count': unicode(self.post_count),
         'disabled': unicode(self.disabled),
         'created_at': unicode(format_date(self.created_at)),
     }