mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-03-16 22:20:24 +00:00
fix pep8 errors
This commit is contained in:
parent
2c73396391
commit
cce430242c
4 changed files with 13 additions and 9 deletions
|
|
@ -8,7 +8,6 @@ from djadmin2 import permissions
|
|||
from djadmin2.actions import BaseListAction
|
||||
|
||||
|
||||
|
||||
class CustomPublishAction(BaseListAction):
|
||||
|
||||
permission_classes = BaseListAction.permission_classes + (
|
||||
|
|
@ -16,10 +15,12 @@ class CustomPublishAction(BaseListAction):
|
|||
)
|
||||
|
||||
description = ugettext_lazy('Publish selected items')
|
||||
success_message = pgettext_lazy('singular form',
|
||||
'Successfully published %(count)s %(items)s')
|
||||
success_message_plural = pgettext_lazy('plural form',
|
||||
'Successfully published %(count)s %(items)s')
|
||||
success_message = pgettext_lazy(
|
||||
'singular form',
|
||||
'Successfully published %(count)s %(items)s')
|
||||
success_message_plural = pgettext_lazy(
|
||||
'plural form',
|
||||
'Successfully published %(count)s %(items)s')
|
||||
|
||||
default_template_name = "actions/publish_selected_items.html"
|
||||
|
||||
|
|
@ -52,7 +53,9 @@ class PublishAllItemsAction(BaseListAction):
|
|||
|
||||
def unpublish_items(request, queryset):
|
||||
queryset.update(published=False)
|
||||
messages.add_message(request, messages.INFO, ugettext_lazy(u'Items unpublished'))
|
||||
messages.add_message(request, messages.INFO,
|
||||
ugettext_lazy(u'Items unpublished'))
|
||||
|
||||
|
||||
# Translators : action description
|
||||
unpublish_items.description = ugettext_lazy('Unpublish selected items')
|
||||
|
|
@ -66,5 +69,6 @@ def unpublish_all_items(request, queryset):
|
|||
ugettext_lazy('Items unpublished'),
|
||||
)
|
||||
|
||||
|
||||
unpublish_all_items.description = ugettext_lazy('Unpublish all items')
|
||||
unpublish_all_items.only_selected = False
|
||||
|
|
|
|||
|
|
@ -16,5 +16,6 @@ class PostAdmin(admin.ModelAdmin):
|
|||
list_filter = ['published', 'title']
|
||||
date_hierarchy = "published_date"
|
||||
|
||||
|
||||
admin.site.register(Post, PostAdmin)
|
||||
admin.site.register(Comment)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class PostAdmin(ModelAdmin2):
|
|||
}
|
||||
save_on_top = True
|
||||
date_hierarchy = "published_date"
|
||||
ordering = ["-published_date", "title",]
|
||||
ordering = ["-published_date", "title", ]
|
||||
|
||||
|
||||
class CommentAdmin(ModelAdmin2):
|
||||
|
|
@ -42,6 +42,7 @@ class CommentAdmin(ModelAdmin2):
|
|||
actions_on_bottom = True
|
||||
actions_selection_counter = False
|
||||
|
||||
|
||||
# Register the blog app with a verbose name
|
||||
djadmin2_site.register_app_verbose_name(
|
||||
'blog',
|
||||
|
|
@ -51,4 +52,3 @@ djadmin2_site.register_app_verbose_name(
|
|||
# Register each model with the admin
|
||||
djadmin2_site.register(Post, PostAdmin)
|
||||
djadmin2_site.register(Comment, CommentAdmin)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
#from django.shortcuts import render
|
||||
from django.views.generic import ListView, DetailView
|
||||
|
||||
from .models import Post
|
||||
|
|
|
|||
Loading…
Reference in a new issue