-
Notifications
You must be signed in to change notification settings - Fork 17
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
15 changed files
with
518 additions
and
376 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
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
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
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,28 +1,32 @@ | ||
from bananas.admin import AdminView, register | ||
from django.contrib import admin | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from bananas.admin import AdminView, register | ||
|
||
from . import models | ||
|
||
|
||
@register | ||
class BananasAdmin(AdminView): | ||
verbose_name = _('Bananas') | ||
permissions = (('foobar_permission', 'Can foo bars'),) | ||
verbose_name = _("Bananas") | ||
permissions = (("foobar_permission", "Can foo bars"),) | ||
searchbar = True | ||
tools = ( | ||
(_('home'), 'admin:index', 'has_access'), | ||
('superadmin only', 'https://foo.bar/', 'foobar_permission'), | ||
(_("home"), "admin:index", "has_access"), | ||
("superadmin only", "https://foo.bar/", "foobar_permission"), | ||
) | ||
|
||
def get(self, request): | ||
return self.render('bananas.html') | ||
context = {"result_count": 123 if request.GET.get("q") else 0} | ||
return self.render("bananas.html", context) | ||
|
||
|
||
@admin.register(models.Monkey) | ||
class MonkeyAdmin(admin.ModelAdmin): | ||
list_display = ('id',) | ||
list_filter = ('user__username',) | ||
raw_id_fields = ('user',) | ||
date_hierarchy = 'date_created' | ||
list_display = ("id",) | ||
list_filter = ("user__username",) | ||
raw_id_fields = ("user",) | ||
date_hierarchy = "date_created" | ||
actions_on_top = True | ||
actions_on_bottom = True | ||
actions_selection_counter = False |
Oops, something went wrong.