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
def links_link(self, user): if user and user.id: return make_url_from_id(user.id, 'links_list')
def create_id_link(self, user): if user and user.id: return make_url_from_id(user.id, 'user')
def create_id_link(self, link): if link and link.id: return make_url_from_id(link.id, 'link')