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

ENH: new data classes for storing parent and property data

parent 3fcbc645
No related branches found
No related tags found
2 merge requests!57RELEASE 0.7.3,!52F refactor high level api
......@@ -38,6 +38,39 @@ from .apiutils import get_type_of_entity_with
from typing import Any, Optional
from dataclasses import dataclass
@dataclass
class CaosDBPropertyMetaData:
# name is already the name of the attribute
unit: Optional[str] = None
datatype: Optional[str] = None
file: Optional[str] = None
path: Optional[str] = None
description: Optional[str] = None
id: Optional[int] = None
importance: Optional[str] = None
@dataclass
class CaosDBPythonUnresolvedParent:
"""
Parents can be either given by name or by ID.
When resolved, both fields should be set.
"""
id: Optional[int] = None
name: Optional[str] = None
@dataclass
class CaosDBPythonUnresolvedReference:
def __init__(self, id=None):
self.id = id
class CaosDBPythonEntity(object):
_last_id = 0
......@@ -323,22 +356,6 @@ class CaosDBPythonProperty(CaosDBPythonEntity):
pass
class CaosDBPythonParent(object):
"""
Parents can be either given by name or by ID.
When resolved, both fields should be set.
"""
def __init__(self, id=None, name=None):
self.id = id
self.name = name
class CaosDBPythonUnresolvedReference(object):
def __init__(self, id=None):
self.id = id
class CaosDBPythonFile(CaosDBPythonEntity):
......
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