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 can understand it historically. In the beginning it returned T/F. It was suggested to raise the exception because this way it simplified the rest of calls.  So it was changed. 
The calls wasn't changed and they still were waiting for a Boolean. 
After that, change function name, two returns and true in case of success. 
I will change it as suggested: check_date and exception. 
Anyway, I'm enjoying the whole process. :)
--
Alejandro Garcia
Software Engineer at RedBeacon.com

> On 10/10/2014, at 23:16, Daniel Gonzalez Gasull <notifications@github.com> wrote:
> 
> In okapiweb/management/commands/summarize.py:
> 
> > +        make_option('--nodelete',
> > +                    action='store_true',
> > +                    dest='nodelete',
> > +                    default=False,
> > +                    help='Preserve processed data'),
> > +    )
> > +
> > +    def check_date(self, processed_date="", format_string=DEFAULT_DATE_FORMAT):
> > +        """Helper to check if a date is valid"""
> > +
> > +        output = True
> > +        try:
> > +            datetime.strptime(processed_date, format_string)
> > +        except ValueError:
> > +            output = False
> > +        return output
> I agree with Husseyin on this. Sorry Alejandro for going back and forth with this. It doesn't make much sense to return True and then raise an exception instead of False. Either is_valid_date/True/False or check_date/None/exception, but not combined.
> …
> —
> Reply to this email directly or view it on GitHub.