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
评论列表
文章目录