Skip to content

Commit a8374cf

Browse files
corrected the PR
1 parent 0339aec commit a8374cf

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

backend/family_tree/student/schema.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,20 @@ class Meta:
1010

1111
class Query(graphene.ObjectType):
1212
students=graphene.List(StudentType)
13+
path= graphene.List(StudentType, year=graphene.Decimal())
14+
batch= graphene.List(StudentType, temp=graphene.String(), currentYear=graphene.Decimal())
15+
def dumyFunc(year):
16+
path=[]
17+
for i in range(1,year-2011):
18+
path.append(i)
19+
return path
20+
def resolveBatch(currentYear,temp):
21+
batch=[]
22+
while(Student.objects.filter(roll_no=temp)[0].year== currentYear):
23+
batch.append(dumyFunc(currentYear))
24+
temp= Student.objects.filter(roll_no=temp)[0]+1
25+
return batch
1326

1427
schema=graphene.Schema(query=Query)
1528

16-
def dumyFunc(year):
17-
path=[]
18-
for i in range(1,year-2011):
19-
path.append(i)
20-
return path
21-
def resolveBatch(currentYear,temp):
22-
batch=[]
23-
while(Student.objects.filter(roll_no=temp)[0].year== currentYear):
24-
batch.append(dumyFunc(currentYear))
25-
temp= Student.objects.filter(roll_no=temp)[0]+1
26-
return batch
29+

0 commit comments

Comments
 (0)