예제 #1
0
파일: app.py 프로젝트: San4stim/oop_python
def main():
    recruiter_1 = Recruiter('Bon Jovi', '*****@*****.**', 20)
    programmer_1 = Programmer('Jason Stathem', '*****@*****.**', 50)
    programmer_2 = Programmer('Vin Diesel', '*****@*****.**', 60)
    candidate_1 = Candidate('John Snow', '*****@*****.**', 'Jaba-Java', 'trainee')
    candidate_2 = Candidate('Hodor', '*****@*****.**', 'Hodor', 'hodor')
    candidate_3 = Candidate('Groot', 'iamgroot@groot', '01001101 programmer', 'guardian of senior')
    vacancy_1 = Vacancy('Python')
    vacancy_2 = Vacancy('01001101 programmer')
예제 #2
0
def main():
    recruiter1 = Recruiter('Natali', nata @ gmail.com, 20)
    programmer1 = Programmer('Alex', alex @ mail.ru, 50)
    programmer2 = Programmer('Roman', roman @ gmail.com, 60)
    candidate1 = Candidate('Vasil', vasyok @ gmail.com, 'Python')
    candidate2 = Candidate('Grisha', grigor @ rambler.ru, 'Python')
    candidate3 = Candidate('Katya', kate @ gmail.com, 'FrontEnd')
    vacancy1 = Vacancy('Python')
    vacancy2 = Vacancy('FrontEnd')
예제 #3
0
파일: app.py 프로젝트: tupaLeha/elitistOnes
def main():
    recruiter1 = Recruiter()
    programmer1 = Programmer()
    programmer2 = Programmer()
    candidate1 = Candidate()
    candidate2 = Candidate()
    candidate3 = Candidate()
    vacancy1 = Vacancy()
    vacancy2 = Vacancy()
예제 #4
0
def main():

    recr_1 = Recruiter('Vika', '*****@*****.**', 24)
    emp_2 = Programmer('Sophia', '*****@*****.**', 30,
                       ['Python', 'SQL', 'CSS', 'PostgreSQL'])
    emp_3 = Programmer('Vlad', '*****@*****.**', 500,
                       ['Python', 'GitHub', 'Java'])
    cand_1 = Candidate('Valentin Zal', '@gmail.com', ['SQL', 'Java'],
                       'English', 'Magister')
    cand_2 = Candidate('Valentin Zal', '@gmail.com', ['SQL', 'Java'],
                       'English', 'Magister')
    cand_3 = Candidate('Valentin Zal', '@gmail.com', ['SQL', 'Java'],
                       'English', 'Magister')
    vak_1 = Vacancy('Programmer', ['C++', 'C#'], 'Midle')
    vak_2 = Vacancy('Desiner', ['Figma', 'C#'], 'Midle')
예제 #5
0
    def add_vacancy(payload):
        try:
            body = request.get_json()

            new_job_title = body.get('job_title')
            new_job_description = body.get('job_description')
            new_requirements = body.get('requirements')
            new_benefits = body.get('benefits')
            new_city = body.get('city')
            new_region = body.get('region')
            new_min_salary = body.get('min_salary')
            new_date_posted = datetime.now()
            new_company_id = body.get('company_id')

            vacancy = Vacancy(job_title=new_job_title,
                              job_description=new_job_description,
                              requirements=new_requirements,
                              benefits=new_benefits,
                              city=new_city,
                              region=new_region,
                              min_salary=new_min_salary,
                              date_posted=new_date_posted,
                              company_id=new_company_id)

            vacancy.insert()
            return jsonify({'success': True})
        except Exception:
            print(sys.exc_info())
            abort(422)
예제 #6
0
def main():
    vasilyev = Programmer(
        ['js', 'python', 'make good coffee'],
        'Vasya',
        'Vasilyev',
        '*****@*****.**',
        '+322223322',
        32,
    )

    gunko = Programmer(['js', 'python', 'kubernetes', 'docker'], 'petr',
                       'gunko', '*****@*****.**', '+322227772', 30)

    tatarinova = Recruiter('Lena', 'Tatarinova', '*****@*****.**', '+372223322',
                           32)
    gagarin = Candidate('Yuriy Gagarin', '*****@*****.**',
                        ['spaceman', 'pilot'], 'pilot', 100)
    peterson = Candidate('Jim Peterson', 'jim_peterson.gmail.com',
                         ['python', 'js'], 'python', 79)
    vorghol = Candidate('Anastasia Vorghol', 'vorghol_a1952.gmail.com',
                        ['python', 'js'], 'js', 68)
    js_junior = Vacancy('JS Junior', 'js', 45)
    python_middle = Vacancy('Python Middle', 'python', 60)

    print(vasilyev, gunko, tatarinova, sep='\n')
    print(f'{vasilyev.name} salary: {vasilyev.check_salary()}')
    print(vasilyev.surname, 'said:', vasilyev.work())
    print(vasilyev > tatarinova)
    print(vasilyev >= tatarinova)
    print(vasilyev.tech_stack)
    print(gunko)
    print(vasilyev < gunko)
    print(vasilyev + gunko)
    print(js_junior)
    print(peterson)
    print(vorghol)
    print(gagarin)
    print(python_middle)
    print(vasilyev.about_person)
    data = Candidate.make_candidates_from_csv()
    [print(i) for i in data]
