Skip to content

Commit

Permalink
Update string representations of Upload and Chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
paltman committed May 9, 2012
1 parent b9e66f0 commit 51663a4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions chunked_uploads/models.py
Expand Up @@ -55,7 +55,9 @@ class Upload(models.Model):
created_at = models.DateTimeField(default=datetime.datetime.now)

def __unicode__(self):
return self.upload
return u"<%s - %s bytes - pk: %s, uuid: %s, md5: %s>" % (
self.filename, self.filesize, self.pk, self.uuid, self.md5
)

def stitch_chunks(self):
f = open(fname, "wb")
Expand Down Expand Up @@ -85,5 +87,7 @@ class Chunk(models.Model):
created_at = models.DateTimeField(default=datetime.datetime.now)

def __unicode__(self):
return self.chunk
return u"<Chunk pk=%s, size=%s, upload=(%s, %s)>" % (
self.pk, self.chunk_size, self.upload.pk, self.upload.uuid
)

0 comments on commit 51663a4

Please sign in to comment.