Pretty-print GridFSProxy objects
This commit is contained in:
parent
b4777f7f4f
commit
a69db231cc
@ -1082,6 +1082,10 @@ class GridFSProxy(object):
|
|||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '<%s: %s>' % (self.__class__.__name__, self.grid_id)
|
return '<%s: %s>' % (self.__class__.__name__, self.grid_id)
|
||||||
|
|
||||||
|
def __unicode__(self):
|
||||||
|
name = getattr(self.get(), 'filename', self.grid_id) if self.get() else '(no file)'
|
||||||
|
return '<%s: %s>' % (self.__class__.__name__, name)
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
if isinstance(other, GridFSProxy):
|
if isinstance(other, GridFSProxy):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user