Table Types¶
Manual, Lookup, Imported, Computed, Part
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.to_dicts() instead of Table().to_dicts().
UserTable ¶
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.
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.
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.
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.
delete ¶
delete(part_integrity='enforce', **kwargs)
Delete from a Part table.
Args:
part_integrity: Policy for master-part integrity. One of:
- "enforce" (default): Error - delete from master instead.
- "ignore": Allow direct deletion (breaks master-part integrity).
- "cascade": Delete parts AND cascade up to delete master.
**kwargs: Additional arguments passed to Table.delete()
(transaction, prompt)
Raises: DataJointError: If part_integrity="enforce" (direct Part deletes prohibited)
drop ¶
drop(part_integrity='enforce')
Drop a Part table.
Args:
part_integrity: Policy for master-part integrity. One of:
- "enforce" (default): Error - drop master instead.
- "ignore": Allow direct drop (breaks master-part structure).
Note: "cascade" is not supported for drop (too destructive).
Raises: DataJointError: If part_integrity="enforce" (direct Part drops prohibited)