示例#1
0
 def format_data(self, data):
     if data and data.get('owner'):
         data['owner'] = make_url_from_id(data['owner'], 'user')
     if data and data.get('created_at'):
         data['created_at'] = datetime.strptime(
             data['created_at'], '%Y-%m-%d %H:%M:%S'
         ).strftime('%d %b, %Y %H:%M:%S')
     return data
示例#2
0
 def links_link(self, user):
     if user and user.id:
         return make_url_from_id(user.id, 'links_list')
示例#3
0
 def create_id_link(self, user):
     if user and user.id:
         return make_url_from_id(user.id, 'user')
示例#4
0
 def create_id_link(self, link):
     if link and link.id:
         return make_url_from_id(link.id, 'link')