diff options
author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2020-10-01 23:30:04 +0200 |
---|---|---|
committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2020-10-01 23:30:04 +0200 |
commit | ea9af6f5521c86a8529d75db91455e8982e1d77f (patch) | |
tree | cb21c405b0ca6d425a966660be5b02a0c3c97469 /docs/moving_data_between_collections.rst | |
parent | 5e045d665f5057d3111939c1fa13133e53d7fb8d (diff) | |
parent | e3e1aac99ff15ef99ac6d3fd8539492a2c4801be (diff) |
Merge branch 'master' into types
Diffstat (limited to 'docs/moving_data_between_collections.rst')
-rw-r--r-- | docs/moving_data_between_collections.rst | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/docs/moving_data_between_collections.rst b/docs/moving_data_between_collections.rst deleted file mode 100644 index 170b391..0000000 --- a/docs/moving_data_between_collections.rst +++ /dev/null @@ -1,40 +0,0 @@ -Moving Data between Collections -=============================== - -Entries can be exported from a lesana collection to another using the -``lesana export`` command and a jinja2 template. - -The template should generate a yaml file that is a valid lesana entry -for the destination collection and it can use the fields of the starting -collection as variables. The variable ``entry`` is also available and -gives complete access to the entry of the original collection, so fields -with names that aren't valid jinja templates can be accessed as -``entry.data[<field-name>]``. - -E.g. to convert between a collection with fields ``name``, -``short-desc``, ``desc`` to a collection with fields ``name``, -``description`` one could use the following template:: - - name: {{ name }} - description: | - {{ entry.data.[short-desc] }} - - {{ desc | indent(width=4, first=False) }} - -From the origin collection you can then run the command:: - - lesana export <path/to/destination/collection> <path/to/template> - -to export all entries. - -You can also export just a subset of entries by adding a xapian query -with the parameter ``--query``; you can test the search using:: - - lesana search --all <some search terms> - -and then actually run the export with:: - - lesana search --query '<some search terms>' <destination> <template> - -note that in this second command the spaces in the search query have to -be protected from the shell. |