admin.py
26 lines
| 600 B
| text/x-python
|
PythonLexer
/ boards / admin.py
neko259
|
r0 | from django.contrib import admin | ||
neko259
|
r137 | from boards.models import Post, Tag, User, Ban | ||
neko259
|
r0 | |||
neko259
|
r333 | |||
neko259
|
r305 | class PostAdmin(admin.ModelAdmin): | ||
list_display = ('id', 'title', 'text') | ||||
neko259
|
r398 | list_filter = ('pub_time', 'thread_new') | ||
neko259
|
r305 | search_fields = ('id', 'title', 'text') | ||
neko259
|
r333 | |||
neko259
|
r305 | class TagAdmin(admin.ModelAdmin): | ||
list_display = ('name', 'linked') | ||||
list_filter = ('linked',) | ||||
class UserAdmin(admin.ModelAdmin): | ||||
list_display = ('user_id', 'rank') | ||||
neko259
|
r540 | search_fields = ('user_id',) | ||
neko259
|
r305 | |||
admin.site.register(Post, PostAdmin) | ||||
admin.site.register(Tag, TagAdmin) | ||||
admin.site.register(User, UserAdmin) | ||||
neko259
|
r137 | admin.site.register(Ban) | ||