%! import DateTime import datetime from datetime import date import time sx1=time.time() %> <%namespace file="/functions/partials" name="partials" import="*"/> <%inherit file="site" /> <%def name="main_content()"> <% now = DateTime.DateTime() request = object.REQUEST filterquery = site.REQUEST['QUERY_STRING'] test = '' count=0 items = [] active_items = [] passed_items = [] if filterquery: hasrequest = 1 else: hasrequest = 0 path = '/customer/www/imr' basepath = '/customer/www' objpath = object.url(localized=False) path = basepath + objpath templates = ['project'] param_type = '' param_type = site.param('type', default='', type="js") today = date.today() _today = DateTime.DateTime(datetime.datetime(today.year, today.month, today.day, 0, 0)) _tomorrow = DateTime.DateTime(datetime.datetime(today.year, today.month, today.day, 0, 0))+1 _yesterday = DateTime.DateTime(datetime.datetime(today.year, today.month, today.day, 0, 0))-1 if False: #soek querystring = { 'template':templates, 'path': path } if param_type == 'passed': querystring['end'] = {'query':_yesterday, 'range':'max'} querystring['sort_order'] = 'descending' querystring['sort_on'] = 'start' else: querystring['end'] = {'query':_today, 'range':'min'} querystring['sort_order'] = 'ascending' querystring['sort_on'] = 'start' items = site.find( { 'query':querystring } ) # listing separate passed items _items = object.list() for e in _items: if e.val('end-time'): end_d = DateTime.DateTime(e.val('end-time')) if end_d <= _today: passed_items.append( e ) #if len(_items) > 100: # break else: active_items.append( e ) else: active_items.append( e ) if param_type == 'passed': items = passed_items else: items = active_items # url extension when paginating padd = '' if param_type: padd += '&type;=' + param_type # pagination limit = 30 start = int(site.param('start','0')) _list = [] lenlist = len(items) _list = items[start:start+limit] i18n = object.LimeAPI.i18n %>
Ingen treff
% endif