Pretty-print GridFSProxy objects
This commit is contained in:
parent
b4777f7f4f
commit
a69db231cc
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue