> > - Since the timer is ticking down on the client-side (using a javascript > countdown timer), how will the server know when a promotion has ended so > that it can immediately update the site's html to hide any signs of the > expired promotion? The server will also have to reset to its original price > instead of the promo price and set the promotion_end to None.
The HTML isn't generated once and held statically -- it is generated dynamically on every request. So, whenever a page for a product or products is requested, pull the relevant records from the db, check whether each product has an active promo (i.e., whether promo_end is later than request.now), and generate the output accordingly. If you want an existing page to update its own contents (without a server refresh), you'd have to do that with Javascript, but it sounds like you're already planning to do that. > - In reference to the previous question, if the server needs to keep track > of the time left of a promotion, what happens if an email is to be sent out > 24 hours before the promotion ends? This implies that the server needs to > consistently keep track of all active promotions and their respective end > times. Does web2py have some sort of mechanism (maybe some sort of python > thread?) that will actively keep track of this? > Maybe look into using the scheduler: http://web2py.com/books/default/chapter/29/04#Scheduler-(experimental) Anthony -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.