server/posts: add relationCount field

This commit is contained in:
rr-
2016-07-03 14:27:36 +02:00
parent c21494be25
commit c472229bae
3 changed files with 4 additions and 0 deletions

View File

@ -109,6 +109,7 @@ def serialize_post(post, authenticated_user, options=None):
'favoriteCount': lambda: post.favorite_count,
'commentCount': lambda: post.comment_count,
'noteCount': lambda: post.note_count,
'relationCount': lambda: post.relation_count,
'featureCount': lambda: post.feature_count,
'lastFeatureTime': lambda: post.last_feature_time,
'favoritedBy': lambda: [

View File

@ -154,6 +154,7 @@ def test_serialize_post(
'commentCount': 2,
'noteCount': 0,
'featureCount': 1,
'relationCount': 0,
'lastFeatureTime': datetime.datetime(1999, 1, 1),
'favoritedBy': ['fav1'],
'hasCustomThumbnail': True,