<s> from django . core . urlresolvers import reverse <EOL> from django . http import HttpResponseRedirect <EOL> from django . shortcuts import render_to_response <EOL> from django . template import RequestContext <EOL> from django . views . generic import DateDetailView , DetailView , ListView <EOL> from django_comments_xtd . models import XtdComment <EOL> from multiple . blog . models import Story , Quote <EOL> def homepage ( request ) : <EOL> stories = Story . objects . published ( ) [ : <NUM_LIT:1> ] <EOL> quotes = Quote . objects . published ( ) [ : <NUM_LIT:5> ] <EOL> return render_to_response ( "<STR_LIT>" , <EOL> { "<STR_LIT>" : stories , "<STR_LIT>" : quotes } , <EOL> context_instance = RequestContext ( request ) ) <EOL> class StoryDetailView ( DateDetailView ) : <EOL> model = Story <EOL> date_field = "<STR_LIT>" <EOL> month_format = "<STR_LIT>" <EOL> def get_context_data ( self , ** kwargs ) : <EOL> context = super ( StoryDetailView , self ) . get_context_data ( ** kwargs ) <EOL> context . update ( { '<STR_LIT>' : reverse ( '<STR_LIT>' ) } ) <EOL> return context <EOL> class QuoteDetailView ( DetailView ) : <EOL> model = Quote <EOL> slug_field = "<STR_LIT>" <EOL> def get_context_data ( self , ** kwargs ) : <EOL> context = super ( QuoteDetailView , self ) . get_context_data ( ** kwargs ) <EOL> context . update ( { '<STR_LIT>' : reverse ( '<STR_LIT>' ) } ) <EOL> return context <EOL> class CommentsView ( ListView ) : <EOL> template_name = "<STR_LIT>" <EOL> paginate_by = <NUM_LIT:5> <EOL> def get_queryset ( self ) : <EOL> return XtdComment . objects . for_app_models ( "<STR_LIT>" , "<STR_LIT>" ) </s>
