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)
|
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
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def referral_count(self):
|
def referral_count(self):
|
||||||
|
@ -658,14 +669,3 @@ class ViewerRelationship(Base):
|
||||||
else:
|
else:
|
||||||
years = int(months / 12)
|
years = int(months / 12)
|
||||||
return f"{years}yr ago"
|
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)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue