Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed up project to be compatible with NFA version of trunk.

git-svn-id: http://django-notification.googlecode.com/svn/trunk@83 590c3fc9-4838-0410-bb95-17a0c9b37ca9
  • Loading branch information...
commit 4d2558699bfeada48034394bcfbd44dbd0eb5ea4 1 parent ff055ed
@empty empty authored
Showing with 17 additions and 12 deletions.
  1. +17 −0 notification/admin.py
  2. +0 −12 notification/models.py
View
17 notification/admin.py
@@ -0,0 +1,17 @@
+from django.contrib import admin
+from notification.models import NoticeType, NoticeSetting, Notice, ObservedItem
+
+class NoticeTypeAdmin(admin.ModelAdmin):
+ list_display = ('label', 'display', 'description', 'default')
+
+class NoticeSettingAdmin(admin.ModelAdmin):
+ list_display = ('id', 'user', 'notice_type', 'medium', 'send')
+
+class NoticeAdmin(admin.ModelAdmin):
+ list_display = ('message', 'user', 'notice_type', 'added', 'unseen', 'archived')
+
+
+admin.site.register(NoticeType, NoticeTypeAdmin)
+admin.site.register(NoticeSetting, NoticeSettingAdmin)
+admin.site.register(Notice, NoticeAdmin)
+admin.site.register(ObservedItem)
View
12 notification/models.py
@@ -34,9 +34,6 @@ class NoticeType(models.Model):
def __unicode__(self):
return self.label
- class Admin:
- list_display = ('label', 'display', 'description', 'default')
-
class Meta:
verbose_name = _("notice type")
verbose_name_plural = _("notice types")
@@ -63,9 +60,6 @@ class NoticeSetting(models.Model):
medium = models.CharField(_('medium'), max_length=1, choices=NOTICE_MEDIA)
send = models.BooleanField(_('send'))
- class Admin:
- list_display = ('id', 'user', 'notice_type', 'medium', 'send')
-
class Meta:
verbose_name = _("notice setting")
verbose_name_plural = _("notice settings")
@@ -147,9 +141,6 @@ class Meta:
verbose_name = _("notice")
verbose_name_plural = _("notices")
- class Admin:
- list_display = ('message', 'user', 'notice_type', 'added', 'unseen', 'archived')
-
def create_notice_type(label, display, description, default=2):
"""
Creates a new NoticeType.
@@ -300,9 +291,6 @@ class Meta:
verbose_name = _('observed item')
verbose_name_plural = _('observed items')
- class Admin:
- pass
-
def send_notice(self):
send([self.user], self.notice_type.label, self.message_template,
[self.observed_object])
Please sign in to comment.
Something went wrong with that request. Please try again.