blob: a2da9c5130a207abf43c69f11168c150060bf10f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
'''Copied from Django 1.3.1 source code, it will use this model to'''
from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy
class Message(models.Model):
"""
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.
"""
user = models.ForeignKey(User, related_name='_message_set')
message = models.TextField(ugettext_lazy('message'))
class Meta:
'''Added for backwards compatibility with databases
migrated from django 1.3'''
app_label = 'auth'
db_table = 'auth_message'
def __unicode__(self):
return self.message
def __str__(self):
return self.message.encode('utf-8')
|