def render(self, context, instance, placeholder):
context = super(StatsGraphPlugin,self).render(context,instance,placeholder)<EOL>limitMonthDates = {}<EOL>for m in range(<NUM_LIT:0>,<NUM_LIT>):<EOL><INDENT>limitMonthDates[m] = (timezone.now() - relativedelta(months=m)).strftime('<STR_LIT>')<EOL><DEDENT>recentYears = [timezone.now().year + x for x in range(-<NUM_LIT:5>,<NUM_LIT:1>)]<EOL>series_by_year = Series.objects.order_by('<STR_LIT>')<EOL>if series_by_year.count() > <NUM_LIT:0>:<EOL><INDENT>first_year = series_by_year.first().year<EOL>allYears = [x for x in range(first_year,timezone.now().year + <NUM_LIT:1>)]<EOL><DEDENT>else:<EOL><INDENT>allYears = []<EOL><DEDENT>context.update({<EOL>'<STR_LIT>': limitMonthDates,<EOL>'<STR_LIT>': recentYears,<EOL>'<STR_LIT>': allYears,<EOL>})<EOL>return context<EOL>
Allows this plugin to use templates designed for a list of locations.