##// END OF EJS Templates
Fixed posting without a primary key defined. Use more proper way to assert an exception
Fixed posting without a primary key defined. Use more proper way to assert an exception

File last commit:

r805:40a08ce9 merge decentral
r835:0f3bc07f decentral
Show More
admin.py
43 lines | 1.1 KiB | text/x-python | PythonLexer
neko259
Initial commit. One test doesn't work, missing posting form.
r0 from django.contrib import admin
neko259
Added an admin page for keypair. Renamed the public key to global id in the...
r797 from boards.models import Post, Tag, Ban, Thread, KeyPair
neko259
Initial commit. One test doesn't work, missing posting form.
r0
neko259
Moved some settings to boards.settings
r333
neko259
Added a better admin interface.
r305 class PostAdmin(admin.ModelAdmin):
list_display = ('id', 'title', 'text')
neko259
Split up post model into post and thread to normalise models. Still need some refactoring
r398 list_filter = ('pub_time', 'thread_new')
neko259
Added a better admin interface.
r305 search_fields = ('id', 'title', 'text')
neko259
Moved some settings to boards.settings
r333
neko259
Added a better admin interface.
r305 class TagAdmin(admin.ModelAdmin):
neko259
Removed linked tags. Added changelog for 2.0. Fixed reply connection.
r740 list_display = ('name',)
neko259
Added a better admin interface.
r305
neko259
Added thread admin interface
r604 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')
neko259
Added an admin page for keypair. Renamed the public key to global id in the...
r797
class KeyPairAdmin(admin.ModelAdmin):
list_display = ('public_key', 'primary')
list_filter = ('primary',)
search_fields = ('public_key',)
neko259
Updated ban admin to search by ip
r804 class BanAdmin(admin.ModelAdmin):
list_display = ('ip', 'can_read')
list_filter = ('can_read',)
search_fields = ('ip',)
neko259
Added a better admin interface.
r305 admin.site.register(Post, PostAdmin)
admin.site.register(Tag, TagAdmin)
neko259
Updated ban admin to search by ip
r804 admin.site.register(Ban, BanAdmin)
neko259
Added thread admin interface
r604 admin.site.register(Thread, ThreadAdmin)
neko259
Added an admin page for keypair. Renamed the public key to global id in the...
r797 admin.site.register(KeyPair, KeyPairAdmin)