#NEWLINE# @ register . tag ( name = 'resource_calendar_events' ) #NEWLINE# def resource_calendar_events( parser , token ) : #NEWLINE# #INDENT# "\n    {% resource_calendar_events 'id' 'start_date' 'end_date' as events %}\n    return events for current user\n    dates must in format as yyyy-mm-dd\n    " #NEWLINE# bits = token . split_contents ( ) #NEWLINE# if ( 6 != len ( bits ) ) : #NEWLINE# #INDENT# raise TemplateSyntaxError ( ( '%r expects 5 arguments' % bits [ 0 ] ) ) #NEWLINE# #UNINDENT# if ( bits [ ( - 2 ) ] != 'as' ) : #NEWLINE# #INDENT# raise TemplateSyntaxError ( ( '%r expects "as" as the third argument' % bits [ 0 ] ) ) #NEWLINE# #UNINDENT# cal_date = bits [ ( - 4 ) ] #NEWLINE# limit = bits [ ( - 3 ) ] #NEWLINE# varname = bits [ ( - 1 ) ] #NEWLINE# cal_id = int ( bits [ 1 ] [ 1 : ( - 1 ) ] ) #NEWLINE# return resource_calendar_events_node ( cal_id , cal_date , cal_id , varname )