##// END OF EJS Templates
Made some fields in post admin read-only. Show attachment as its url
neko259 -
r1389:c9a1cd47 default
parent child Browse files
Show More
@@ -10,7 +10,8 b' class PostAdmin(admin.ModelAdmin):'
10 list_filter = ('pub_time',)
10 list_filter = ('pub_time',)
11 search_fields = ('id', 'title', 'text', 'poster_ip')
11 search_fields = ('id', 'title', 'text', 'poster_ip')
12 exclude = ('referenced_posts', 'refmap')
12 exclude = ('referenced_posts', 'refmap')
13 readonly_fields = ('poster_ip', 'threads', 'thread', 'images', 'uid')
13 readonly_fields = ('poster_ip', 'threads', 'thread', 'images',
14 'attachments', 'uid', 'url', 'pub_time', 'opening')
14
15
15 def ban_poster(self, request, queryset):
16 def ban_poster(self, request, queryset):
16 bans = 0
17 bans = 0
@@ -38,4 +38,5 b' class Attachment(models.Model):'
38
38
39 return file_viewer(self.file, self.mimetype).get_view()
39 return file_viewer(self.file, self.mimetype).get_view()
40
40
41
41 def __str__(self):
42 return self.file.url
General Comments 0
You need to be logged in to leave comments. Login now