Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-pylib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-pylib
Commits
51f5b5bf
Commit
51f5b5bf
authored
3 years ago
by
Alexander Schlemmer
Browse files
Options
Downloads
Patches
Plain Diff
ENH: new data classes for storing parent and property data
parent
3fcbc645
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!57
RELEASE 0.7.3
,
!52
F refactor high level api
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caosdb/high_level_api.py
+33
-16
33 additions, 16 deletions
src/caosdb/high_level_api.py
with
33 additions
and
16 deletions
src/caosdb/high_level_api.py
+
33
−
16
View file @
51f5b5bf
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment