##// END OF EJS Templates
Moved signatures block to the model block. All the signed content is in the 'content' block now. Removed edit time, previous and next posts links from the XML sync output because they can be computed from the post itself and can be changed locally for foreign posts (which breaks the signature)
Moved signatures block to the model block. All the signed content is in the 'content' block now. Removed edit time, previous and next posts links from the XML sync output because they can be computed from the post itself and can be changed locally for foreign posts (which breaks the signature)

File last commit:

r805:40a08ce9 merge decentral
r838:2b96b9e7 decentral
Show More
admin.py
43 lines | 1.1 KiB | text/x-python | PythonLexer
from django.contrib import admin
from boards.models import Post, Tag, Ban, Thread, KeyPair
class PostAdmin(admin.ModelAdmin):
list_display = ('id', 'title', 'text')
list_filter = ('pub_time', 'thread_new')
search_fields = ('id', 'title', 'text')
class TagAdmin(admin.ModelAdmin):
list_display = ('name',)
class ThreadAdmin(admin.ModelAdmin):
def title(self, obj):
return obj.get_opening_post().title
def reply_count(self, obj):
return obj.get_reply_count()
list_display = ('id', 'title', 'reply_count', 'archived')
list_filter = ('bump_time', 'archived')
search_fields = ('id', 'title')
class KeyPairAdmin(admin.ModelAdmin):
list_display = ('public_key', 'primary')
list_filter = ('primary',)
search_fields = ('public_key',)
class BanAdmin(admin.ModelAdmin):
list_display = ('ip', 'can_read')
list_filter = ('can_read',)
search_fields = ('ip',)
admin.site.register(Post, PostAdmin)
admin.site.register(Tag, TagAdmin)
admin.site.register(Ban, BanAdmin)
admin.site.register(Thread, ThreadAdmin)
admin.site.register(KeyPair, KeyPairAdmin)