@@ -113,15 +113,18 @@ Student - StudentMajor
113
113
114
114
### Creating a virtual module
115
115
116
- Now ` spawn_missing_classes ` creates the new classes in the local namespace.
116
+ Virtual modules provide a way to access the classes corresponding to tables in a
117
+ DataJoint schema without having to create local files.
118
+
119
+ ` spawn_missing_classes ` creates the new classes in the local namespace.
117
120
However, it is often more convenient to import a schema with its Python module,
118
- equivalent to the Python command
121
+ equivalent to the Python command:
119
122
120
123
``` python
121
124
import university as uni
122
125
```
123
126
124
- We can mimick this import without having access to ` university.py ` using the
127
+ We can mimic this import without having access to ` university.py ` using the
125
128
` VirtualModule ` class object:
126
129
127
130
``` python
@@ -145,7 +148,13 @@ uni.Student - uni.StudentMajor
145
148
146
149
![ query object preview] ( ../images/StudentTable.png ) {: style="align: center "}
147
150
148
- ` dj.VirtualModule ` takes optional arguments.
151
+ ` dj.VirtualModule ` takes required arguments
152
+
153
+ - ` module_name ` : displayed module name.
154
+
155
+ - ` schema_name ` : name of the database in MySQL.
156
+
157
+ And ` dj.VirtualModule ` takes optional arguments.
149
158
150
159
First, ` create_schema=False ` assures that an error is raised when the schema
151
160
does not already exist. Set it to ` True ` if you want to create an empty schema.
0 commit comments