fnp
/
edumed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
469775e
)
filter and extra column in confirmation admin
author
Jan Szejko
<janek37@gmail.com>
Thu, 16 Nov 2017 14:20:52 +0000
(15:20 +0100)
committer
Jan Szejko
<janek37@gmail.com>
Thu, 16 Nov 2017 14:20:52 +0000
(15:20 +0100)
wtem/admin.py
patch
|
blob
|
history
wtem/models.py
patch
|
blob
|
history
diff --git
a/wtem/admin.py
b/wtem/admin.py
index
4621f5f
..
efaf253
100644
(file)
--- a/
wtem/admin.py
+++ b/
wtem/admin.py
@@
-240,8
+240,10
@@
def report_view(request):
class ConfirmationAdmin(admin.ModelAdmin):
class ConfirmationAdmin(admin.ModelAdmin):
- list_display = ('email', 'first_name', 'last_name', 'readable_contact', 'readable_age', 'confirmed')
- readonly_fields = ('contact', 'readable_contact', 'readable_age', 'key', 'confirmed')
+ list_display = ('email', 'first_name', 'last_name', 'readable_contact', 'school_phone', 'readable_age', 'confirmed')
+ readonly_fields = ('contact', 'readable_contact', 'readable_age', 'school_phone', 'key', 'confirmed')
+ list_filter = ('confirmed',)
+ list_select_related = ('contact',)
def resend_mail(self, request, queryset):
for confirmation in queryset:
def resend_mail(self, request, queryset):
for confirmation in queryset:
diff --git
a/wtem/models.py
b/wtem/models.py
index
390687f
..
5a7e221
100644
(file)
--- a/
wtem/models.py
+++ b/
wtem/models.py
@@
-278,6
+278,9
@@
class Confirmation(models.Model):
def readable_contact(self):
return '%s <%s>' % (self.contact.body.get('przewodniczacy'), self.contact.contact)
def readable_contact(self):
return '%s <%s>' % (self.contact.body.get('przewodniczacy'), self.contact.contact)
+ def school_phone(self):
+ return '%s, tel. %s' % (self.contact.body.get('school'), self.contact.body.get('school_phone'))
+
def age(self):
return timezone.now() - self.contact.created_at
def age(self):
return timezone.now() - self.contact.created_at