コード例 #1
0
ファイル: views.py プロジェクト: djangozoom/merengue_plugins
def events_calendar(request):
    mimetype = "application/json"
    if (request.GET and 'month' in request.GET
        and 'year' in request.GET):
        month = int(request.GET['month'])
        year = int(request.GET['year'])
        events = get_events(request)
        events_dic = getEventsMonthYear(month, year, events)
        return HttpResponse(dumps(events_dic), mimetype=mimetype)
    return HttpResponseBadRequest(mimetype=mimetype)
コード例 #2
0
ファイル: blocks.py プロジェクト: djangozoom/merengue_plugins
 def render(self, request, place, context, *args, **kwargs):
     current_month = date.today().month
     current_year = date.today().year
     events = self.get_queryset(request, context)
     events_dic = getEventsMonthYear(current_month, current_year, events)
     return self.render_block(
         request,
         template_name="event/block_calendar.html",
         block_title=_("Events calendar"),
         context={"events_dic": events_dic},
     )
コード例 #3
0
ファイル: blocks.py プロジェクト: creativify/merengueproj
 def render(self, request, place, context, *args, **kwargs):
     current_month = date.today().month
     current_year = date.today().year
     events = self.get_queryset(request, context)
     events_dic = getEventsMonthYear(current_month, current_year, events, True)
     section_id = 0
     section = self._get_section(request, context)
     if section and self.get_config().get('filtering_section', False).get_value():
         section_id = section.id
     return self.render_block(request,
                              template_name='event/block_calendar.html',
                              block_title=_('Events calendar'),
                              context={'events_dic': events_dic,
                                       'section_id': section_id})
コード例 #4
0
ファイル: views.py プロジェクト: creativify/merengueproj
def events_calendar(request):
    mimetype = "application/json"
    if request.GET and "month" in request.GET and "year" in request.GET:
        month = int(request.GET["month"])
        year = int(request.GET["year"])
        section_id = int(request.GET.get("section_id", None))
        if not section_id:
            events = get_events(request)
        else:
            collection = get_collection_event()
            events = collection.get_items(BaseSection.objects.get(id=section_id), True)
        events_dic = getEventsMonthYear(month, year, events, True)
        return HttpResponse(dumps(events_dic), mimetype=mimetype)
    return HttpResponseBadRequest(mimetype=mimetype)
コード例 #5
0
ファイル: views.py プロジェクト: teury/merengueproj
def events_calendar(request):
    mimetype = "application/json"
    if (request.GET and 'month' in request.GET and 'year' in request.GET):
        month = int(request.GET['month'])
        year = int(request.GET['year'])
        section_id = int(request.GET.get('section_id', None))
        if not section_id:
            events = get_events(request)
        else:
            collection = get_collection_event()
            events = collection.get_items(
                BaseSection.objects.get(id=section_id), True)
        events_dic = getEventsMonthYear(month, year, events, True)
        return HttpResponse(dumps(events_dic), mimetype=mimetype)
    return HttpResponseBadRequest(mimetype=mimetype)
コード例 #6
0
 def render(self, request, place, context, *args, **kwargs):
     current_month = date.today().month
     current_year = date.today().year
     events = self.get_queryset(request, context)
     events_dic = getEventsMonthYear(current_month, current_year, events,
                                     True)
     section_id = 0
     section = self._get_section(request, context)
     if section and self.get_config().get('filtering_section',
                                          False).get_value():
         section_id = section.id
     return self.render_block(request,
                              template_name='event/block_calendar.html',
                              block_title=_('Events calendar'),
                              context={
                                  'events_dic': events_dic,
                                  'section_id': section_id
                              })