Skip to content
Snippets Groups Projects

Overwrite parents

Merged
Henrik tom Wördenrequested to merge
f-parents into dev
All threads resolved!
1 file
+ 15
14
Compare changes
  • Side-by-side
  • Inline
+ 15
14
@@ -24,29 +24,29 @@
@@ -24,29 +24,29 @@
#
#
from __future__ import annotations
from __future__ import annotations
from jsonschema import validate, ValidationError
import os
import re
import datetime
import datetime
import caosdb as db
import json
import json
 
import logging
 
import os
 
import re
import warnings
import warnings
from .utils import has_parent
from .stores import GeneralStore, RecordStore
from .structure_elements import (StructureElement, Directory, File, DictElement, JSONFile,
IntegerElement, BooleanElement, FloatElement, NoneElement,
TextElement, TextElement, ListElement)
from typing import List, Optional, Tuple, Union
from abc import ABCMeta, abstractmethod
from abc import ABCMeta, abstractmethod
from string import Template
from string import Template
import yaml_header_tools
from typing import List, Optional, Tuple, Union
 
import caosdb as db
import pandas as pd
import pandas as pd
import logging
import yaml
import yaml
 
import yaml_header_tools
 
from jsonschema import ValidationError, validate
 
 
from .stores import GeneralStore, RecordStore
 
from .structure_elements import (BooleanElement, DictElement, Directory, File,
 
FloatElement, IntegerElement, JSONFile,
 
ListElement, NoneElement, StructureElement,
 
TextElement)
 
from .utils import has_parent
# These are special properties which are (currently) treated differently
# These are special properties which are (currently) treated differently
# by the converters:
# by the converters:
@@ -300,6 +300,7 @@ def create_records(values: GeneralStore, records: RecordStore, def_records: dict
@@ -300,6 +300,7 @@ def create_records(values: GeneralStore, records: RecordStore, def_records: dict
# no matter whether the record existed in the record store or not,
# no matter whether the record existed in the record store or not,
# parents will be added when they aren't present in the record yet:
# parents will be added when they aren't present in the record yet:
if "parents" in record:
if "parents" in record:
 
c_record.parents.clear()
for parent in record["parents"]:
for parent in record["parents"]:
# Do the variables replacement:
# Do the variables replacement:
var_replaced_parent = replace_variables(parent, values)
var_replaced_parent = replace_variables(parent, values)
Loading