Utils Python Module

Utilities for common metadata tools.

class pacifica.metadata.orm.utils.ExtendDateField(formats=None, *args, **kwargs)[source]

Appends to the DateField to add isoformatted date.

isoformat()[source]

Return the isoformat date field.

class pacifica.metadata.orm.utils.ExtendDateTimeField(formats=None, *args, **kwargs)[source]

Appends to the DateTimeField to add isoformat from datetime object.

isoformat()[source]

Return the isoformat datetime field.

class pacifica.metadata.orm.utils.UUIDEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

UUID Encoder to JSON.

default(o)[source]

Encode tne UUID by returning it’s hex value.

pacifica.metadata.orm.utils.date_converts(date_obj)[source]

Standardize on converting to date objects.

pacifica.metadata.orm.utils.datetime_converts(time_obj)[source]

Standardize on converting to datetime objects.

pacifica.metadata.orm.utils.datetime_now_nomicrosecond()[source]

Return now with no microseconds.

pacifica.metadata.orm.utils.index_hash(*args)[source]

Generate a hash for all the arguments passed.

This is used to combine multiple unique IDs into a single string.