##// END OF EJS Templates
Small code cleanups
Small code cleanups

File last commit:

r604:ae41bbf4 default
r721:1814d7a8 default
Show More
admin.py
40 lines | 972 B | text/x-python | PythonLexer
neko259
Initial commit. One test doesn't work, missing posting form.
r0 from django.contrib import admin
neko259
Added thread admin interface
r604 from boards.models import Post, Tag, User, Ban, Thread
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):
list_display = ('name', 'linked')
list_filter = ('linked',)
class UserAdmin(admin.ModelAdmin):
list_display = ('user_id', 'rank')
neko259
Fixed moderator panel
r540 search_fields = ('user_id',)
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 a better admin interface.
r305 admin.site.register(Post, PostAdmin)
admin.site.register(Tag, TagAdmin)
admin.site.register(User, UserAdmin)
neko259
Merged with default branch
r137 admin.site.register(Ban)
neko259
Added thread admin interface
r604 admin.site.register(Thread, ThreadAdmin)