Skip to content

Query template needs documentation how to prepare database

Created by: Quazgar

If one uses an older (or empty?) database, editing/creating query templates fails, probably because some Entities are missing. See attached screenshot.

I am missing at least a documentation about how to enable the query template editing, for example by adding the required Entities.

Could it be that these lines from misc/query_shortcuts_test_data.py are sufficient already?

datamodel = caosdb.Container()
datamodel.extend([
    caosdb.Property("Query", datatype=caosdb.TEXT),
    caosdb.Property("templateDescription", datatype=caosdb.TEXT),
    caosdb.RecordType(
        "UserTemplate"
        ).add_property("Query", importance=caosdb.OBLIGATORY
        ).add_property("templateDescription", importance=caosdb.OBLIGATORY),
])
datamodel.insert()

Imported comments:

By Florian Spreckelsen on 2021-01-26T12:11:59.785Z

mentioned in issue #150

By Florian Spreckelsen on 2021-01-26T12:07:16.151Z

mentioned in issue #149

By Quazgar on 2020-07-07T08:11:31.374Z

The error on the Webui looks like this: Screenshot_2020-07-06_LinkAhead_1_

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information