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)
Good. It could act as some kind of assert, isn't it?

On Sat, Oct 4, 2014 at 1:31 AM, Fidel Ramos <notifications@github.com>
wrote:

> In okapiweb/management/commands/summarize.py:
>
> > +            output = False
> > +        return output
> > +
> > +    def handle(self, *args, **options):
> > +        if not args:
> > +            """Summarize 15 days before"""
> > +            start_date = date.today() - timedelta(days=15)
> > +            print "Trying to summarize day", start_date
> > +            self.summarize(start_date, options['nodelete'])
> > +        else:
> > +            if len(args) == 1:
> > +                if self.check_date(args[0]):
> > +                    print "Trying to summarize day", args[0]
> > +                    self.summarize(args[0], options['nodelete'])
> > +                else:
> > +                    print "Date should have the right format YYYY-MM-DD"
>
> I would do this inside the except in the check_date method. That way you
> can drop this else altogether.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/redbeacon/okapi-web/pull/23/files#r18424805>.
>



-- 
Alejandro Garcia
Software Engineer at RedBeacon.com