fddf
This commit is contained in:
parent
031754ff3a
commit
ab9eaec610
1 changed files with 12 additions and 12 deletions
|
@ -195,6 +195,17 @@ class User(Base, Stndrd, Age_times):
|
|||
|
||||
super().__init__(**kwargs)
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def user_awards(v):
|
||||
|
||||
return_value = list(AWARDS.values())
|
||||
|
||||
user_awards = v.awards
|
||||
for val in return_value: val['owned'] = user_awards.filter_by(kind=val['kind'], submission_id=None, comment_id=None).count()
|
||||
|
||||
return jsonify(return_value)
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def referral_count(self):
|
||||
|
@ -657,15 +668,4 @@ class ViewerRelationship(Base):
|
|||
return f"{months}mo ago"
|
||||
else:
|
||||
years = int(months / 12)
|
||||
return f"{years}yr ago"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def user_awards(v):
|
||||
|
||||
return_value = list(AWARDS.values())
|
||||
|
||||
user_awards = v.awards
|
||||
for val in return_value: val['owned'] = user_awards.filter_by(kind=val['kind'], submission_id=None, comment_id=None).count()
|
||||
|
||||
return jsonify(return_value)
|
||||
return f"{years}yr ago"
|
Loading…
Add table
Add a link
Reference in a new issue