<s> from django . views . generic . list_detail import object_list , object_detail <EOL> from django . conf import settings <EOL> from django . shortcuts import get_object_or_404 <EOL> from django . views . decorators . http import require_http_methods <EOL> from lifestream . models import * <EOL> DEFAULT_PAGINATION = getattr ( settings , '<STR_LIT>' , <NUM_LIT:20> ) <EOL> @ require_http_methods ( [ '<STR_LIT:GET>' , '<STR_LIT>' ] ) <EOL> def main_page ( request , lifestream_slug ) : <EOL> lifestream = get_object_or_404 ( Lifestream , slug = lifestream_slug ) <EOL> return object_list ( request , <EOL> queryset = Item . objects . published_items ( lifestream ) , <EOL> paginate_by = DEFAULT_PAGINATION , <EOL> extra_context = { <EOL> '<STR_LIT>' : lifestream , <EOL> } , <EOL> ) <EOL> @ require_http_methods ( [ '<STR_LIT:GET>' , '<STR_LIT>' , '<STR_LIT:POST>' ] ) <EOL> def item_page ( request , lifestream_slug , item_id ) : <EOL> lifestream = get_object_or_404 ( Lifestream , slug = lifestream_slug ) <EOL> return object_detail ( <EOL> request , <EOL> queryset = Item . objects . published_items ( lifestream ) , <EOL> object_id = item_id , <EOL> extra_context = { <EOL> '<STR_LIT>' : lifestream , <EOL> } , <EOL> ) <EOL> @ require_http_methods ( [ '<STR_LIT:GET>' , '<STR_LIT>' ] ) <EOL> def domain_page ( request , lifestream_slug , domain ) : <EOL> lifestream = get_object_or_404 ( Lifestream , slug = lifestream_slug ) <EOL> return object_list ( <EOL> request , <EOL> queryset = Item . objects . published_items ( lifestream ) . filter ( feed__domain = domain ) , <EOL> paginate_by = DEFAULT_PAGINATION , <EOL> extra_context = { <EOL> '<STR_LIT>' : lifestream , <EOL> } , <EOL> ) </s>
