mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
use autocomplete_fields in admin
This commit is contained in:
11
com/admin.py
11
com/admin.py
@ -12,7 +12,6 @@
|
||||
# OR WITHIN THE LOCAL FILE "LICENSE"
|
||||
#
|
||||
#
|
||||
from ajax_select import make_ajax_form
|
||||
from django.contrib import admin
|
||||
from haystack.admin import SearchModelAdmin
|
||||
|
||||
@ -23,19 +22,13 @@ from com.models import *
|
||||
class NewsAdmin(SearchModelAdmin):
|
||||
list_display = ("title", "type", "club", "author")
|
||||
search_fields = ("title", "summary", "content")
|
||||
form = make_ajax_form(
|
||||
News,
|
||||
{
|
||||
"author": "users",
|
||||
"moderator": "users",
|
||||
},
|
||||
)
|
||||
autocomplete_fields = ("author", "moderator")
|
||||
|
||||
|
||||
@admin.register(Poster)
|
||||
class PosterAdmin(SearchModelAdmin):
|
||||
list_display = ("name", "club", "date_begin", "date_end", "moderator")
|
||||
form = make_ajax_form(Poster, {"moderator": "users"})
|
||||
autocomplete_fields = ("moderator",)
|
||||
|
||||
|
||||
@admin.register(Weekmail)
|
||||
|
Reference in New Issue
Block a user