예제 #7
0
파일: app.py 프로젝트: Allinka1/OOP
def main():
    employee_1 = Programmer('Alinka', '*****@*****.**', 100,
                            ['Python', 'HTML', 'CSS', 'PostgreSQL'])
    employee_2 = Programmer('Nikita', '*****@*****.**', 500,
                            ['Python', 'GitHub'])
    recruiter_1 = Recruiter('Dasha', '*****@*****.**', 100)
    candidate_1 = Candidate('Maria Klukina', '*****@*****.**',
                            ['Python', 'Java Script'], 'Python', 'middle')
    candidate_2 = Candidate('Dima Mironin', '*****@*****.**',
                            ['Ruby', 'C#', 'Java'], 'Ruby', 'senior')
    candidate_3 = Candidate('Vladislav Limov', '*****@*****.**',
                            ['HTML', 'CSS', 'C++'], 'C++', 'junior')
    vacancy_1 = Vacancy('Python Developer', 'Python', 'middle')
    vacancy_2 = Vacancy('Ruby Developer', 'Ruby', 'senior')
    # candidate_1.work()
    # print(recruiter_1.full_info)
    # print(employee_1.full_info)
    # print(Candidate.from_csv('candidates.csv'))
    print(
        Candidate.from_csv(
            'https://bitbucket.org/ivnukov/lesson2/raw/master/candidates.csv'))
예제 #8
0
def save_vacancy():
    try:
        comp_id = request.form['comp_id']
        cand_id = request.form['cand_id']
        post_date = request.form['post_date']
        expiry_date = request.form['expiry_date']
        sal_min = request.form['sal_min']
        sal_max = request.form['sal_max']
        fulltime = request.form['fulltime']

        # saving vacancy in db
        vacancy = Vacancy(comp_id, cand_id, post_date, expiry_date, sal_min,
                          sal_max, fulltime)
        db.session.add(vacancy)
        db.session.commit()
    except Exception as exp:
        print "save_vacancy() :: Got Exception: %s" % exp
        print(traceback.format_exc())
    return "Vacancy saved"
예제 #9
0
async def correct_vacancy(query: callback_query, state: FSMContext):
    async with state.proxy() as vacancy:
        user = User.get(User.chat_id == query.message.chat.id)
        vacancy_record = Vacancy(creator=user,
                                 name=vacancy['name'],
                                 specialization=vacancy['specialization'],
                                 description=vacancy['description'],
                                 key_skills=vacancy['key_skills'],
                                 income=vacancy['income'],
                                 test_task=None)
        vacancy_record.save()

    await state.finish()
    keyboard = InlineKeyboardMarkup()
    keyboard.add(
        InlineKeyboardButton(buttons.menu, callback_data='menu'),
        InlineKeyboardButton(buttons.create_vacancy,
                             callback_data='create_vacancy'))
    await query.message.answer(messages.vacancy_created, reply_markup=keyboard)
예제 #10
0
def get_vacancies(min_count=6):
    url = api + "vacancies"
    response = requests.get(url)
    json = response.json()

    if (min_count > 20):
        min_count = 20

    vacancies = []

    for i in range(min_count):
        item = json['items'][i]
        vacancy = Vacancy(item['id'], item['name'], item['area'],
                          item['salary'], item['address'],
                          item['published_at'], item['created_at'],
                          item['url'], item['snippet'])
        vacancies.append(vacancy)

    return vacancies
예제 #11
0
from models import Programmer, Recruiter
from models import Candidate, Vacancy

