def get(self, day, mode, **kw): params, data = TinyDict.split(kw) options = TinyDict() options.selected_day = params.selected_day day = time.strptime(day, '%Y-%m-%d') options.year = day[0] options.month = day[1] options.date1 = day options.mode = mode if params.colors: try: options.colors = eval(kw['_terp_colors']) except: pass if params.color_values: options.color_values = ustr(params.color_values).split(',') options.search_domain = params.search_domain or [] options.use_search = params.use_search if params.get('_terp_color_filters'): options.color_filters = params.color_filters params.kalendar = options form = self.create_form(params) return dict( calendar=ustr(form.screen.widget.render()), sidebar=ustr(form.sidebar.render()))
def get(self, day, mode, **kw): params, data = TinyDict.split(kw) options = TinyDict() options.selected_day = params.selected_day day = time.strptime(day, '%Y-%m-%d') options.year = day[0] options.month = day[1] options.date1 = day options.mode = mode if params.colors: try: options.colors = eval(kw['_terp_colors']) except: pass if params.color_values: options.color_values = ustr(params.color_values).split(',') options.search_domain = params.search_domain or [] options.use_search = params.use_search if params.get('_terp_color_filters'): options.color_filters = params.color_filters params.kalendar = options form = self.create_form(params) return dict(calendar=ustr(form.screen.widget.render()), sidebar=ustr(form.sidebar.render()))
def mini(self, year, month, forweek=False): params = TinyDict() params.year = year params.month = month params.forweek = forweek day = tc.utils.Day(params.year, params.month, 1) minical = tc.widgets.MiniCalendar(day, forweek=params.forweek, highlight=False) return minical.render()