Переключатель
This commit is contained in:
1 parent
faf08cd391
commit
a3f44e04c6
3 files changed
+49
-7
No files matched your search
@@ -19,8 +19,9 @@ class GalleryInline(admin.TabularInline):
|
||||
class NewsAdmin(admin.ModelAdmin):
|
||||
list_display = ('title', 'author', 'text', 'cdate', 'link', 'get_html_photo')
|
||||
readonly_fields=('get_html_photo',)
|
||||
list_editable = ('link',)
|
||||
list_editable = ('link', 'cdate')
|
||||
list_filter = ('cdate',)
|
||||
ordering=('-cdate',)
|
||||
def save_model(self, request, obj, form, change):
|
||||
if (request.user.username != 'admin') :
|
||||
obj.author = request.user
|
||||
|
||||
Reference in new issue
Block a user