Added all() method to get all document instances from a document. Extended the FileField's tests with testing on empty filefield.
This commit is contained in:
parent
9411b38508
commit
2f991ac6f1
@ -239,6 +239,10 @@ class QuerySet(object):
|
|||||||
"""
|
"""
|
||||||
return self.__call__(*q_objs, **query)
|
return self.__call__(*q_objs, **query)
|
||||||
|
|
||||||
|
def all(self):
|
||||||
|
"""Returns all documents."""
|
||||||
|
return self.__call__()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _collection(self):
|
def _collection(self):
|
||||||
"""Property that returns the collection object. This allows us to
|
"""Property that returns the collection object. This allows us to
|
||||||
|
@ -675,6 +675,11 @@ class FieldTest(unittest.TestCase):
|
|||||||
StreamFile.drop_collection()
|
StreamFile.drop_collection()
|
||||||
SetFile.drop_collection()
|
SetFile.drop_collection()
|
||||||
|
|
||||||
|
# Make sure FileField is optional and not required
|
||||||
|
class DemoFile(Document):
|
||||||
|
file = FileField()
|
||||||
|
d = DemoFile.objects.create()
|
||||||
|
|
||||||
def test_geo_indexes(self):
|
def test_geo_indexes(self):
|
||||||
"""Ensure that indexes are created automatically for GeoPointFields.
|
"""Ensure that indexes are created automatically for GeoPointFields.
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user