user_tables.py
Hosts the table tiers, user tables should be derived from.
TableMeta
¶
Bases: type
TableMeta subclasses allow applying some instance methods and properties directly at class level. For example, this allows Table.fetch() instead of Table().fetch().
Source code in datajoint/user_tables.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
UserTable
¶
Bases: Table
A subclass of UserTable is a dedicated class interfacing a base table. UserTable is initialized by the decorator generated by schema().
Source code in datajoint/user_tables.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
|
definition
property
¶
Returns:
Type | Description |
---|---|
a string containing the table definition using the DataJoint DDL. |
table_name()
¶
Returns:
Type | Description |
---|---|
the table name of the table formatted for mysql. |
Source code in datajoint/user_tables.py
113 114 115 116 117 118 119 120 |
|
Manual
¶
Bases: UserTable
Inherit from this class if the table's values are entered manually.
Source code in datajoint/user_tables.py
134 135 136 137 138 139 140 |
|
Lookup
¶
Bases: UserTable
Inherit from this class if the table's values are for lookup. This is currently equivalent to defining the table as Manual and serves semantic purposes only.
Source code in datajoint/user_tables.py
143 144 145 146 147 148 149 150 151 152 153 |
|
Imported
¶
Bases: UserTable
, AutoPopulate
Inherit from this class if the table's values are imported from external data sources.
The inherited class must at least provide the function _make_tuples
.
Source code in datajoint/user_tables.py
156 157 158 159 160 161 162 163 |
|
Computed
¶
Bases: UserTable
, AutoPopulate
Inherit from this class if the table's values are computed from other tables in the schema.
The inherited class must at least provide the function _make_tuples
.
Source code in datajoint/user_tables.py
166 167 168 169 170 171 172 173 |
|
Part
¶
Bases: UserTable
Inherit from this class if the table's values are details of an entry in another table and if this table is populated by the other table. For example, the entries inheriting from dj.Part could be single entries of a matrix, while the parent table refers to the entire matrix. Part tables are implemented as classes inside classes.
Source code in datajoint/user_tables.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
|
delete(force=False)
¶
unless force is True, prohibits direct deletes from parts.
Source code in datajoint/user_tables.py
221 222 223 224 225 226 227 228 229 230 |
|
drop(force=False)
¶
unless force is True, prohibits direct deletes from parts.
Source code in datajoint/user_tables.py
232 233 234 235 236 237 238 239 240 241 |
|