search_fields = ('title', 'content',)
prepopulated_fields = {'slug': ('title',)}
+ def get_form(self, request, obj=None, **kwargs):
+ form = super(NoteAdmin, self).get_form(request, obj, **kwargs)
+ form.base_fields['author'].initial = request.user
+ return form
+
admin.site.register(Note, NoteAdmin)
\ No newline at end of file