attribute_adapter.py
AttributeAdapter
¶
Base class for adapter objects for user-defined attribute types.
Source code in datajoint/attribute_adapter.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
attribute_type
property
¶
Returns:
Type | Description |
---|---|
a supported DataJoint attribute type to use; e.g. "longblob", "blob@store" |
get(value)
¶
convert value retrieved from the the attribute in a table into the adapted type
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
value from the database |
required |
Returns:
Type | Description |
---|---|
object of the adapted type |
Source code in datajoint/attribute_adapter.py
18 19 20 21 22 23 24 25 26 |
|
put(obj)
¶
convert an object of the adapted type into a value that DataJoint can store in a table attribute
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj |
an object of the adapted type |
required |
Returns:
Type | Description |
---|---|
value to store in the database |
Source code in datajoint/attribute_adapter.py
28 29 30 31 32 33 34 35 |
|
get_adapter(context, adapter_name)
¶
Extract the AttributeAdapter object by its name from the context and validate.
Source code in datajoint/attribute_adapter.py
38 39 40 41 42 43 44 45 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 |
|