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 into everything where we are.

We move around the everything by creating new instances of Meta that refers to a new part: using the methods on the meta 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 and path

__lt__(other)

Work out if the str(everything) < str(other.everything) and path < other.path.

__gt__(other)

Work out if we are not equal or less than other