Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CaosDB Crawler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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 Crawler
Commits
e759bc85
Commit
e759bc85
authored
7 months ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Patches
Plain Diff
DOC: Add callback example
parent
a4218614
No related branches found
No related tags found
2 merge requests
!178
FIX: #96 Better error output for crawl.py script.
,
!163
F dict heuristic
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/doc/converters.rst
+16
-6
16 additions, 6 deletions
src/doc/converters.rst
with
16 additions
and
6 deletions
src/doc/converters.rst
+
16
−
6
View file @
e759bc85
...
...
@@ -362,12 +362,22 @@ exactly a Record as an argument and needs to return that Record after
doing whatever custom treatment is needed. Additionally, it is given
the ``RecordStore`` and the ``ValueStore`` in order to be able to
access the records and values that have already been defined from
within ``referenced_record_callback``. It is applied to all Records
that are created from the dictionary and it can be used to, e.g.,
transform values of some properties, or add special treatment to all
Records of a specific type. ``referenced_record_callback`` is applied
**after** the properties from the dictionary have been applied as
explained above.
within ``referenced_record_callback``. Such a function might look the
following:
.. code-block:: python
def my_callback(rec: db.Record, records: RecordStore, values: GeneralStore):
# do something with rec, possibly using other records or values from the stores...
rec.description = "This was updated in a callback"
return rec
It is applied to all Records that are created from the dictionary and
it can be used to, e.g., transform values of some properties, or add
special treatment to all Records of a specific
type. ``referenced_record_callback`` is applied **after** the
properties from the dictionary have been applied as explained above.
Further converters
++++++++++++++++++
...
...
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