On 14-7-2012 14:01, dobrysmak wrote:

> def close_coupon(self):
> current_date = datetime.datetime.now() today = 
> datetime.datetime.combine(datetime.date.today(), datetime.time(19,30))
> .
>   .
> end_date = current_date

This function is stripped down I suppose, because it does nothing useful:
- it changes a few local variables (not values of the model)
- today is unused
- end_date is set to current_date which seems odd.

My guess is that you want the end_date set to half past seven of the
current_date:

def close_coupon(self) :
        from django.utils import timezone
        current_date = timezone.now()
        end_date = current_date.replace(hour=19, minutes=30)
        self.current_date = current_date
        self.end_date = end_date

-- 
Melvyn Sopacua

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to