.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
keyvalue.py
Go to the documentation of this file.
1
# SPDX-License-Identifier: AGPL-3.0-or-later
2
"""
3
Typification of the *keyvalue* results. Results of this type are rendered in
4
the :origin:`keyvalue.html <searx/templates/simple/result_templates/keyvalue.html>`
5
template.
6
7
----
8
9
.. autoclass:: KeyValue
10
:members:
11
:show-inheritance:
12
13
"""
14
# pylint: disable=too-few-public-methods
15
16
17
__all__ = [
"KeyValue"
]
18
19
import
typing
20
from
collections
import
OrderedDict
21
22
from
._base
import
MainResult
23
24
25
class
KeyValue
(
MainResult
, kw_only=
True
):
26
"""Simple table view which maps *key* names (first col) to *values*
27
(second col)."""
28
29
template: str =
"keyvalue.html"
30
31
kvmap: dict[str, typing.Any] | OrderedDict[str, typing.Any]
32
"""Dictionary with keys and values. To sort keys, use :py:obj:`OrderedDict`."""
33
34
caption: str =
""
35
"""Optional caption for this result."""
36
37
key_title: str =
""
38
"""Optional title for the *key column*."""
39
40
value_title: str =
""
41
"""Optional title for the *value column*."""
42
43
def
__hash__
(self) -> int:
44
"""The KeyValues objects are checked for object identity, even if all
45
fields of two results have the same values, they are different from each
46
other.
47
"""
48
return
id(self)
searx.result_types._base.MainResult
Definition
_base.py:346
searx.result_types.keyvalue.KeyValue
Definition
keyvalue.py:25
searx.result_types.keyvalue.KeyValue.__hash__
int __hash__(self)
Definition
keyvalue.py:43
searxng
searx
result_types
keyvalue.py
Generated on
for .oO SearXNG Developer Documentation Oo. by
1.14.0