File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
backend/family_tree/student Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -10,17 +10,20 @@ class Meta:
10
10
11
11
class Query (graphene .ObjectType ):
12
12
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
13
26
14
27
schema = graphene .Schema (query = Query )
15
28
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
+
You can’t perform that action at this time.
0 commit comments