Powered by Tachyonic Project Luxon Framework v0.0.0

Luxon Framework for rapid application development. (luxon)

Version

Model Utilities

Backup Tables

luxon.core.utils.models.backup_tables(conn)[source]

Makes a backup of a database

Retrieves the models in use and returns the corresponding tables and their entries from the database

Parameters:conn (connection object) – connection object for the database
Returns:Dictionary containing all tables in the database. Each entry is a list(rows) of sequences(elements in row) with the key being the table name

Drop Tables

luxon.core.utils.models.drop_tables(conn)[source]

Empties database

Deletes all the tables in a database that correspond to models in use

Parameters:conn (connection object) – the database to be deleted

Create Tables

luxon.core.utils.models.create_tables()[source]

Creates tables for all models in g.models

Restore Tables

luxon.core.utils.models.restore_tables(conn, backup)[source]

Restores database from backup

Parameters:
  • conn (connection object) – connection object of the database
  • backup (dict) – backup dictionary