#NEWLINE# def get_context_data( self , **kwargs ) : #NEWLINE# #INDENT# context = super ( TagHomePageView , self ) . get_context_data ( ** kwargs ) #NEWLINE# tag_instance = get_object_or_404 ( Tag , name__iexact = context . get ( 'tagname' ) ) #NEWLINE# context [ 'tag' ] = tag = tag_instance . name #NEWLINE# tweets = [ TimeLineItem ( item , item . sent , item . sender , 'timeline/_tweet.html' ) for item in TaggedItem . objects . get_by_model ( Tweet , tag ) . order_by ( '-sent' ) [ : 16 ] ] #NEWLINE# context [ 'latest_blogs' ] = TaggedItem . objects . get_by_model ( Post , tag ) . filter ( status = 2 ) . order_by ( '-publish' ) [ : 10 ] #NEWLINE# posts = [ TimeLineItem ( item , item . publish , item . author , 'timeline/_post.html' ) for item in context [ 'latest_blogs' ] ] #NEWLINE# image_filter = Q ( is_public = True ) #NEWLINE# if self . request . user . is_authenticated ( ) : #NEWLINE# #INDENT# image_filter = ( ( image_filter | Q ( member = self . request . user ) ) | Q ( member__in = friend_set_for ( self . request . user ) ) ) #NEWLINE# #UNINDENT# context [ 'latest_photos' ] = TaggedItem . objects . get_by_model ( Image , tag ) . filter ( image_filter ) . order_by ( '-date_added' ) [ : 16 ] #NEWLINE# images = [ TimeLineItem ( item , item . date_added , item . member , 'timeline/_photo.html' ) for item in context [ 'latest_photos' ] ] #NEWLINE# context [ 'latest_tracks' ] = TaggedItem . objects . get_by_model ( Track , tag ) . order_by ( '-created_at' ) #NEWLINE# tracks = [ TimeLineItem ( item , item . updated_at , items . user , 'timeline/_track.html' ) for item in context [ 'latest_tracks' ] ] #NEWLINE# comments = [ TimeLineItem ( item , item . date_submitted , item . user , 'timeline/_comment.html' ) for item in TaggedItem . objects . get_by_model ( ThreadedComment , tag ) . order_by ( '-date_submitted' ) ] #NEWLINE# items = merge ( tweets , images , posts , tracks , comments , field = 'date' ) [ : 16 ] #NEWLINE# for ( index , item ) in enumerate ( items ) : #NEWLINE# #INDENT# item . index = ( index + 1 ) #NEWLINE# #UNINDENT# context [ 'timelineitems' ] = group_comments ( items ) #NEWLINE# context [ 'prefix_sender' ] = True #NEWLINE# return context