I did this as a "half-open" style of list. That means that the startdate is the starting date, and the enddate is the first date for which it is no longer valid. Easy enough to just add a day to the enddate to make it work like you want, I think. I'm open to change it, but it makes sense to me as-is. Anyone else care to speak up?
On Fri, Aug 14, 2009 at 2:33 PM, Pranav <[email protected]> wrote: > > I have defined a discount on a product. And apparaently, the > strikethorough for the actual amount was not appearing in the browser. > > Digging through the code, i found that the strikethrough is only > printed if 'sale' is a valid object. 'sale' was not getting computed > because of the following code in the find_auto_discounts method in the > product.utils module: > > discs = Discount.objects.filter(automatic=True, active=True, > startDate__lte=today, endDate__gt=today) > > I believe instead of the above, it should be: > > discs = Discount.objects.filter(automatic=True, active=True, > startDate__lte=today, endDate__gte=today) > > (note the difference in gt=today and gte=today) > > thanks, > -p > > > -- Bruce Kroeze http://solidsitesolutions.com Dynamic Designs, Optimized --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Satchmo users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en -~----------~----~----~----~------~----~------~--~---
