diff --git a/generalApp/AbstractCRUD.py b/generalApp/AbstractCRUD.py index 5607dea..90459e8 100644 --- a/generalApp/AbstractCRUD.py +++ b/generalApp/AbstractCRUD.py @@ -84,7 +84,7 @@ class AbstractGet(AbstractUtilsCRUD): list = [ x.toDict() for x in self._objectFactory() - .__get.objects.filter(**{ parent_id_field: parentID }) + .objects.filter(**{ self._objectFactory().parent_id_field: parentID }) ] return json.dumps(list) @@ -123,8 +123,8 @@ class AbstractCreate(AbstractUtilsCRUD): """ save object without parent """ - newObject = self._objectFactory()() - newObject.fromDict(objectDict) + del objectDict['token'] + newObject = self._objectFactory().objects.create(**objectDict) newObject.save() return HttpResponse(f"Add new Object: {newObject.toDict()}") @@ -147,8 +147,8 @@ class AbstractCreate(AbstractUtilsCRUD): """ save object with parent & subject + comment & set trigger time """ - newObject = self._objectFactory()() - newObject.fromDict(objectDict) + del objectDict['token'] + newObject = self._objectFactory().objects.create(**objectDict) self.__setParentID(parentID) self._createFirstComment(newObject, objectDict) diff --git a/generalApp/__pycache__/AbstractCRUD.cpython-36.pyc b/generalApp/__pycache__/AbstractCRUD.cpython-36.pyc index 7b9c042..90811ea 100644 Binary files a/generalApp/__pycache__/AbstractCRUD.cpython-36.pyc and b/generalApp/__pycache__/AbstractCRUD.cpython-36.pyc differ