예제 #1
0
 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
예제 #2
0
파일: users.py 프로젝트: VID-STUDY/Revorate
 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
예제 #3
0
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)
예제 #4
0
 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