#NEWLINE# @ json_view #NEWLINE# @ non_atomic_requests #NEWLINE# def site_events( request , start , end ) : #NEWLINE# #INDENT# 'Return site events in the given timeframe.' #NEWLINE# ( start , end ) = get_daterange_or_404 ( start , end ) #NEWLINE# qs = SiteEvent . objects . filter ( ( Q ( start__gte = start , start__lte = end ) | Q ( end__gte = start , end__lte = end ) ) ) #NEWLINE# events = list ( site_event_format ( request , qs ) ) #NEWLINE# type_pretty = unicode ( amo . SITE_EVENT_CHOICES [ amo . SITE_EVENT_RELEASE ] ) #NEWLINE# releases = product_details . firefox_history_major_releases #NEWLINE# for ( version , date_ ) in releases . items ( ) : #NEWLINE# #INDENT# events . append ( { #NEWLINE# #INDENT# 'start' : date_ , #NEWLINE# 'type_pretty' : type_pretty , #NEWLINE# 'type' : amo . SITE_EVENT_RELEASE , #NEWLINE# 'description' : ( 'Firefox %s released' % request ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return events