ORM Python Module¶
ORM for index server.
-
class
pacifica.ingest.orm.
BaseModel
(*args, **kwargs)[source]¶ Auto-generated by pwiz.
-
DoesNotExist
¶ alias of
BaseModelDoesNotExist
-
_meta
= <peewee.Metadata object>¶
-
_schema
= <peewee.SchemaManager object>¶
-
id
= <AutoField: BaseModel.id>¶
-
-
class
pacifica.ingest.orm.
IngestState
(*args, **kwargs)[source]¶ Map a python record to a mysql table.
-
DoesNotExist
¶ alias of
IngestStateDoesNotExist
-
_meta
= <peewee.Metadata object>¶
-
_schema
= <peewee.SchemaManager object>¶
-
created
= <DateTimeField: IngestState.created>¶
-
classmethod
database_close
()[source]¶ Close the database connection.
Closing already closed database is not a problem, so continue on.
-
classmethod
database_connect
()[source]¶ Make sure database is connected.
Trying to connect a second time does cause problems.
-
exception
= <TextField: IngestState.exception>¶
-
job_id
= <BigIntegerField: IngestState.job_id>¶
-
state
= <CharField: IngestState.state>¶
-
task
= <CharField: IngestState.task>¶
-
task_percent
= <DecimalField: IngestState.task_percent>¶
-
updated
= <DateTimeField: IngestState.updated>¶
-
-
class
pacifica.ingest.orm.
IngestStateSystem
(*args, **kwargs)[source]¶ Ingest State Schema Version Model.
-
DoesNotExist
¶ alias of
IngestStateSystemDoesNotExist
-
_meta
= <peewee.Metadata object>¶
-
_schema
= <peewee.SchemaManager object>¶
-
part
= <CharField: IngestStateSystem.part>¶
-
value
= <IntegerField: IngestStateSystem.value>¶
-
-
class
pacifica.ingest.orm.
OrmSync
[source]¶ Special module for syncing the orm.
This module should incorporate a schema migration strategy.
The supported versions migrating forward must be in a versions array containing tuples for major and minor versions.
The version tuples are directly translated to method names in the orm_update class for the update between those versions.
Example Version Control:
class orm_update: versions = [ (0, 1), (0, 2), (1, 0), (1, 1) ] def update_0_1_to_0_2(): pass def update_0_2_to_1_0(): pass
The body of the update should follow peewee migration practices. http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#migrate
-
versions
= [(0, 0), (1, 0)]¶
-