def get_queryset(self):
        period = self._get_period()
        if '-' in period:
            year, month = map(int, period.split('-'))
        else:
            year = int(period)
            month = 12
        last_day = calendar.monthrange(year, month)[1]
        return super(ResourceViewSet, self).get_queryset().filter(created__lte=datetime.date(year, month, last_day))
dataset/ETHPy150Open opennode/nodeconductor/nodeconductor/iaas/views.py/ResourceViewSet.get_queryset/original