mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
PEP8 cleanup
Signed-off-by: Jason Myers <jason@jasonamyers.com>
This commit is contained in:
parent
0fdb692c6c
commit
7a61c68c50
128 changed files with 739 additions and 206 deletions
|
@ -65,6 +65,7 @@ class CustomPaginator(Paginator):
|
|||
orphans=2,
|
||||
allow_empty_first_page=allow_empty_first_page)
|
||||
|
||||
|
||||
class AuthorListCustomPaginator(AuthorList):
|
||||
paginate_by = 5
|
||||
|
||||
|
@ -176,33 +177,42 @@ class BookConfig(object):
|
|||
queryset = Book.objects.all()
|
||||
date_field = 'pubdate'
|
||||
|
||||
|
||||
class BookArchive(BookConfig, generic.ArchiveIndexView):
|
||||
pass
|
||||
|
||||
|
||||
class BookYearArchive(BookConfig, generic.YearArchiveView):
|
||||
pass
|
||||
|
||||
|
||||
class BookMonthArchive(BookConfig, generic.MonthArchiveView):
|
||||
pass
|
||||
|
||||
|
||||
class BookWeekArchive(BookConfig, generic.WeekArchiveView):
|
||||
pass
|
||||
|
||||
|
||||
class BookDayArchive(BookConfig, generic.DayArchiveView):
|
||||
pass
|
||||
|
||||
|
||||
class BookTodayArchive(BookConfig, generic.TodayArchiveView):
|
||||
pass
|
||||
|
||||
|
||||
class BookDetail(BookConfig, generic.DateDetailView):
|
||||
pass
|
||||
|
||||
|
||||
class AuthorGetQuerySetFormView(generic.edit.ModelFormMixin):
|
||||
fields = '__all__'
|
||||
|
||||
def get_queryset(self):
|
||||
return Author.objects.all()
|
||||
|
||||
|
||||
class BookDetailGetObjectCustomQueryset(BookDetail):
|
||||
def get_object(self, queryset=None):
|
||||
return super(BookDetailGetObjectCustomQueryset, self).get_object(
|
||||
|
@ -234,10 +244,12 @@ class CustomContextView(generic.detail.SingleObjectMixin, generic.View):
|
|||
def get_context_object_name(self, obj):
|
||||
return "test_name"
|
||||
|
||||
|
||||
class CustomSingleObjectView(generic.detail.SingleObjectMixin, generic.View):
|
||||
model = Book
|
||||
object = Book(name="dummy")
|
||||
|
||||
|
||||
class BookSigningConfig(object):
|
||||
model = BookSigning
|
||||
date_field = 'event_date'
|
||||
|
@ -246,24 +258,31 @@ class BookSigningConfig(object):
|
|||
def get_template_names(self):
|
||||
return ['generic_views/book%s.html' % self.template_name_suffix]
|
||||
|
||||
|
||||
class BookSigningArchive(BookSigningConfig, generic.ArchiveIndexView):
|
||||
pass
|
||||
|
||||
|
||||
class BookSigningYearArchive(BookSigningConfig, generic.YearArchiveView):
|
||||
pass
|
||||
|
||||
|
||||
class BookSigningMonthArchive(BookSigningConfig, generic.MonthArchiveView):
|
||||
pass
|
||||
|
||||
|
||||
class BookSigningWeekArchive(BookSigningConfig, generic.WeekArchiveView):
|
||||
pass
|
||||
|
||||
|
||||
class BookSigningDayArchive(BookSigningConfig, generic.DayArchiveView):
|
||||
pass
|
||||
|
||||
|
||||
class BookSigningTodayArchive(BookSigningConfig, generic.TodayArchiveView):
|
||||
pass
|
||||
|
||||
|
||||
class BookSigningDetail(BookSigningConfig, generic.DateDetailView):
|
||||
context_object_name = 'book'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue