upgrade doc in AbstractGet class

master/v0.1.0
TBS093A 2020-08-29 15:35:10 +02:00
parent fbafc3de84
commit 5641420acd
1 changed files with 13 additions and 1 deletions

View File

@ -2,7 +2,7 @@ from django.db import models
class AbstractUtilsCRUD():
"""
This class have a primary utils for CRUD functionality
This class have a primary utilities for CRUD functionality
"""
@classmethod
@ -32,11 +32,17 @@ class AbstractUtilsCRUD():
class AbstractGet(AbstractUtilsCRUD):
"""
This class have a abstract getOne / getAll / getByParent
"""
parent_id_field = ''
@classmethod
def getObject(self, objectID):
"""
get one object
"""
return self.__getObjectNormal(self, objectID)
def __getObjectNormal(self, objectID):
@ -45,11 +51,17 @@ class AbstractGet(AbstractUtilsCRUD):
@classmethod
def getAllObjects(self):
"""
get all objects
"""
objectsAll = self.allObjectsDict()
return HttpResponse(json.dumps(objectsAll))
@classmethod
def getObjectsByParentID(self, parentID):
"""
get objects by parent id
"""
return HttpResponse(self.__getAllByParentID(parentID))
def __getAllByParentID(self, parentID):