fix fucking excess of references -> AbstractGet
parent
e154e0e2ed
commit
1b1c7d50fa
|
|
@ -34,7 +34,7 @@ class AbstractUtilsCRUD():
|
||||||
class AbstractGet(AbstractUtilsCRUD):
|
class AbstractGet(AbstractUtilsCRUD):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def getObject(self, request, objectID, privilige): # request, privilige is unnecessary
|
def getObject(self, objectID):
|
||||||
return self.__getObjectNormal(self, objectID)
|
return self.__getObjectNormal(self, objectID)
|
||||||
|
|
||||||
def __getObjectNormal(self, objectID):
|
def __getObjectNormal(self, objectID):
|
||||||
|
|
@ -42,15 +42,13 @@ class AbstractGet(AbstractUtilsCRUD):
|
||||||
return HttpResponse(json.dumps(object))
|
return HttpResponse(json.dumps(object))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def getAllObjects(self, request, privilige):
|
def getAllObjects(self):
|
||||||
objectsAll = self.allObjectsDict()
|
objectsAll = self.allObjectsDict()
|
||||||
return HttpResponse(json.dumps(objectsAll))
|
return HttpResponse(json.dumps(objectsAll))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def getObjectsByParentID(self, request, parentID, privilige):
|
def getObjectsByParentID(self, request, parentID):
|
||||||
if self.modelHaveParent(self):
|
return HttpResponse(self.getAllByParentID(parentID))
|
||||||
return HttpResponse(self.getAllByParentID(parentID))
|
|
||||||
return HttpResponse("No Permission")
|
|
||||||
|
|
||||||
def __getAllByParentID(self, parentID):
|
def __getAllByParentID(self, parentID):
|
||||||
list = [ x.toDict() for x in self.objectFactory().__get.objects.filter(subject_id = parentID)]
|
list = [ x.toDict() for x in self.objectFactory().__get.objects.filter(subject_id = parentID)]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue