Paste number 30300: A snippet of code to demonstrate how it works

Paste number 30300: A snippet of code to demonstrate how it works
Pasted by: ignas
When:15 years, 1 week ago
Share:Tweet this! | http://paste.lisp.org/+NDO
Channel:#schooltool
Paste contents:
Raw Source | XML | Display As
class CalendarEventView(BrowserView):
    """View for single events."""

    # XXX what are these used for?
    color1 = '#9db8d2'
    color2 = '#7590ae'

    def __init__(self, context, request):
        self.context = context
        self.request = request

        self.preferences = ViewPreferences(request)

        self.dtstart = context.dtstart.astimezone(self.preferences.timezone)
        self.dtend = self.dtstart + context.duration
        self.start = self.dtstart.strftime(self.preferences.timeformat)
        self.end = self.dtend.strftime(self.preferences.timeformat)

        dayformat = '%A, ' + self.preferences.dateformat
        self.day = unicode(self.dtstart.strftime(dayformat))

        self.display = EventForDisplay(context, self.request,
                                       self.color1, self.color2,
                                       context.__parent__,
                                       timezone=self.preferences.timezone)

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.