schema.py 文件源码

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

项目:py-jsonapi 作者: benediktschmitt 项目源码 文件源码
def is_to_many_relationship(field):
    """
    Returns True, if the *field* describes a *to many* relationship.

    The field types are:

    *   :class:`mongoengine.ListField`
    *   :class:`mongoengine.SortedListField`

    with a simple reference field as element.
    """
    if isinstance(field, mongoengine.ListField) \
        and is_to_one_relationship(field.field):
        return True

    if isinstance(field, mongoengine.SortedListField)\
        and is_to_one_relationship(field.field):
        return True
    return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号