|
|
@@ -11,7 +11,7 @@ from .forms import * |
|
|
|
# Database access imports |
|
|
|
from .models import * |
|
|
|
from .helpers import Orga_helpers |
|
|
|
from sqlalchemy import func, or_, text |
|
|
|
from sqlalchemy import func, or_, text, and_ |
|
|
|
from os import path, makedirs, listdir |
|
|
|
# Usefull tools |
|
|
|
from slugify import slugify |
|
|
@@ -43,6 +43,18 @@ def embeed_video(mime_type, link): |
|
|
|
return Container |
|
|
|
|
|
|
|
|
|
|
|
@view_config(route_name='Live', renderer="jm2l:templates/Live.mako") |
|
|
|
def Live(request): |
|
|
|
year = int(request.matchdict.get('year', CurrentYear)) |
|
|
|
tz = timezone('Europe/Paris') |
|
|
|
curtime = datetime.datetime.now().replace(tzinfo=tz, day=28) #, hour=10, minute=00 ) |
|
|
|
Events = DBSession.query(Event)\ |
|
|
|
.filter(Event.for_year == year)\ |
|
|
|
.filter(Event.event_type != 'Stand')\ |
|
|
|
.filter(and_(Event.start_time <= curtime, Event.end_time >= curtime) )\ |
|
|
|
.order_by(Event.start_time) |
|
|
|
return {'year': year, "DisplayYear": year, 'events':Events, "logged_in":request.authenticated_userid } |
|
|
|
|
|
|
|
## =-=- Here, We handle ICal requests -=-= |
|
|
|
@view_config(route_name='progr_iCal', renderer="string") |
|
|
|
def ICal_Progamme_Request(request): |
|
|
|