Index: django/contrib/auth/models.py
===================================================================
--- django/contrib/auth/models.py	(revision 6962)
+++ django/contrib/auth/models.py	(working copy)
@@ -277,7 +277,7 @@
     def get_and_delete_messages(self):
         messages = []
         for m in self.message_set.all():
-            messages.append(m.message)
+            messages.append(m)
             m.delete()
         return messages
 
@@ -308,12 +308,14 @@
     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.
+    timestamps. A message consists of the actual message text and an optional
+    30 characters or fewer category string. Messages are created by the Django
+    admin after successful actions. For example, "The poll Foo was created
+    successfully." is a message.
     """
     user = models.ForeignKey(User)
     message = models.TextField(_('message'))
+    category = models.CharField(_('category'), max_length=30, blank=True)
 
     def __unicode__(self):
         return self.message
Index: tests/regressiontests/auth_backends/tests.py
===================================================================
--- tests/regressiontests/auth_backends/tests.py	(revision 6962)
+++ tests/regressiontests/auth_backends/tests.py	(working copy)
@@ -69,4 +69,16 @@
 True
 >>> user.has_perms(['auth.test3', 'auth.test_group'])
 True
+
+>>> user = User.objects.create_user('test2', 'test2@example.com', 'test')
+>>> message = user.message_set.create(message="uncategorised message")
+>>> messages = user.get_and_delete_messages()
+>>> messages[0]
+<Message: uncategorised message>
+>>> messages[0].category
+u''
+>>> message = user.message_set.create(message="Categorised message", category="test")
+>>> messages = user.get_and_delete_messages()
+>>> messages[0].category
+u'test'
 """}
Index: docs/authentication.txt
===================================================================
--- docs/authentication.txt	(revision 6962)
+++ docs/authentication.txt	(working copy)
@@ -959,7 +959,8 @@
 The message system is a lightweight way to queue messages for given users.
 
 A message is associated with a ``User``. There's no concept of expiration or
-timestamps.
+timestamps. A message consists of the actual ``message`` text and an optional
+30 characters or fewer ``category`` string.
 
 Messages are used by the Django admin after successful actions. For example,
 ``"The poll Foo was created successfully."`` is a message.
@@ -967,7 +968,8 @@
 The API is simple:
 
     * To create a new message, use
-      ``user_obj.message_set.create(message='message_text')``.
+      ``user_obj.message_set.create(message='message_text',
+      category='message_category')``.
     * To retrieve/delete messages, use ``user_obj.get_and_delete_messages()``,
       which returns a list of ``Message`` objects in the user's queue (if any)
       and deletes the messages from the queue.
@@ -978,7 +980,8 @@
     def create_playlist(request, songs):
         # Create the playlist with the given songs.
         # ...
-        request.user.message_set.create(message="Your playlist was added successfully.")
+        request.user.message_set.create(message="Your playlist was added successfully.",
+            category="information")
         return render_to_response("playlists/create.html",
             context_instance=RequestContext(request))
 
@@ -989,7 +992,7 @@
     {% if messages %}
     <ul>
         {% for message in messages %}
-        <li>{{ message }}</li>
+        <li class="{{ message.category }}">{{ message }}</li>
         {% endfor %}
     </ul>
     {% endif %}
