Summarize data

Please, check my code!
I forgot to include some kind of readme.st. To test custom command:
python manage.py summarize [date YYYY-MM-DD] [--nodeletion]
If you pass no parameters it summarizes current date minus 15 days (single day and no a 15-days period)
You don't have an straight way of getting weeks and quarters. I've supposed
that okapi's way of formatting dates (strftime) was the favorite for the
team so I've mixed them.
It's more readable to write it in a single way.

On Mon, Oct 6, 2014 at 8:59 PM, Lorenzo Gil Sanchez <
notifications@github.com> wrote:

> In okapiweb/management/commands/summarize.py:
>
> > +        Given dates summarize them into the proper collection
> > +        :param start_date: date to summarize
> > +
> > +        """
> > +
> > +        start_date = datetime.strptime(start_date, self.DEFAULT_DATE_FORMAT)
> > +        year = start_date.year
> > +        quarter = format(self.quarters[start_date.month], '02')
> > +        week = format(start_date.isocalendar()[self.WEEK], '02')
> > +        bucketed_date = start_date.strftime('%Y-%m-%d-day')
> > +        time_bucket = [
> > +            bucketed_date,
> > +            "{}-{}-week".format(year, week),
> > +            start_date.strftime('%Y-%m-month'),
> > +            "{}-{}-quarter".format(year, quarter),
> > +            start_date.strftime('%Y-year'),
>
> Why are you mixing two different ways to format dates?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/redbeacon/okapi-web/pull/23/files#r18477398>.
>



-- 
Alejandro Garcia
Software Engineer at RedBeacon.com