<s> import warnings <EOL> from django . views . generic . dates import ArchiveIndexView , DateDetailView , DayArchiveView , MonthArchiveView , YearArchiveView <EOL> from django . views . generic . detail import DetailView <EOL> from django . views . generic . list import ListView <EOL> from django . views . generic . base import RedirectView <EOL> from django . core . urlresolvers import reverse <EOL> from . models import Photo , Gallery <EOL> class GalleryListView ( ListView ) : <EOL> queryset = Gallery . objects . on_site ( ) . is_public ( ) <EOL> paginate_by = <NUM_LIT:20> <EOL> class GalleryDetailView ( DetailView ) : <EOL> queryset = Gallery . objects . on_site ( ) . is_public ( ) <EOL> class GalleryDateView ( object ) : <EOL> queryset = Gallery . objects . on_site ( ) . is_public ( ) <EOL> date_field = '<STR_LIT>' <EOL> allow_empty = True <EOL> class GalleryDateDetailView ( GalleryDateView , DateDetailView ) : <EOL> pass <EOL> class GalleryArchiveIndexView ( GalleryDateView , ArchiveIndexView ) : <EOL> pass <EOL> class GalleryDayArchiveView ( GalleryDateView , DayArchiveView ) : <EOL> pass <EOL> class GalleryMonthArchiveView ( GalleryDateView , MonthArchiveView ) : <EOL> pass <EOL> class GalleryYearArchiveView ( GalleryDateView , YearArchiveView ) : <EOL> make_object_list = True <EOL> class PhotoListView ( ListView ) : <EOL> queryset = Photo . objects . on_site ( ) . is_public ( ) <EOL> paginate_by = <NUM_LIT:20> <EOL> class PhotoDetailView ( DetailView ) : <EOL> queryset = Photo . objects . on_site ( ) . is_public ( ) <EOL> class PhotoDateView ( object ) : <EOL> queryset = Photo . objects . on_site ( ) . is_public ( ) <EOL> date_field = '<STR_LIT>' <EOL> allow_empty = True <EOL> class PhotoDateDetailView ( PhotoDateView , DateDetailView ) : <EOL> pass <EOL> class PhotoArchiveIndexView ( PhotoDateView , ArchiveIndexView ) : <EOL> pass <EOL> class PhotoDayArchiveView ( PhotoDateView , DayArchiveView ) : <EOL> pass <EOL> class PhotoMonthArchiveView ( PhotoDateView , MonthArchiveView ) : <EOL> pass <EOL> class PhotoYearArchiveView ( PhotoDateView , YearArchiveView ) : <EOL> make_object_list = True <EOL> class DeprecatedMonthMixin ( object ) : <EOL> """<STR_LIT>""" <EOL> query_string = True <EOL> month_names = { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , } <EOL> def get_redirect_url ( self , * args , ** kwargs ) : <EOL> print ( '<STR_LIT:a>' ) <EOL> warnings . warn ( <EOL> DeprecationWarning ( '<STR_LIT>' <EOL> '<STR_LIT>' ) ) <EOL> class GalleryDateDetailOldView ( DeprecatedMonthMixin , RedirectView ) : <EOL> permanent = True <EOL> def get_redirect_url ( self , * args , ** kwargs ) : <EOL> super ( GalleryDateDetailOldView , self ) . get_redirect_url ( * args , ** kwargs ) <EOL> return reverse ( '<STR_LIT>' , kwargs = { '<STR_LIT>' : kwargs [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : self . month_names [ kwargs [ '<STR_LIT>' ] ] , <EOL> '<STR_LIT>' : kwargs [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : kwargs [ '<STR_LIT>' ] } ) <EOL> class GalleryDayArchiveOldView ( DeprecatedMonthMixin , RedirectView ) : <EOL> permanent = True <EOL> def get_redirect_url ( self , * args , ** kwargs ) : <EOL> super ( GalleryDayArchiveOldView , self ) . get_redirect_url ( * args , ** kwargs ) <EOL> return reverse ( '<STR_LIT>' , kwargs = { '<STR_LIT>' : kwargs [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : self . month_names [ kwargs [ '<STR_LIT>' ] ] , <EOL> '<STR_LIT>' : kwargs [ '<STR_LIT>' ] } ) <EOL> class GalleryMonthArchiveOldView ( DeprecatedMonthMixin , RedirectView ) : <EOL> permanent = True <EOL> def get_redirect_url ( self , * args , ** kwargs ) : <EOL> super ( GalleryMonthArchiveOldView , self ) . get_redirect_url ( * args , ** kwargs ) <EOL> return reverse ( '<STR_LIT>' , kwargs = { '<STR_LIT>' : kwargs [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : self . month_names [ kwargs [ '<STR_LIT>' ] ] } ) <EOL> class PhotoDateDetailOldView ( DeprecatedMonthMixin , RedirectView ) : <EOL> permanent = True <EOL> def get_redirect_url ( self , * args , ** kwargs ) : <EOL> super ( PhotoDateDetailOldView , self ) . get_redirect_url ( * args , ** kwargs ) <EOL> return reverse ( '<STR_LIT>' , kwargs = { '<STR_LIT>' : kwargs [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : self . month_names [ kwargs [ '<STR_LIT>' ] ] , <EOL> '<STR_LIT>' : kwargs [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : kwargs [ '<STR_LIT>' ] } ) <EOL> class PhotoDayArchiveOldView ( DeprecatedMonthMixin , RedirectView ) : <EOL> permanent = True <EOL> def get_redirect_url ( self , * args , ** kwargs ) : <EOL> super ( PhotoDayArchiveOldView , self ) . get_redirect_url ( * args , ** kwargs ) <EOL> return reverse ( '<STR_LIT>' , kwargs = { '<STR_LIT>' : kwargs [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : self . month_names [ kwargs [ '<STR_LIT>' ] ] , <EOL> '<STR_LIT>' : kwargs [ '<STR_LIT>' ] } ) <EOL> class PhotoMonthArchiveOldView ( DeprecatedMonthMixin , RedirectView ) : <EOL> permanent = True <EOL> def get_redirect_url ( self , * args , ** kwargs ) : <EOL> super ( PhotoMonthArchiveOldView , self ) . get_redirect_url ( * args , ** kwargs ) <EOL> return reverse ( '<STR_LIT>' , kwargs = { '<STR_LIT>' : kwargs [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : self . month_names [ kwargs [ '<STR_LIT>' ] ] } ) </s>
