def get_queryset(self):
qs = super(BaseCalendarMonthView, self).get_queryset()<EOL>year = self.get_year()<EOL>month = self.get_month()<EOL>date_field = self.get_date_field()<EOL>end_date_field = self.get_end_date_field()<EOL>date = _date_from_string(year, self.get_year_format(),<EOL>month, self.get_month_format())<EOL>since = date<EOL>until = self.get_next_month(date)<EOL>if since.weekday() != self.get_first_of_week():<EOL><INDENT>diff = math.fabs(since.weekday() - self.get_first_of_week())<EOL>since = since - datetime.timedelta(days=diff)<EOL><DEDENT>if until.weekday() != ((self.get_first_of_week() + <NUM_LIT:6>) % <NUM_LIT:7>):<EOL><INDENT>diff = math.fabs(((self.get_first_of_week() + <NUM_LIT:6>) % <NUM_LIT:7>) - until.weekday())<EOL>until = until + datetime.timedelta(days=diff)<EOL><DEDENT>if end_date_field:<EOL><INDENT>predicate1 = Q(**{<EOL>'<STR_LIT>' % date_field: since,<EOL>end_date_field: None<EOL>})<EOL>predicate2 = Q(**{<EOL>'<STR_LIT>' % date_field: since,<EOL>'<STR_LIT>' % end_date_field: until<EOL>})<EOL>predicate3 = Q(**{<EOL>'<STR_LIT>' % date_field: since,<EOL>'<STR_LIT>' % end_date_field: since,<EOL>'<STR_LIT>' % end_date_field: until<EOL>})<EOL>predicate4 = Q(**{<EOL>'<STR_LIT>' % date_field: since,<EOL>'<STR_LIT>' % date_field: until,<EOL>'<STR_LIT>' % end_date_field: until<EOL>})<EOL>predicate5 = Q(**{<EOL>'<STR_LIT>' % date_field: since,<EOL>'<STR_LIT>' % end_date_field: until<EOL>})<EOL>return qs.filter(predicate1 | predicate2 | predicate3 | predicate4 | predicate5)<EOL><DEDENT>return qs.filter(**{<EOL>'<STR_LIT>' % date_field: since<EOL>})<EOL>
Returns a queryset of models for the month requested