Skip to content
Snippets Groups Projects
Commit b67cb9c1 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

FIX: missing file

parent 303e82cc
No related branches found
No related tags found
2 merge requests!91Release 0.3,!67MAINT: introduce an identifiable class
Pipeline #30445 failed
#!/usr/bin/env python3
# encoding: utf-8
#
# This file is a part of the CaosDB Project.
#
# Copyright (C) 2022 Henrik tom Wörden
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
from __future__ import annotations
class Identifiable():
"""
The fingerprint of a Record in CaosDB.
This class contains the information that is used by the CaosDB Crawler to identify Records .
For example, in order to check whether a Record exits in the CaosDB Server, a query is created
using the information contained in the Identifiable.
Parameters
----------
record_type: str, this RecordType has to be a parent of the identified object
name: str, the name of the identified object
properties: dict, keys are names of Properties; values are Property values
Note, that lists are not checked for equality but are interpreted as multiple
conditions for a single Property.
path: str, In case of files: The path where the file is stored.
backrefs: list, TODO future
"""
def __init__(self, record_type: str = None, name: str = None, properties: dict = None,
path: str = None, backrefs: list[int, str] = None):
self.record_type = record_type
self.name = name
self.properties: dict = {}
if properties is not None:
self.properties = properties
self.path = path
self.backrefs: list = []
if backrefs is not None:
self.backrefs = backrefs
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment