def schema_update_conflicts(instance):
if not hasattr(instance, '_attr_field'):
raise ValueError("instance doesn't have an attribute field")
conflicts = []
try:
instance._attr_field._pre_save_selector_check(strict=True)
except SchemaUpdateException as exc_info:
conflicts = exc_info.conflicts
return conflicts
# This is needed to provide JSON serialisation for date objects
# whenever they're saved to JSON attribute fields. This function is
# passed as the custom "dumps" method for psycopg2's Json class to
# use.
评论列表
文章目录