Files
tryton/trytond/doc/ref/tools/misc.rst
T

70 lines
1.8 KiB
ReStructuredText
Raw Normal View History

2016-07-29 10:46:52 +02:00
.. _ref-tools:
.. module:: trytond.tools
Miscellaneous
=============
2024-01-05 19:57:49 +01:00
.. function:: entry_points()
Return a collection of entry points.
.. function:: import_module(name)
Import the named Tryton module.
.. function:: file_open(name[, mode[, subdir[, encoding]]])
Open the named file in subdir from the root directory.
.. function:: find_path(name[, subdir])
Return the path of the named file in subdir from root directory.
.. function:: find_dir(name[, subdir])
Return the path of the named directory in subdir from root directory.
2023-10-18 23:11:07 +02:00
.. function:: pairwise_longest(iterable)
Return successive overlapping pairs taken from the input iterable.
The number of 2-tuples in the output iterator will be the number of inputs
and ends with the ``None``.
It will be empty if the input iterable has fewer than two values.
.. function:: resolve(name)
2016-07-29 10:46:52 +02:00
2022-03-27 16:06:09 +02:00
Resolve a dotted name to a global object.
2020-10-08 21:34:15 +02:00
2022-12-31 00:05:40 +01:00
.. method:: safe_join(directory, \*pathnames)
Safely join zero or more untrusted path components to a base directory to
avoid escaping the base directory.
.. function:: unescape_wildcard(string[, wildcards[, escape]])
2021-03-21 16:21:05 +01:00
2022-03-27 16:06:09 +02:00
Return the string without the wild card escapes.
2021-03-21 16:21:05 +01:00
.. function:: is_full_text(value[, escape])
2021-03-21 16:21:05 +01:00
2022-03-27 16:06:09 +02:00
Determine if the value can be used as full text search.
This is the case when the value starts and ends with a ``%`` or does not
contain any wild cards.
2021-03-21 16:21:05 +01:00
2023-09-25 16:42:04 +02:00
.. function:: likify(string[, escape])
Convert the string for full text if it does not contain any wild cards.
.. function:: sql_pairing(x, y)
2020-10-08 21:34:15 +02:00
2022-03-27 16:06:09 +02:00
Return an SQL expression that pairs SQL integers x and y.
2020-12-25 17:14:57 +01:00
.. function:: firstline(text)
2020-12-25 17:14:57 +01:00
2022-03-27 16:06:09 +02:00
Return first non-empty line of a text field.
2021-09-13 23:43:03 +02:00
.. function:: remove_forbidden_chars(value)
2021-09-13 23:43:03 +02:00
2022-03-27 16:06:09 +02:00
Return a copy of the string with forbidden char from
2022-04-06 18:19:49 +02:00
:class:`~trytond.model.fields.Char` replaced by space.