]>
git.p6c8.net - pcdenotes.git/blob - notes/admin.py
1 from django
.contrib
import admin
2 from .models
import Note
4 # Register your models here.
6 class NoteAdmin(admin
.ModelAdmin
):
7 list_display
= ('title', 'status',)
8 list_filter
= ('status',)
9 search_fields
= ('title', 'content',)
10 prepopulated_fields
= {'slug': ('title',)}
12 def get_form(self
, request
, obj
=None, **kwargs
):
13 form
= super(NoteAdmin
, self
).get_form(request
, obj
, **kwargs
)
14 form
.base_fields
['author'].initial
= request
.user
17 admin
.site
.register(Note
, NoteAdmin
)
patrick-canterino.de