Ticket #3995: message_type.2.diff

File message_type.2.diff, 1.7 KB (added by joe4444, 18 years ago)

Same code; appended Message model docstring

  • usr/lib/python2.3/site-packages/django_trunk/django/contrib/auth/models.py

     
    225225    def get_and_delete_messages(self):
    226226        messages = []
    227227        for m in self.message_set.all():
    228             messages.append(m.message)
     228            messages.append(m)
    229229            m.delete()
    230230        return messages
    231231
     
    252252        return self._profile_cache
    253253
    254254class Message(models.Model):
    255     """The message system is a lightweight way to queue messages for given users. A message is associated with a User instance (so it is only applicable for registered users). There's no concept of expiration or timestamps. Messages are created by the Django admin after successful actions. For example, "The poll Foo was created successfully." is a message.
     255    """The message system is a lightweight way to queue messages for given users. A message is associated with a User instance (so it is only applicable for registered users). There's no concept of expiration or timestamps. Messages are created by the Django admin after successful actions. For example, "The poll Foo was created successfully." is a message. Now a message can be categorized as 'success' or 'failure' or 'generic' with success being the default.
    256256    """
    257257    user = models.ForeignKey(User)
    258258    message = models.TextField(_('message'))
     259    category = models.CharField(maxlength=1, choices=(('S', 'success'), ('F', 'failure'), ('G', 'generic'),), default='S')
    259260
    260261    def __str__(self):
    261262        return self.message
Back to Top