comparison libervia/pages/calendar/page_meta.py @ 1509:106bae41f5c8

massive refactoring from camelCase -> snake_case. See backend commit log for more details
author Goffi <goffi@goffi.org>
date Sat, 08 Apr 2023 13:44:11 +0200
parents ec3ad9abf9f9
children
comparison
equal deleted inserted replaced
1508:ec3ad9abf9f9 1509:106bae41f5c8
18 access = C.PAGES_ACCESS_PROFILE 18 access = C.PAGES_ACCESS_PROFILE
19 template = "calendar/daily.html" 19 template = "calendar/daily.html"
20 20
21 21
22 async def prepare_render(self, request): 22 async def prepare_render(self, request):
23 profile = self.getProfile(request) 23 profile = self.get_profile(request)
24 template_data = request.template_data 24 template_data = request.template_data
25 # template_data["url_event_new"] = self.getSubPageURL(request, "event_new") 25 # template_data["url_event_new"] = self.get_sub_page_url(request, "event_new")
26 if profile is not None: 26 if profile is not None:
27 try: 27 try:
28 events = data_format.deserialise( 28 events = data_format.deserialise(
29 await self.host.bridgeCall("eventsGet", "", "", [], "", profile), 29 await self.host.bridge_call("events_get", "", "", [], "", profile),
30 type_check=list 30 type_check=list
31 ) 31 )
32 except Exception as e: 32 except Exception as e:
33 log.warning(_("Can't get events list for {profile}: {reason}").format( 33 log.warning(_("Can't get events list for {profile}: {reason}").format(
34 profile=profile, reason=e)) 34 profile=profile, reason=e))
42 today_local, datetime.time.min, tzinfo=local_tz 42 today_local, datetime.time.min, tzinfo=local_tz
43 ).timestamp() 43 ).timestamp()
44 calendar_end = template_data["calendar_end"] = datetime.datetime.combine( 44 calendar_end = template_data["calendar_end"] = datetime.datetime.combine(
45 today_local, datetime.time.max, tzinfo=local_tz 45 today_local, datetime.time.max, tzinfo=local_tz
46 ).timestamp() 46 ).timestamp()
47 self.exposeToScripts( 47 self.expose_to_scripts(
48 request, 48 request,
49 calendar_start=calendar_start, 49 calendar_start=calendar_start,
50 calendar_end=calendar_end, 50 calendar_end=calendar_end,
51 tz_name=tz_name, 51 tz_name=tz_name,
52 ) 52 )