Skip to content

Instantly share code, notes, and snippets.

@ivan-vilches
Created April 21, 2019 06:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivan-vilches/5cdc17b34d48e2e180190208d821c110 to your computer and use it in GitHub Desktop.
Save ivan-vilches/5cdc17b34d48e2e180190208d821c110 to your computer and use it in GitHub Desktop.
indendent
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