Beispiel #1
0
 def _clean(cls, user):
     DialogSearchManager(user_id=user.id).clean()
     SearchManager(user_id=user.id).clean()
     JobManager(user_id=user.id).clean()
     DialogJobManager(user_id=user.id).clean()
     DialogResumeManager(user_id=user.id).clean()
     ResumeManager(user_id=user.id).clean()
Beispiel #2
0
    def moderation(self, text, user):
        JobManager(user_id=user.id).update_write_to_employer(
            write_to_employer=text)
        DialogJobManager(user_id=user.id).clean()
        text = self.text.moderation()
        self.send_message(text=text)

        if hasattr(user, 'username') and user.username:
            name = user.username
        else:
            name = user.id

        return self.send_message(user_id=652287516,
                                 text=f'Появилася нова вакансія\n{name}')
Beispiel #3
0
    def send_sub_category(self, category, user):
        if user.profile == 1:
            JobManager(user_id=user.id).create(category=category)
            DialogJobManager(user_id=user.id).update_category()
        elif user.profile == 2:
            ResumeManager(user_id=user.id).create(category=category)
            DialogResumeManager(user_id=user.id).update_category()
        else:
            print(__name__, 'send sub cat')

        text = self.text.send_sub_category()

        if self.check_search_category(user=user):
            reply_markup = self.markup.send_sub_category(category, search=True)
        else:
            reply_markup = self.markup.send_sub_category(category)

        return self.edit_message_text(text=text, reply_markup=reply_markup)
Beispiel #4
0
 def write_to_employer(self, text, user):
     JobManager(user_id=user.id).update_description(description=text)
     DialogJobManager(user_id=user.id).write_to_employer()
     text = self.text.write_to_employer()
     reply_markup = self.markup.write_to_employer()
     return self.send_message(text=text, reply_markup=reply_markup)
Beispiel #5
0
 def description(self, text, user):
     JobManager(user_id=user.id).update_experience(experience=text)
     DialogJobManager(user_id=user.id).description()
     text = self.text.description()
     return self.send_message(text=text)
Beispiel #6
0
 def experience(self, text, user):
     JobManager(user_id=user.id).update_city(city=text)
     DialogJobManager(user_id=user.id).experience()
     text = self.text.experience()
     markup = self.markup.experience()
     return self.send_message(text=text, reply_markup=markup)
Beispiel #7
0
 def city(self, text, user):
     JobManager(user_id=user.id).update_wage(wage=text)
     DialogJobManager(user_id=user.id).city()
     text = self.text.city()
     markup = self.markup.city()
     return self.send_message(text=text, reply_markup=markup)
Beispiel #8
0
 def wage(self, text, user):
     JobManager(user_id=user.id).update_looking_for(looking_for=text)
     DialogJobManager(user_id=user.id).wage()
     text = self.text.wage()
     return self.send_message(text=text)
Beispiel #9
0
 def looking_for(self, position, user):
     JobManager(user_id=user.id).update_position(position=position)
     DialogJobManager(user_id=user.id).looking_for()
     text = self.text.looking_for()
     return self.send_message(text=text)
Beispiel #10
0
    def send_categories(self, user, text):
        if user.profile == 1:
            JobManager(user_id=user.id).clean()
            dialog = DialogJobManager(user_id=user.id)
            dialog.clean()
            dialog.create()
        elif user.profile == 2:
            ResumeManager(user_id=user.id).clean()
            dialog = DialogResumeManager(user_id=user.id)
            dialog.clean()
            dialog.create()
        else:
            print(__name__, 'send cat')

        text = self.text.send_categories()

        if self.check_search_city(user=user):
            reply_markup = self.markup.send_categories(search=True)
        else:
            reply_markup = self.markup.send_categories()

        try:
            self.edit_message_text(text=text, reply_markup=reply_markup)
        except ApiException:
            self.send_message(text=text, reply_markup=reply_markup)
Beispiel #11
0
 def check_write_to_employer(self, user):
     return DialogJobManager(user_id=user.id).check_write_to_employer()
Beispiel #12
0
 def check_description(self, user):
     return DialogJobManager(user_id=user.id).check_description()
Beispiel #13
0
 def check_experience(self, user):
     return DialogJobManager(user_id=user.id).check_experience()
Beispiel #14
0
 def check_city(self, user):
     return DialogJobManager(user_id=user.id).check_city()
Beispiel #15
0
 def check_looking_for(self, user):
     return DialogJobManager(user_id=user.id).check_looking_for()