Skip to content

Commit 79657b6

Browse files
Restore old doc record just in case.
1 parent 29bfa1e commit 79657b6

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
The function ``create_virtual_module`` of the ``dj.schema`` class provides access to virtual modules.
2+
It creates a python module with the given name from the name of a schema on the server, automatically adds classes to it corresponding to the tables in the schema.
3+
4+
The function can take several parameters:
5+
6+
``module_name``: displayed module name.
7+
8+
``schema_name``: name of the database in MySQL.
9+
10+
``create_schema``: if ``True``, create the schema on the database server if it does not already exist; if ``False`` (default), raise an error when the schema is not found.
11+
12+
``create_tables``: if ``True``, ``module.schema`` can be used as the decorator for declaring new classes; if ``False``, such use will raise an error stating that the module is intend only to work with existing tables.
13+
14+
The function returns the Python module containing classes from the schema object with all the table classes already declared inside it.
File renamed without changes.

0 commit comments

Comments
 (0)