Base Python Module

Pacifica Metadata ORM Base Class.

This class implements the basic functionality needed for all metadata objects in the metadata model for Pacifica.

PacificaModel.

Base class inherits from the PeeWee ORM Model class to create required fields by all objects and serialization methods for the base fields.

There are also CherryPy methods for creating, updating, getting and deleting these objects in from a web service layer.

class pacifica.metadata.orm.base.PacificaModel(*args, **kwargs)

Basic fields for an object within the model.

Attributes:
Name Description
created When was the object created
updated When was the object last changed
deleted When was the object deleted
DoesNotExist

alias of PacificaModelDoesNotExist

static _bool_translate(thing)

Translate the thing into a boolean.

classmethod _where_attr_clause(where_clause, kwargs, keys)

Grab keys and operators out of kwargs and return where clause.

classmethod available_hash_list()

Generate a hashable structure of all keys and values of keys.

This structure allows for easy evaluation of updates or current vs old data for any object in the database.

classmethod cls_foreignkey_rel_mods()

Return a collection of related models for a given foreignkey.

classmethod cls_foreignkeys()

Provide the foreign keys of the class as a list of attrs.

classmethod cls_revforeignkeys()

Provide the rev foreign keys of the class as a list of attrs.

from_hash(obj)

Convert the hash objects into object fields if they are present.

static get_append_item(obj_ref, fk_item_name, fk_obj_list)

Generate the proper item to append to the newly built object.

classmethod get_object_info(where_clause=None)

Get model and field information about the model class.

classmethod get_primary_keys()

Return the primary keys for the object.

classmethod last_change_date()

Find the last changed date for the object.

to_hash(**flags)

Convert the base object fields into serializable attributes in a hash.

classmethod where_clause(kwargs)

PeeWee specific extension meant to be passed to a PeeWee get or select.

pacifica.metadata.orm.base.db_connection_decorator(func)

Wrap a method with a database connect and close.