Skip to main content

A calendar library for creating HTML calendars that contain query objects

Project description

calendar-plus

Calendar-plus is a simple library for creating HTML Calendar that includes query objects.

This is an example of what the library allows you to do.

Calendar Image

Installation

pip install calendar-plus

How to use

So you have a class for an event object that looks something like below. This example is based on Django framework.

class Event(models.Model):
    name = models.CharField()
    time = model.TimeField()
    date = models.DateField()

The query is events = Event.objects.filter(date__year=year, date__month=month)

Using the library

from calendarplus import ModelCalendar

calendar = ModelCalendar(year=month, month=month).formatmonth(events)

context['calendar'] = calendar

return context

You can now use the context_object_name in your template. This library requires bootstrap framework to render beautifully. You can override the formatmonth to use your own css class.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for calendar-plus, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size calendar_plus-0.0.1-py3-none-any.whl (3.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size calendar-plus-0.0.1.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page