Skip to content
Snippets Groups Projects
Commit ddd10f94 authored by florian's avatar florian
Browse files

FIX: Use new datatypes and values in creators

parent 0ee29105
No related branches found
No related tags found
1 merge request!13ENH: Use new value and datatype structs
......@@ -311,22 +311,20 @@ end
"""
function create_property_entity(;
name::AbstractString = "",
datatype::AbstractString = "",
datatype::Union{AbstractString,CaosDB.Constants.DATATYPE._DATATYPE} = "",
collection::Union{CaosDB.Constants.COLLECTION._COLLECTION,Nothing} = nothing,
unit::AbstractString = "",
is_reference::Bool = false,
is_list::Bool = false,
)
Return a new entity object with role Record. If `name`, `datatype`, or
`unit` were provided, its name, datatype (including whether it is a
reference or a list), or unit are set accordingly.
Return a new entity object with role Record. If `name`, `datatype`, or `unit`
were provided, its name, datatype (including whether its `collection` type), or
unit are set accordingly.
"""
function create_property_entity(;
name::AbstractString = "",
datatype::AbstractString = "",
datatype::Union{AbstractString,CaosDB.Constants.DATATYPE._DATATYPE} = "",
collection::Union{CaosDB.Constants.COLLECTION._COLLECTION,Nothing} = nothing,
unit::AbstractString = "",
is_reference::Bool = false,
is_list::Bool = false,
)
property = create_entity(name)
......@@ -334,7 +332,7 @@ function create_property_entity(;
set_role(property, CaosDB.Constants.ROLE.PROPERTY)
if datatype != ""
set_datatype(property, datatype, is_list = is_list, is_reference = is_reference)
set_datatype(property, datatype, collection)
end
if unit != ""
......@@ -349,16 +347,14 @@ end
name::AbstractString = "",
id::AbstractString = "",
value::Union{AbstractString, Number, Bool} = "",
datatype::AbstractString = "",
is_reference::Bool = false,
is_list::Bool = false,
datatype::Union{AbstractString,CaosDB.Constants.DATATYPE._DATATYPE} = "",
collection::Union{CaosDB.Constants.COLLECTION._COLLECTION, Nothing} = nothing,
)
Create a property object that can be appended to another `_Entity`. If
`name`, `id`, or `value` are given, the property's name, id, or value
are set accordingly. The datatype and whether it is a list or a
reference can be specified with `datatype`, `is_reference`, and
`is_list`, respectively.
Create a property object that can be appended to another `_Entity`. If `name`,
`id`, or `value` are given, the property's name, id, or value are set
accordingly. The datatype and its collection type can be specified with
`datatype` and `collection`, respectively.
!!! info
......@@ -369,9 +365,8 @@ function create_property(;
name::AbstractString = "",
id::AbstractString = "",
value::Union{AbstractString,Number,Bool} = "",
datatype::AbstractString = "",
is_reference::Bool = false,
is_list::Bool = false,
datatype::Union{AbstractString,CaosDB.Constants.DATATYPE._DATATYPE} = "",
collection::Union{CaosDB.Constants.COLLECTION._COLLECTION,Nothing} = nothing,
)
property = Ref{_Property}(_Property(true))
......@@ -393,7 +388,7 @@ function create_property(;
end
if datatype != ""
set_datatype(property, datatype, is_reference = is_reference, is_list = is_list)
set_datatype(property, datatype, collection)
end
if value != ""
......
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