mirror of
https://github.com/haiwen/seahub.git
synced 2025-06-24 06:09:07 +00:00
26 lines
730 B
Python
26 lines
730 B
Python
import datetime
|
|
from django.db import models
|
|
from django.forms import ModelForm, Textarea
|
|
|
|
class Notification(models.Model):
|
|
message = models.CharField(max_length=512)
|
|
primary = models.BooleanField(default=False)
|
|
|
|
class UserNotification(models.Model):
|
|
to_user = models.EmailField(db_index=True, max_length=255)
|
|
msg_type = models.CharField(db_index=True, max_length=30)
|
|
detail = models.TextField()
|
|
timestamp = models.DateTimeField(default=datetime.datetime.now)
|
|
|
|
class NotificationForm(ModelForm):
|
|
"""
|
|
Form for adding notification.
|
|
"""
|
|
class Meta:
|
|
model = Notification
|
|
fields = ('message', 'primary')
|
|
widgets = {
|
|
'message': Textarea(),
|
|
}
|
|
|