Beispiel #1
0
 def __json__(self):
     user = api_user.UserAPI()
     return dict(
         id=self.id,
         user=user.get_one_by_id(self.user_id),
         created_time=self.created_time.strftime("%Y-%m-%d %H:%M:%S"),
         updated_time=self.updated_time.strftime("%Y-%m-%d %H:%M:%S"))
Beispiel #2
0
 def __json__(self):
     user = api_user.UserAPI()
     topic = api_topic.TopicAPI()
     return dict(
         id=self.id,
         user=user.get_one_by_id(self.user_id),
         topic=topic.get_one_by_id(self.topic_id),
         content=self.content,
         created_time=self.created_time.strftime("%Y-%m-%d %H:%M:%S"),
         updated_time=self.updated_time.strftime("%Y-%m-%d %H:%M:%S")
     )
Beispiel #3
0
    def __json__(self):

        user = api_user.UserAPI()
        category = api_category.CategoryAPI()
        return dict(
            id=self.id,
            title=self.title,
            author=user.get_one_by_id(self.author_id),
            content=self.content,
            category=category.get_one_by_id(self.category_id),
            agree=self.agree,
            disagree=self.disagree,
            created_time=self.created_time.strftime("%Y-%m-%d %H:%M:%S"),
            updated_time=self.updated_time.strftime("%Y-%m-%d %H:%M:%S"))
Beispiel #4
0
 def __init__(self):
     self.user = api_user.UserAPI()
Beispiel #5
0
 def __init__(self):
     self.token = api_token.TokenAPI()
     self.user = api_user.UserAPI()