Skip to content

Commit

Permalink
status: add attribute to check latecount in statusUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
ananthanandanan committed Feb 3, 2021
1 parent bf5d6e2 commit b38b858
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions status/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from django.contrib.auth.models import User
from framework.api.user import UserBasicObj
from members.models import Group
from status.models import DailyLog

class MessageObj(graphene.ObjectType):
message = graphene.String()
Expand Down Expand Up @@ -76,9 +77,13 @@ def resolve_membersSentCount(self, info):
class userStatusStatObj(graphene.ObjectType):
user = graphene.Field(UserBasicObj)
statusCount = graphene.String()
lateCount= graphene.Int()

def resolve_user(self, info):
return User.objects.values().get(id=self['member'])

def resolve_lateCount(self, info):
return DailyLog.objects.filter(late=self['member'] ).count()


class clubStatusObj(graphene.ObjectType):
Expand Down

0 comments on commit b38b858

Please sign in to comment.