Fixed FileField comparision

Refs hmarr/mongoengine#547
This commit is contained in:
Ross Lawley
2012-08-01 13:28:28 +01:00
parent 48f988acd7
commit 8df81571fc
3 changed files with 73 additions and 59 deletions

View File

@@ -907,6 +907,8 @@ class GridFSProxy(object):
return '<%s: %s>' % (self.__class__.__name__, self.grid_id)
def __cmp__(self, other):
if not isinstance(other, GridFSProxy):
return -1
return cmp((self.grid_id, self.collection_name, self.db_alias),
(other.grid_id, other.collection_name, other.db_alias))