33from django .contrib import admin
44from django import forms
55
6- from models import (StateType , State , DocAlias , DocumentAuthor , RelatedDocument ,
7- Document , DocHistory , BallotType , DocEvent , NewRevisionDocEvent , StateDocEvent ,
8- ConsensusDocEvent , BallotDocEvent , WriteupDocEvent , LastCallDocEvent ,
9- TelechatDocEvent , BallotPositionDocEvent )
6+ from models import (StateType , State , RelatedDocument , DocumentAuthor , Document , RelatedDocHistory ,
7+ DocHistoryAuthor , DocHistory , DocAlias , DocReminder , DocEvent , NewRevisionDocEvent ,
8+ StateDocEvent , ConsensusDocEvent , BallotType , BallotDocEvent , WriteupDocEvent , LastCallDocEvent ,
9+ TelechatDocEvent , BallotPositionDocEvent , ReviewRequestDocEvent , InitialReviewDocEvent ,
10+ AddedMessageEvent , SubmissionDocEvent , DeletedEvent , EditedAuthorsDocEvent , )
11+
1012
1113from ietf .doc .utils import get_state_types
1214
@@ -96,6 +98,12 @@ class Meta:
9698 fields = '__all__'
9799 model = Document
98100
101+ class DocumentAuthorAdmin (admin .ModelAdmin ):
102+ list_display = ['id' , 'document' , 'person' , 'email' , 'affiliation' , 'country' , 'order' ]
103+ search_fields = ['document__docalias__name' , 'person__name' , 'email__address' , 'affiliation' , 'country' ]
104+ raw_id_fields = ["document" , "person" , "email" ]
105+ admin .site .register (DocumentAuthor , DocumentAuthorAdmin )
106+
99107class DocumentAdmin (admin .ModelAdmin ):
100108 list_display = ['name' , 'rev' , 'group' , 'pages' , 'intended_std_level' , 'author_list' , 'time' ]
101109 search_fields = ['name' ]
@@ -136,13 +144,30 @@ class DocAliasAdmin(admin.ModelAdmin):
136144 raw_id_fields = ['document' ]
137145admin .site .register (DocAlias , DocAliasAdmin )
138146
147+ class DocReminderAdmin (admin .ModelAdmin ):
148+ list_display = ['id' , 'event' , 'type' , 'due' , 'active' ]
149+ list_filter = ['type' , 'due' , 'active' ]
150+ raw_id_fields = ['event' ]
151+ admin .site .register (DocReminder , DocReminderAdmin )
152+
139153class RelatedDocumentAdmin (admin .ModelAdmin ):
140154 list_display = ['source' , 'target' , 'relationship' , ]
141155 list_filter = ['relationship' , ]
142156 search_fields = ['source__name' , 'target__name' , 'target__document__name' , ]
143157 raw_id_fields = ['source' , 'target' , ]
144158admin .site .register (RelatedDocument , RelatedDocumentAdmin )
145159
160+ class RelatedDocHistoryAdmin (admin .ModelAdmin ):
161+ list_display = ['id' , 'source' , 'target' , 'relationship' ]
162+ list_filter = ['relationship' ]
163+ raw_id_fields = ['source' , 'target' ]
164+ admin .site .register (RelatedDocHistory , RelatedDocHistoryAdmin )
165+
166+ class DocHistoryAuthorAdmin (admin .ModelAdmin ):
167+ list_display = ['id' , 'person' , 'email' , 'affiliation' , 'country' , 'order' , 'document' ]
168+ raw_id_fields = ['person' , 'email' , 'document' ]
169+ admin .site .register (DocHistoryAuthor , DocHistoryAuthorAdmin )
170+
146171class BallotTypeAdmin (admin .ModelAdmin ):
147172 list_display = ["slug" , "doc_type" , "name" , "question" ]
148173admin .site .register (BallotType , BallotTypeAdmin )
@@ -169,14 +194,20 @@ def short_desc(self, obj):
169194admin .site .register (WriteupDocEvent , DocEventAdmin )
170195admin .site .register (LastCallDocEvent , DocEventAdmin )
171196admin .site .register (TelechatDocEvent , DocEventAdmin )
197+ admin .site .register (ReviewRequestDocEvent , DocEventAdmin )
198+ admin .site .register (InitialReviewDocEvent , DocEventAdmin )
199+ admin .site .register (AddedMessageEvent , DocEventAdmin )
200+ admin .site .register (SubmissionDocEvent , DocEventAdmin )
201+ admin .site .register (EditedAuthorsDocEvent , DocEventAdmin )
202+
203+
204+ class DeletedEventAdmin (admin .ModelAdmin ):
205+ list_display = [u'id' , 'content_type' , 'json' , 'by' , 'time' ]
206+ list_filter = ['time' ]
207+ raw_id_fields = ['content_type' , 'by' ]
208+ admin .site .register (DeletedEvent , DeletedEventAdmin )
172209
173210class BallotPositionDocEventAdmin (DocEventAdmin ):
174211 raw_id_fields = ["doc" , "by" , "ad" , "ballot" ]
175212admin .site .register (BallotPositionDocEvent , BallotPositionDocEventAdmin )
176213
177- class DocumentAuthorAdmin (admin .ModelAdmin ):
178- list_display = ['id' , 'document' , 'person' , 'email' , 'affiliation' , 'country' , 'order' ]
179- search_fields = ['document__docalias__name' , 'person__name' , 'email__address' , 'affiliation' , 'country' ]
180- raw_id_fields = ["document" , "person" , "email" ]
181- admin .site .register (DocumentAuthor , DocumentAuthorAdmin )
182-
0 commit comments