예제 #1
0
파일: views.py 프로젝트: wrabbit/skibi
def delEvent(request):
    """delete event from calendar"""
    user = request.user
    default = dict(month=1, year=1, day=1, rowid=1, name="", desc="", when="")
    p = getParams(request, default)
    year, month, day = p['year'], p['month'], p['day']

    # create calendar obj
    cal = CalendarController(user, day)
    cal.load(year, month)

    # delete Event
    cal.delEvent(day, p['rowid'])

    # show view with new result
    return redirect2view(request.path, year, month, day)
예제 #2
0
파일: views.py 프로젝트: wrabbit/skibi
def view(request,header):
    """Calendar view"""
    user = request.user
    date = datetime.datetime.now()
    default = dict(month=date.month, year=date.year, day=1, rowid=1,
            name="", desc="", when="")
    url = request.path

    p = getParams(request, default)
    year, month, day = p['year'], p['month'], p['day']

    # create calendar obj
    cal = CalendarController(user, day)
    cal.load(year, month)
    
    return render_to_response('calendar.html',dict(username=user.get_full_name(), cal=cal, url=url,header=header),context_instance=RequestContext(request))
예제 #3
0
파일: views.py 프로젝트: gdit/GD-Homepage
def view(request):
    """Calendar view"""
    #user = request.user
    user = '******'
    date = datetime.datetime.now()
    default = dict(month=date.month, year=date.year, day=1, rowid=1,
            name="", desc="", when="")
    url = request.path

    p = getParams(request, default)
    year, month, day = p['year'], p['month'], p['day']

    # create calendar obj
    cal = CalendarController(user, day)
    cal.load(year, month)

    # template
    #t = get_template('cal/calendar.html')
    return Context(dict(username=user, cal=cal, url=url))
예제 #4
0
파일: views.py 프로젝트: wrabbit/skibi
def updEvent(request):
    """update selected event to calendar"""
    user = request.user
    default = dict(month=1, year=1, day=1, rowid=1, name="", desc="", when="")
    p = getParams(request, default)
    year, month, day = p['year'], p['month'], p['day']

    # create calendar obj
    cal = CalendarController(user, day)
    cal.load(year, month)

    # parpare data for adding Event
    whenDate = datetime.date(year, month, day)
    whenTime = datetime.time(*map(int, p['when'].strip().split(':')))
    when = datetime.datetime.combine(whenDate, whenTime)

    # update Event
    cal.updEvent(day, p['rowid'], p['name'], when, p['desc'])

    # show view with new result
    return redirect2view(request.path, year, month, day)
예제 #5
0
def view(request):
    """Calendar view"""
    user = request.user
    date = datetime.datetime.now()
    default = dict(month=date.month, year=date.year, day=1, rowid=1,
            name="", desc="", when="")
    url = request.path

    p = getParams(request, default)
    year, month, day = p['year'], p['month'], p['day']

    # create calendar obj
    cal = CalendarController(user, day)
    cal.load(year, month)

    # template
    t = get_template('cal/calendar.html')
    c = Context(dict(username=user, cal=cal, url=url))
    html = t.render(c)

    return HttpResponse(html)
예제 #6
0
def delEvent(request):
    """delete event from calendar"""
    user = request.user
    default = dict(month=1, year=1, day=1, rowid=1, name="", desc="", when="")
    p = getParams(request, default)
    year, month, day = p['year'], p['month'], p['day']

    # create calendar obj
    cal = CalendarController(user, day)
    cal.load(year, month)

    # delete Event
    cal.delEvent(day, p['rowid'])

    # show view with new result
    return redirect2view(request.path, year, month, day)
예제 #7
0
def updEvent(request):
    """update selected event to calendar"""
    user = request.user
    default = dict(month=1, year=1, day=1, rowid=1, name="", desc="", when="")
    p = getParams(request, default)
    year, month, day = p['year'], p['month'], p['day']

    # create calendar obj
    cal = CalendarController(user, day)
    cal.load(year, month)

    # parpare data for adding Event
    whenDate = datetime.date(year, month, day)
    whenTime = datetime.time(*map(int, p['when'].strip().split(':')))
    when = datetime.datetime.combine(whenDate, whenTime)

    # update Event
    cal.updEvent(day, p['rowid'], p['name'], when, p['desc'])

    # show view with new result
    return redirect2view(request.path, year, month, day)