table.default_values property, closes #475

Refs #468
This commit is contained in:
Simon Willison 2022-08-27 15:41:10 -07:00
commit 36ffcafb1a
3 changed files with 57 additions and 0 deletions

View file

@ -1802,6 +1802,16 @@ The ``.columns_dict`` property returns a dictionary version of the columns with
>>> db["PlantType"].columns_dict
{'id': <class 'int'>, 'value': <class 'str'>}
.. _python_api_introspection_default_values:
.default_values
---------------
The ``.default_values`` property returns a dictionary of default values for each column that has a default::
>>> db["table_with_defaults"].default_values
{'score': 5}
.. _python_api_introspection_pks:
.pks