Skip to content

Instantly share code, notes, and snippets.

@ivan-vilches
Created April 21, 2019 05:50
Show Gist options
  • Save ivan-vilches/53f1e9fa27c59d836b807573fe8ef5b9 to your computer and use it in GitHub Desktop.
Save ivan-vilches/53f1e9fa27c59d836b807573fe8ef5b9 to your computer and use it in GitHub Desktop.
indented
from django.contrib import admin
from .models import Post
@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
list_display = ('title', 'slug', 'author', 'publish',
'status')
list_filter = ('status', 'created', 'publish', 'author')
search_fields = ('title', 'body')
prepopulated_fields = {'slug': ('title',)}
raw_id_fields = ('author',)
date_hierarchy = 'publish'
ordering = ('status', 'publish')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment