mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 11:59:23 +00:00
rework news form
This commit is contained in:
12
com/admin.py
12
com/admin.py
@ -13,17 +13,25 @@
|
||||
#
|
||||
#
|
||||
from django.contrib import admin
|
||||
from django.contrib.admin import TabularInline
|
||||
from haystack.admin import SearchModelAdmin
|
||||
|
||||
from com.models import News, Poster, Screen, Sith, Weekmail
|
||||
from com.models import News, NewsDate, Poster, Screen, Sith, Weekmail
|
||||
|
||||
|
||||
class NewsDateInline(TabularInline):
|
||||
model = NewsDate
|
||||
extra = 0
|
||||
|
||||
|
||||
@admin.register(News)
|
||||
class NewsAdmin(SearchModelAdmin):
|
||||
list_display = ("title", "type", "club", "author")
|
||||
list_display = ("title", "club", "author")
|
||||
search_fields = ("title", "summary", "content")
|
||||
autocomplete_fields = ("author", "moderator")
|
||||
|
||||
inlines = [NewsDateInline]
|
||||
|
||||
|
||||
@admin.register(Poster)
|
||||
class PosterAdmin(SearchModelAdmin):
|
||||
|
Reference in New Issue
Block a user