Justin Lilly
Hey Marco,
Glad you got it working. I'm actually improving gencal's documentation this week as it /is/ a bit hard to follow. Hopefully it all worked itself out. Thanks so much for trying it out!
J-Chris
Hi Marco,
Could you provide me a snippet code showing how you are using the gencal module. It would save me some times :)
Thks
Marco
Hi J-Chris,
The current version of gencal is probably a bit different than the one I tested, but anyway..
View:
from django.shortcuts import render_to_response, get_object_or_404
import datetime
def index(request,year,month):
cal_items = [{ 'day':datetime.datetime(2008,6,30), 'title':"Concert at Huckelberries", 'class':"concert", 'url':'/foo/2' },
{ 'day':datetime.datetime(2008,6,4), 'title':"BBQ at Mom\'s house", 'class':"restaurant", 'url':'/restaurants/9' }]
return render_to_response('project/index.html', { 'month': month,
'year': year,
'cal_items' : cal_items })
In the template all you need is this:
{% load gencal %}
{% gencal cal_items %}
Leave a reply