Skip to content
Snippets Groups Projects
Commit 6710e860 authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

MAINT: removed obsolete last id attribute and function

parent 86e2f1ef
No related branches found
No related tags found
2 merge requests!57RELEASE 0.7.3,!52F refactor high level api
Pipeline #19997 canceled
......@@ -111,8 +111,6 @@ class CaosDBPythonUnresolvedReference(CaosDBPythonUnresolved):
class CaosDBPythonEntity(object):
_last_id = 0
def __init__(self):
"""
Initialize a new CaosDBPythonEntity for the high level python api.
......@@ -146,6 +144,10 @@ class CaosDBPythonEntity(object):
# which must not be changed by the set_property function.
self._forbidden = dir(self) + ["_forbidden"]
def use_parameter(self, name, value):
self.__setattr__(name, value)
return value
@property
def id(self):
"""
......@@ -224,17 +226,6 @@ class CaosDBPythonEntity(object):
def version(self, val: str):
self._version = val
# @staticmethod
# def _get_new_id():
# """
# Get a new negative ID for a CaosDB Entity.
# The first ID is -1 and decremented with each call of this function.
# """
# CaosDBPythonEntity._last_id -= 1
# return CaosDBPythonEntity._last_id
def _set_property_from_entity(self, ent: db.Entity, importance: str,
references: Optional[db.Container]):
"""
......@@ -709,6 +700,8 @@ def _single_convert_to_python_object(robj: CaosDBPythonEntity,
for base_attribute in BASE_ATTRIBUTES:
val = entity.__getattribute__(base_attribute)
if val is not None:
if isinstance(val, db.common.models.Version):
val = val.id
robj.__setattr__(base_attribute, val)
for prop in entity.properties:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment