fields.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:django-jsonattrs 作者: Cadasta 项目源码 文件源码
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.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号