Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from Flowerowl/master
format code with pep8
- Loading branch information
Showing
3 changed files
with
43 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,62 @@ | ||
from django.contrib import admin | ||
from wordpress.models import Option, Comment, Link, Post, PostMeta, Taxonomy, Term, User, UserMeta | ||
from wordpress.models import ( | ||
Option, Comment, Link, Post, | ||
PostMeta, Taxonomy, Term, User, UserMeta | ||
) | ||
|
||
|
||
class OptionAdmin(admin.ModelAdmin): | ||
list_display = ('name', 'value') | ||
|
||
|
||
class CommentAdmin(admin.ModelAdmin): | ||
list_display = ('id','post','author_name','post_date') | ||
list_filter = ('comment_type','approved') | ||
search_fields = ('author_name','author_email','post__title') | ||
list_display = ('id', 'post', 'author_name', 'post_date') | ||
list_filter = ('comment_type', 'approved') | ||
search_fields = ('author_name', 'author_email', 'post__title') | ||
|
||
|
||
class LinkAdmin(admin.ModelAdmin): | ||
list_display = ('id','name','url','description') | ||
list_display = ('id', 'name', 'url', 'description') | ||
list_filter = ('visible',) | ||
search_fields = ('name','url','description') | ||
search_fields = ('name', 'url', 'description') | ||
|
||
|
||
class PostMetaInline(admin.TabularInline): | ||
model = PostMeta | ||
|
||
|
||
|
||
class PostAdmin(admin.ModelAdmin): | ||
inlines = (PostMetaInline,) | ||
list_display = ('id','title','author','post_date') | ||
list_filter = ('status','post_type','comment_status','ping_status','author') | ||
list_display = ('id', 'title', 'author', 'post_date') | ||
list_filter = ('status', 'post_type', 'comment_status', 'ping_status', 'author') | ||
search_fields = ('title',) | ||
|
||
|
||
|
||
class UserMetaInline(admin.TabularInline): | ||
model = UserMeta | ||
|
||
|
||
|
||
class UserAdmin(admin.ModelAdmin): | ||
inlines = (UserMetaInline,) | ||
list_display = ('id','display_name','email','status') | ||
list_display = ('id', 'display_name', 'email', 'status') | ||
list_filter = ('status',) | ||
search_fields = ('login','username','display_name','email') | ||
search_fields = ('login', 'username', 'display_name', 'email') | ||
|
||
|
||
class TaxonomyAdmin(admin.ModelAdmin): | ||
list_display = ('id','name','term') | ||
list_display = ('id', 'name', 'term') | ||
list_filter = ('name',) | ||
|
||
|
||
|
||
class TermAdmin(admin.ModelAdmin): | ||
list_display = ('id','name') | ||
list_display = ('id', 'name') | ||
search_fields = ('name',) | ||
|
||
|
||
admin.site.register(Option, OptionAdmin) | ||
admin.site.register(Comment, CommentAdmin) | ||
admin.site.register(Link, LinkAdmin) | ||
admin.site.register(Post, PostAdmin) | ||
admin.site.register(Taxonomy, TaxonomyAdmin) | ||
admin.site.register(Term, TermAdmin) | ||
admin.site.register(User, UserAdmin) | ||
admin.site.register(User, UserAdmin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters