class Root Resource resources centers Centers self request self item e

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
class Root(Resource):
resources = {'centers': Centers(self.request, self, item),
'examinations': Examinations(self.request, self, item),
'records': Records(self.request, self, item)
}
def __getitem__(self, item):
if item in resources.keys():
return resources[item]
else:
raise KeyError