-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
430 additions
and
484 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,14 +1,17 @@ | ||
from django.utils.translation import ugettext_lazy | ||
from django.utils.translation import gettext_lazy | ||
|
||
|
||
class PublishableMixin: | ||
"""Helper to add Django admin actions to publish and unpublish model objects.""" | ||
actions = ('make_published', 'make_unpublished') | ||
|
||
actions = ("make_published", "make_unpublished") | ||
|
||
def make_published(self, request, queryset): | ||
queryset.update(published=True) | ||
make_published.short_description = ugettext_lazy("Publish selected %(verbose_name_plural)s") | ||
|
||
make_published.short_description = gettext_lazy("Publish selected %(verbose_name_plural)s") | ||
|
||
def make_unpublished(self, request, queryset): | ||
queryset.update(published=False) | ||
make_unpublished.short_description = ugettext_lazy("Unpublish selected %(verbose_name_plural)s") | ||
|
||
make_unpublished.short_description = gettext_lazy("Unpublish selected %(verbose_name_plural)s") |
Oops, something went wrong.