if __name__ == '__main__':

    technologies = ['python', 'js', 'html', 'css']
    recruiter_anna = Recruiter('Anna', "*****@*****.**", 50)
    programmer_oleg = Programmer('Oleg', "*****@*****.**", 100)
    programmer_vasya = Programmer('Vasya', "*****@*****.**", 75)
    candidate_grisha = Candidate('Grisha Vetrov', '*****@*****.**',
                                 technologies, 'Python', 'Middle')
    candidate_petya = Candidate('Petr Vetrov', '*****@*****.**', technologies,
                                'Python', 'Junior')
    candidate_kolya = Candidate('Kolya Ivanov', '*****@*****.**',
                                technologies, 'Python', 'Senior')
    vacancy_python_middle = Vacancy('Python Middle on Project 1', 'Python',
                                    'Middle')
    vacancy_python_senior = Vacancy('Python Senior on Project 2', 'Python',
                                    'Senior')

    print(programmer_oleg.work())
    print(programmer_vasya.check_salary(15))
    print(programmer_oleg.__str__())
    print(recruiter_anna.work())
    print(recruiter_anna.check_salary(15))
    print(recruiter_anna.__str__())

    print(candidate_grisha.__str__())
    print(candidate_petya.__str__())
    print(candidate_kolya.__str__())
    print(vacancy_python_middle.__str__())
    print(vacancy_python_senior.__str__())
예제 #12
0
파일: app.py 프로젝트: shpilievoi29/OOP
from models import Vacancy

if __name__ == '__main__':
    igor = Programmer('Igor', 1000, '*****@*****.**', 'programmer',
                      ['JS', 'Python', 'Delphi'])

    sasha = Programmer('Sasha', 130, '*****@*****.**', 'programmer',
                       ['Python'])

    curt = Recruiter('Cobain', 180, '*****@*****.**', 'recruiter')

    john = Candidate('John Fitzgerald Kennedy', '*****@*****.**',
                     ["Python", 'JS'], ['Pylon', 'JS'],
                     ['Python -middle', 'JS-junior'])

    java = Vacancy('Java', ['Java game developer'],
                   ['Java - middle', 'Python - senior'])

    full_stack = Vacancy('Full-Stack', ['PHP', 'MySQL', 'JS'],
                         ['PHP - senior', 'MySql - senior', 'JS -middle'])
    oleg = Employee('Oleg', 120, '*****@*****.**', 'programmer')

    # print(Programmer.comparison_stack(igor, sasha))
    #print(Employee.check_salary(sasha, Employee.day_count))
    # print(sasha.__dict__)
    # print(igor.__dict__)
    # print(Programmer.comparison_stack(sasha, igor))
    # print(Employee.check_salary(igor, Employee.day_count))
try:
    Candidate.work(john)

except Exception as err:
예제 #13
0
파일: app.py 프로젝트: zaharapple/OOP
def main():
    try:
        r = Recruiter(name="Sasha", zp_day=150, days=21, email='sasha@com')
        p = Programmer(name="Slava", zp_day=220, days=23, email='sl@com',
                       tech_stack={'have a car ', 'Python', 'JS', 'Git', 'HTML'})
        p2 = Programmer(name="Kostya", zp_day=200, days=24, email='kos@com',
                        tech_stack={'know of English ', 'Python', 'Django', 'flaks', 'react'})
        c = Candidate("Petya", "pet@com", "Razrabotka", "JS", "trenie")
        c2 = Candidate("Katya", "KET@com", "Recruter", "English", "С1")
        c3 = Candidate("Kiril", "Kir@com", "Razrabotkbotka", "Python", "junior")
        v = Vacancy("Programmer", "Python,JS,HTML", "junior")
        v2 = Vacancy("Recruiter", "комуникабельность , знание английского языка", "стаж 1год")

        # print(v)
        # print(v2)
        #
        # print('---------------------------')
        #
        # print(c)
        # # print(c.work())
        # print(c2)
        # print(c3)
        #
        # print('---------------------------')
        #
        # print(r)
        # print(r.work())
        # print(r.cheak_salary())
        #
        # print('---------------------------')
        #
        # print(p)
        # print(p.work())
        # print(p.cheak_salary())
        # print(p.tech_stack)
        #
        # print('---------------------------')
        # print(r == p)  # comparison by salary
        # print('---------------------------')
        # print(p.cheak_salary())
        #
        # print(p2)
        # print(p2.work())
        # print(p2.cheak_salary())
        # print(p2.tech_stack)
        #
        # print('---------------------------')
        # print(p > p2)
        # print()
        #
        # alfaprogr = p + p2
        # print(alfaprogr)
        # print(alfaprogr.work())
        # print(alfaprogr.cheak_salary())
        # print(alfaprogr.tech_stack)
        print(p.full_info)
        Candidate.create_candidat(' candidates.csv')


    except Exception as e:

        with open('logs.txt', 'a+') as log:
            mytime = (datetime.now().ctime())
            log.write(mytime + '\n')
            log.write(traceback.format_exc() + '------------------' + '\n')