def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) queryset = self.get_queryset() view_models_set = [RatingViewModel(r) for r in queryset] context["ratings"] = view_models_set context['companies'] = companies.get_all_companies() context['departments'] = companies.get_all_departments() return context
def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['companies'] = companies.get_all_companies() context['departments'] = companies.get_all_departments() context['user_id'] = self.object.id if self.company: context['current_departments'] = self.company.department_set.all() return context
def _to_companies_select(user, chat_id): companies_message = strings.get_string('ratings.select_company', user.language) all_companies = companies.get_all_companies() companies_keyboard = keyboards.keyboard_from_companies_list( all_companies, user.language) telegram_bot.send_message(chat_id, companies_message, reply_markup=companies_keyboard) telegram_bot.register_next_step_handler_by_chat_id( chat_id, company_rating_processor, user=user)
def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['companies'] = companies.get_all_companies() context['departments'] = companies.get_all_departments() context['dispatchers'] = users.get_dispatchers() return context