mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-09 22:38:19 +02:00
Merge f7c40743f5 into 74cba103dd
This commit is contained in:
commit
e31785bb10
1 changed files with 7 additions and 4 deletions
|
|
@ -27,6 +27,7 @@ from django.core.mail.message import make_msgid
|
|||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.timezone import now
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from django_mailbox import utils
|
||||
from django_mailbox.signals import message_received
|
||||
|
|
@ -44,6 +45,7 @@ class ActiveMailboxManager(models.Manager):
|
|||
)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Mailbox(models.Model):
|
||||
name = models.CharField(
|
||||
_(u'Name'),
|
||||
|
|
@ -402,7 +404,7 @@ class Mailbox(models.Model):
|
|||
self.save()
|
||||
return new_mail
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
class Meta:
|
||||
|
|
@ -430,6 +432,7 @@ class UnreadMessageManager(models.Manager):
|
|||
)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Message(models.Model):
|
||||
mailbox = models.ForeignKey(
|
||||
Mailbox,
|
||||
|
|
@ -708,10 +711,10 @@ class Message(models.Model):
|
|||
attachment.delete()
|
||||
return super(Message, self).delete(*args, **kwargs)
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
return self.subject
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class MessageAttachment(models.Model):
|
||||
message = models.ForeignKey(
|
||||
Message,
|
||||
|
|
@ -781,5 +784,5 @@ class MessageAttachment(models.Model):
|
|||
raise KeyError('Header %s does not exist' % name)
|
||||
return value
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
return self.document.url
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue