(Django) The best solution for event calendar

回眸只為那壹抹淺笑 提交于 2019-12-22 10:45:57

问题


I need to add event calendar functionality to my application, and I'm wondering what do you think is the best way to do it ? Are there any interesting projects providing the needed functionality ? A snippet : http://djangosnippets.org/snippets/129/ ? Write it on my own ?


回答1:


Without knowing the level of complexity you need, I always suggest quick and easy first. Once minimum requirements are established you can confidently migrate.

Django Flatpages can take you a long way with very little effort.




回答2:


If you're looking to go all the way, setting up a DAViCal server with some kind of python bindings would give you a very flexible application. The integration with Django looks like it would have to be built from scratch, but all the heavy lifting is done in DAViCal and the python bindings.

DAViCal would allow you to access the calendar from several different applications, making your solution much more robust.




回答3:


If you're willing to build your own, I found Python's Calendar module to be great. I used calendar.monthcalendar() to build a table-layout calendar. The module has many useful functions in it and recommend checking it out if you haven't already.

Here's more info on calendar.monthcalendar(year, month):

Returns a matrix representing a month’s calendar. Each row represents a week; days outside of the month a represented by zeros. Each week begins with Monday unless set by setfirstweekday().

If you want your calendar to start on Sunday as opposed to the Monday default, just:

calendar.setfirstweekday(6)


来源:https://stackoverflow.com/questions/3224120/django-the-best-solution-for-event-calendar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!