Monday, June 9th, 2008...9:56 am
Django GenCal
Having killed the old blog, I’ve decided not to migrate the posts over. That being said, I think there was some solid information in those posts so I’d like to rehash a bit of it. First up: django-gencal.
For those who don’t know, django-gencal is a generic calendaring application. It accepts arbitrary objects for plotting on a calendar. In the checkout, there is a template-tag and a some suggested templates. In the docstring, I’ve also included some suggested CSS to style the template. The expected format for input is:
[{'day':myobj.datetime, 'title':myobj.name, 'class':"optional", 'url':myobj.get_absolute_url()},
{'day':myobj.datetime, 'title':myobj2.name, 'class':"optional", 'url':myobj2.get_absolute_url()}]
I’ll be generating an example in the coming weeks so you can see this in action. Perhaps even a screencast as I just recently purchased iShowU.
2 Comments
June 15th, 2008 at 5:04 pm
Hi, I’ve been trying to set-up gencal as templatetag but it’s not easy. The only problem I have as of now is that no items show up in the calendar, since I don’t know how/where to pass in the arguments. Django’s documentation doesn’t have examples, and I’m still learning my way, so any help would be appreciated.
This is how it is set-up now, but obviously not the correct way..
http://dpaste.com/56764/
June 15th, 2008 at 5:27 pm
I’ve solved it thanks to:
http://www.b-list.org/weblog/2006/jun/07/django-tips-write-better-template-tags/
if anyone has the same problem:
{% gencal date cal_items %}
Leave a Reply