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)
It's the first time I see this code but not this kind of writing. I think that what Gobind wanted to do is to run some code in the last iteration. I prefer to take it out of the for loop. In what concerns to blank spaces I agree.