Pretty-print GridFSProxy objects
This commit is contained in:
		| @@ -1083,6 +1083,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): | ||||||
|             return ((self.grid_id == other.grid_id) and |             return ((self.grid_id == other.grid_id) and | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user