Skip to content

Add 'd.custom.*' convenience commands #101

@pyroscope

Description

@pyroscope
  • ✔️ Full docs for all commands
  • ✔️ d.custom.set_if_z is a companion to d.custom.if_z and sets an attribute only once, if it was missing or empty previously.
  • ✔️ d.custom.erase to remove a custom key.
  • ✔️ d.custom.toggle inverts the truthiness of a custom attribute using 0 and 1 (empty strings and 0 become 1, and other strings become 0). It also returns the current value that was set (as in the value type, i.e. as an integer)
  • ✔️ d.custom.as_value returns a custom attribute as a value (integer); missing keys and empty strings are 0, and other non-numbers raise an exception. Major use-cases of this are custom timestamp fields, and querying toggles.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions