|
20 | 20 |
|
21 | 21 | import logging
|
22 | 22 | import datetime
|
23 |
| -import base64 |
24 | 23 |
|
25 | 24 | from sqlalchemy import Column, Integer, Unicode, UnicodeText, DateTime, \
|
26 | 25 | Boolean, ForeignKey, UniqueConstraint, PrimaryKeyConstraint, \
|
@@ -727,6 +726,14 @@ def get_collection_items(self, ascending=False):
|
727 | 726 | return CollectionItem.query.filter_by(
|
728 | 727 | collection=self.id).order_by(order_col)
|
729 | 728 |
|
| 729 | + def __repr__(self): |
| 730 | + safe_title = self.title.encode('ascii', 'replace') |
| 731 | + return '<{classname} #{id}: {title} by {creator}>'.format( |
| 732 | + id=self.id, |
| 733 | + classname=self.__class__.__name__, |
| 734 | + creator=self.creator, |
| 735 | + title=safe_title) |
| 736 | + |
730 | 737 |
|
731 | 738 | class CollectionItem(Base, CollectionItemMixin):
|
732 | 739 | __tablename__ = "core__collection_items"
|
@@ -756,6 +763,13 @@ def dict_view(self):
|
756 | 763 | """A dict like view on this object"""
|
757 | 764 | return DictReadAttrProxy(self)
|
758 | 765 |
|
| 766 | + def __repr__(self): |
| 767 | + return '<{classname} #{id}: Entry {entry} in {collection}>'.format( |
| 768 | + id=self.id, |
| 769 | + classname=self.__class__.__name__, |
| 770 | + collection=self.collection, |
| 771 | + entry=self.media_entry) |
| 772 | + |
759 | 773 |
|
760 | 774 | class ProcessingMetaData(Base):
|
761 | 775 | __tablename__ = 'core__processing_metadata'
|
|
0 commit comments