Skip to content

Commit

Permalink
better unicode printing of form attachments for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
snopoke committed Sep 13, 2016
1 parent 9b5e7bc commit d46dfa6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions corehq/form_processor/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,19 @@ class XFormAttachmentSQL(AbstractAttachment, IsImageMixin):
related_name=AttachmentMixin.ATTACHMENTS_RELATED_NAME, related_query_name="attachment"
)

def __unicode__(self):
return unicode(
"XFormAttachmentSQL("
"attachment_id='{a.attachment_id}', "
"form_id='{a.form_id}', "
"name='{a.name}', "
"content_type='{a.content_type}', "
"content_length='{a.content_length}', "
"md5='{a.md5}', "
"blob_id='{a.blob_id}', "
"properties='{a.properties}', "
).format(a=self)

class Meta:
db_table = XFormAttachmentSQL_DB_TABLE
app_label = "form_processor"
Expand Down

0 comments on commit d46dfa6

Please sign in to comment.