The Meta object
Meta
is an important object that is used to keep track of our position in
the original val
when we are normalising it.
Note that the Meta object can be imported directly from delfick_project.norms
- class delfick_project.norms.meta.Meta(everything, path)
Meta has a concept of the wider context, kept as the
everything
property, and the path intoeverything
where we are.We move around the
everything
by creating new instances ofMeta
that refers to a new part: using the methods on themeta
object.- classmethod empty()
Return a Meta with empty configuration and empty path
- __init__(everything, path)
- everything
The wider context
- path
Can be given as a string or a list of tuples.
If provided as a string, it is converted to
[(path, "")]
- at(val)
Return a new instance with
(path, "")
added to the path
- indexed_at(index)
Return a new instance with
("", "[index]")
added to the path
- key_names()
Return
{_key_name_<i>: <i'th part of path>}
for each part in the path reversed
- __eq__(other)
Work out if we have the same
everything
andpath
- __lt__(other)
Work out if the
str(everything) < str(other.everything)
andpath < other.path
.
- __gt__(other)
Work out if we are not equal or less than other
- property path
Return the path as a string
- property nonspecial_path
Return the path as a string without extra strings
- property source
Return the source path of this value by asking everything for the source of this path