|
Uranium
Application Framework
|
Public Member Functions | |
| __init__ (self, SQLQueryFactory queries) | |
| None | setupTable (self, Cursor cursor) |
| None | insert (self, metadata_type metadata) |
| None | update (self, metadata_type metadata) |
| None | delete (self, str container_id) |
| Generator | keys (self) |
| Generator | values (self, str container_id) |
| Generator | items (self, str container_id) |
| metadata_type | getMetadata (self, str container_id) |
| metadata_type | groomMetadata (self, metadata_type metadata) |
Public Attributes | |
| cursor | |
Protected Member Functions | |
| Cursor | _execute (self, *args) |
Protected Attributes | |
| _queries | |
This is an interface for storing and retrieving container metadata from a database. Since each type of container has it's own metadata (and thus should probably insert / get / update it differently) it's likely that each type needs it's own controller.
| None UM.Settings.DatabaseContainerMetadataController.DatabaseMetadataContainerController.delete | ( | self, | |
| str | container_id | ||
| ) |
Removes a container from the DB.
| metadata_type UM.Settings.DatabaseContainerMetadataController.DatabaseMetadataContainerController.getMetadata | ( | self, | |
| str | container_id | ||
| ) |
Return the metadata needed to create a container param container_id: The container_id to query :return The container metadata
| metadata_type UM.Settings.DatabaseContainerMetadataController.DatabaseMetadataContainerController.groomMetadata | ( | self, | |
| metadata_type | metadata | ||
| ) |
Ensures that the metadata is in the order of the field keys and has the right size. if the metadata doesn't contains a key which is stored in the DB it will add it as an empty string. Key, value pairs that are not stored in the DB are dropped. :param metadata: The container metadata
| None UM.Settings.DatabaseContainerMetadataController.DatabaseMetadataContainerController.insert | ( | self, | |
| metadata_type | metadata | ||
| ) |
Insert a container in the DB. param container_id: The container_id to insert
| Generator UM.Settings.DatabaseContainerMetadataController.DatabaseMetadataContainerController.items | ( | self, | |
| str | container_id | ||
| ) |
Yields all values and keys obtained from the DB row including the `container_type` and `type` param container_id: The container_id to query
| Generator UM.Settings.DatabaseContainerMetadataController.DatabaseMetadataContainerController.keys | ( | self | ) |
Yields all the metadata keys. These consist of the DB fields and `container_type` and `type`
| None UM.Settings.DatabaseContainerMetadataController.DatabaseMetadataContainerController.setupTable | ( | self, | |
| Cursor | cursor | ||
| ) |
Creates the table in the DB. param cursor: the DB cursor
| None UM.Settings.DatabaseContainerMetadataController.DatabaseMetadataContainerController.update | ( | self, | |
| metadata_type | metadata | ||
| ) |
Updates a container in the DB. param container_id: The container_id to update
| Generator UM.Settings.DatabaseContainerMetadataController.DatabaseMetadataContainerController.values | ( | self, | |
| str | container_id | ||
| ) |
Yields all value obtained from the DB row and the 'container_type' and `type` param container_id: The container_id to query