Esempio n. 1
0
def date_with_offset(value, arg):
    # Usage of date format
    # "%d %B %Y" = 12 january 2007
    # %d %B %Y, %H:%M
    try:
        timeoffset = get_request().user.timeoffset
        if not timeoffset:
            timeoffset = 0
    except:
        timeoffset = 0

    if not value:
        return u''
    if arg is None:
        arg = settings.DATE_FORMAT
    return pytils.dt.ru_strftime(arg, inflected=True, date=value+datetime.timedelta(seconds=timeoffset))
Esempio n. 2
0
def solutions():
    session = get_request().session
    if not 'captcha_solutions' in session:
        session['captcha_solutions'] = {}
    return session['captcha_solutions']
Esempio n. 3
0
def solutions():
    session = get_request().session
    if not 'captcha_solutions' in session:
        session['captcha_solutions'] = {}
    return session['captcha_solutions']