A :class:`~mongoengine.ListField` designed specially to hold a list of embedded documents to provide additional query helpers. .. note:: The only valid list values are subclasses of :class:`~mongoengine.EmbeddedDocument`.
| 969 | |
| 970 | |
| 971 | class EmbeddedDocumentListField(ListField): |
| 972 | """A :class:`~mongoengine.ListField` designed specially to hold a list of |
| 973 | embedded documents to provide additional query helpers. |
| 974 | |
| 975 | .. note:: |
| 976 | The only valid list values are subclasses of |
| 977 | :class:`~mongoengine.EmbeddedDocument`. |
| 978 | """ |
| 979 | |
| 980 | def __init__(self, document_type, **kwargs): |
| 981 | """ |
| 982 | :param document_type: The type of |
| 983 | :class:`~mongoengine.EmbeddedDocument` the list will hold. |
| 984 | :param kwargs: Keyword arguments passed into the parent :class:`~mongoengine.ListField` |
| 985 | """ |
| 986 | super().__init__(field=EmbeddedDocumentField(document_type), **kwargs) |
| 987 | |
| 988 | |
| 989 | class SortedListField(ListField): |