Exemplo n.º 1
0
	def get(self):
		args = request.args

		if 'id' in args:
			return me_obj_to_serializable(Education.objects.get(id=args['id']))
		elif 'user' in args:
			return me_obj_to_serializable(Education.objects(user=args['user']))
		else:
			return me_obj_to_serializable(Education.objects)
    def get(self):
        args = request.args

        if 'id' in args:
            return me_obj_to_serializable(
                Organization.objects.get(id=args['id']))
        elif 'code' in args:
            return me_obj_to_serializable(
                Organization.objects(code=args['code']))
        else:
            return me_obj_to_serializable(Organization.objects)
Exemplo n.º 3
0
	def get(self):
		args = request.args

		if 'id' in args:
			return me_obj_to_serializable(Recruiter.objects.get(id=args['id']))
		elif 'email' in args:
			return me_obj_to_serializable(Recruiter.objects.get(email=args['email']))
		elif 'phone' in args:
			return me_obj_to_serializable(Recruiter.objects.get(phone=args['phone']))
		else:
			return me_obj_to_serializable(Recruiter.objects)
    def get(self):
        args = request.args

        if 'id' in args:
            return me_obj_to_serializable(
                JobCategory.objects.get(id=args['id']))
        elif 'code' in args:
            return me_obj_to_serializable(
                JobCategory.objects.get(id=args['code']))
        else:
            return me_obj_to_serializable(JobCategory.objects)
Exemplo n.º 5
0
    def get(self):
        args = request.args

        if 'id' in args:
            return me_obj_to_serializable(
                ApplicantEvaluation.objects.get(id=args['id']))
        elif 'recruiter' in args:
            return me_obj_to_serializable(
                ApplicantEvaluation.objects(recruiter=args['recruiter']))
        else:
            return me_obj_to_serializable(ApplicantEvaluation.objects)
Exemplo n.º 6
0
    def get(self):
        args = request.args

        if 'id' in args:
            return me_obj_to_serializable(
                Application.objects.get(id=args['id']))
        elif 'job' in args:
            return me_obj_to_serializable(Application.objects(job=args['job']))
        elif 'resume' in args:
            return me_obj_to_serializable(
                Application.objects(resume=args['resume']))
        else:
            return me_obj_to_serializable(Application.objects)
Exemplo n.º 7
0
	def post(self):

		json = request.json
		abort_if_invalid_request_params(json, ['user'])

		resume = Resume()
		resume.user = ObjectId(json['user'])

		if 'experiences' in json:
			resume.experiences = [ObjectId(_id) for _id in json['experiences']]
		
		if 'educations' in json:
			resume.educations = [ObjectId(_id) for _id in json['educations']]
		
		if 'medcards' in json:
			resume.medcards = [ObjectId(_id) for _id in json['medcards']]
		
		if 'certificates' in json:
			resume.certificates = [ObjectId(_id) for _id in json['certificates']]
		
		if 'summary' in json:
			resume.summary = json['summary']

		resume.save()
		return me_obj_to_serializable(resume)
    def put(self):
        json = request.json

        if 'id' in json:
            job_category = JobCategory.objects.get(id=json['id'])
        elif '_code' in json:
            job_category = JobCategory.objects.get(code=json['_code'])
        elif '_name' in json:
            job_category = JobCategory.objects.get(name=json['_name'])
        else:
            abort_if_invalid_request_params(json, ['id', '_code', '_name'])

        if 'code' in json and json['code'] != job_category['code']:
            job_category.update(code=json['code'])

        if 'name' in json and json['name'] != job_category['name']:
            job_category.update(name=json['name'])

        if 'description' in json and json['description'] != job_category[
                'description']:
            job_category.update(description=json['description'])

        job_category.reload()

        return me_obj_to_serializable(job_category)
Exemplo n.º 9
0
    def put(self):
        json = request.json
        abort_if_invalid_request_params(json, ['id'])

        experience = Experience.objects.get(id=json['id'])

        if 'position' in json and json['position'] != experience['position']:
            experience.update(position=json['position'])

        if 'organization' in json and json['organization'] != experience[
                'organization']:
            experience.update(organization=json['organization'])

        if 'job_category' in json and json['job_category'] != experience[
                'job_category']:
            experience.update(job_category=json['job_category'])

        if 'date_start' in json and json['date_start'] != experience[
                'date_start']:
            experience.update(date_start=json['date_start'])

        if 'date_end' in json and json['date_end'] != experience['date_end']:
            experience.update(date_end=custom_hash(json['date_end']))

        if 'country' in json and json['country'] != experience['country']:
            experience.update(country=custom_hash(json['country']))

        experience.reload()

        return me_obj_to_serializable(experience)
Exemplo n.º 10
0
    def put(self):
        json = request.json

        if 'id' in json:
            evaluation = ApplicantEvaluation.objects.get(id=json['id'])
        else:
            abort_if_invalid_request_params(json, ['id'])

        if 'recruiter' in json and json['recruiter'] != evaluation['recruiter']:
            evaluation.update(recruiter=json['recruiter'])

        if 'application' in json and json['application'] != evaluation[
                'application']:
            evaluation.update(application=json['application'])

        if 'notes' in json and json['notes'] != evaluation['notes']:
            evaluation.update(notes=json['notes'])

        if 'in_progress' in json and json['in_progress'] != evaluation[
                'in_progress']:
            evaluation.update(in_progress=json['in_progress'])

        if 'hired' in json and json['hired'] != evaluation['hired']:
            evaluation.update(hired=custom_hash(json['hired']))

        evaluation.reload()

        return me_obj_to_serializable(evaluation)
Exemplo n.º 11
0
    def post(self):

        json = request.json
        abort_if_invalid_request_params(json, [
            'code', 'name', 'description', 'job_category', 'recruiter',
            'organization', 'position'
        ])

        job = Job()
        job.code = json['code']
        job.name = json['name']
        job.description = json['description']
        job.job_category = json['job_category']
        job.recruiter = json['recruiter']
        job.organization = json['organization']
        job.position = json['position']

        if 'salary_min' in json:
            job.salary_min = json['salary_min']

        if 'salary_max' in json:
            job.salary_max = json['salary_max']

        if 'currency' in json:
            job.currency = json['currency']

        job.save()
        return me_obj_to_serializable(job)
Exemplo n.º 12
0
    def put(self):
        json = request.json

        if 'id' in json:
            user = User.objects.get(id=json['id'])
        elif '_email' in json:
            user = User.objects.get(email=json['_email'])
        else:
            abort_if_invalid_request_params(json, ['id', '_email'])

        if 'first_name' in json and json['first_name'] != user['first_name']:
            user.update(first_name=json['first_name'])

        if 'last_name' in json and json['last_name'] != user['last_name']:
            user.update(last_name=json['last_name'])

        if 'email' in json and json['email'] != user['email']:
            user.update(email=json['email'])

        if 'phone' in json and json['phone'] != user['phone']:
            user.update(phone=json['phone'])

        if 'password' in json and json['password'] != user['password']:
            user.update(password=custom_hash(json['password']))

        user.reload()

        return me_obj_to_serializable(user)
Exemplo n.º 13
0
	def put(self):
		json = request.json

		abort_if_invalid_request_params(json, ['id', 'summary'])
		resume = Resume.objects.get(id=json['id'])
		resume.update(summary = json['summary'])		
		resume.reload()

		return me_obj_to_serializable(resume)
Exemplo n.º 14
0
	def delete(self):
		json = request.json
		abort_if_invalid_request_params(json, ['id' ,'experiences'])

		resume = Resume.objects.get(id=json['id'])
		for _id in json['experiences']:
			resume.update(pull__experiences=ObjectId(_id))
		resume.reload()
		
		return me_obj_to_serializable(resume)
Exemplo n.º 15
0
	def post(self):

		json = request.json
		abort_if_invalid_request_params(json, ['id' ,'medcards'])

		resume = Resume.objects.get(id=json['id'])
		for _id in json['medcards']:
			resume.update(add_to_set__medcards=ObjectId(_id))
		resume.reload()

		return me_obj_to_serializable(resume)
Exemplo n.º 16
0
    def post(self):

        json = request.json
        abort_if_invalid_request_params(json, ['user', 'title', 'url'])

        medcard = Medcard()
        medcard.user = ObjectId(json['user'])
        medcard.title = json['title']
        medcard.url = json['url']

        medcard.save()
        return me_obj_to_serializable(medcard)
Exemplo n.º 17
0
    def post(self):

        json = request.json
        abort_if_invalid_request_params(json, ['code', 'name'])

        job_category = JobCategory()
        job_category.code = json['code']
        job_category.name = json['name']
        if 'description' in json:
            job_category.description = json['description']

        job_category.save()
        return me_obj_to_serializable(job_category)
Exemplo n.º 18
0
    def post(self):

        json = request.json
        abort_if_invalid_request_params(json, ['code', 'name'])

        organization = Organization()
        organization.code = json['code']
        organization.name = json['name']

        if 'description' in json:
            organization.description = json['description']

        organization.save()
        return me_obj_to_serializable(organization)
Exemplo n.º 19
0
    def post(self):
        json = request.json
        abort_if_invalid_request_params(json, ['job', 'resume'])

        application = Application()
        application.job = json['job']
        application.resume = json['resume']

        if 'cover_letter' in json:
            application.cover_letter = json['cover_letter']

        application.save()

        return me_obj_to_serializable(application)
Exemplo n.º 20
0
    def post(self):

        json = request.json
        abort_if_invalid_request_params(
            json, ['user', 'title', 'description', 'url'])

        certificate = Certificate()
        certificate.user = ObjectId(json['user'])
        certificate.title = json['title']
        certificate.description = json['description']
        certificate.url = json['url']

        certificate.save()
        return me_obj_to_serializable(certificate)
Exemplo n.º 21
0
	def post(self):
		json = request.json
		abort_if_invalid_request_params(json, ['first_name', 'last_name', 'email', 'phone', 'password', 'organization'])

		recruiter = Recruiter()
		recruiter.first_name = json['first_name']
		recruiter.last_name = json['last_name']
		recruiter.email = json['email']
		recruiter.phone = json['phone']
		recruiter.password = custom_hash(json['password'])
		recruiter.organization = json['organization']
		recruiter.save()
		
		return me_obj_to_serializable(recruiter)
Exemplo n.º 22
0
    def post(self):
        json = request.json
        abort_if_invalid_request_params(
            json, ['first_name', 'last_name', 'email', 'phone', 'password'])

        user = User()
        user.first_name = json['first_name']
        user.last_name = json['last_name']
        user.email = json['email']
        user.phone = json['phone']
        user.password = custom_hash(json['password'])
        user.save()

        return me_obj_to_serializable(user)
Exemplo n.º 23
0
	def post(self):

		json = request.json
		abort_if_invalid_request_params(json, ['user', 'degree', 'organization', 'date_start', 'date_end', 'country'])

		education = Education()
		education.user = ObjectId(json['user'])			
		education.degree = json['degree']
		education.organization = json['organization']
		education.date_start = json['date_start']
		education.date_end = json['date_end']
		education.country = json['country']
		
		education.save()
		return me_obj_to_serializable(education)
Exemplo n.º 24
0
    def put(self):
        json = request.json

        abort_if_invalid_request_params(json, ['id'])
        medcard = Medcard.objects.get(id=json['id'])

        if 'title' in json and json['title'] != medcard['title']:
            medcard.update(title=json['title'])

        if 'url' in json and json['url'] != medcard['url']:
            medcard.update(url=json['url'])

        medcard.reload()

        return me_obj_to_serializable(medcard)
Exemplo n.º 25
0
    def put(self):
        json = request.json

        abort_if_invalid_request_params(json, ['id'])
        job = Job.objects.get(id=json['id'])

        if 'code' in json and json['code'] != job['code']:
            job.update(code=json['code'])

        if 'name' in json and json['name'] != job['name']:
            job.update(name=json['name'])

        if 'description' in json and json['description'] != job['description']:
            job.update(description=json['description'])

        if 'job_category' in json and json['job_category'] != job[
                'job_category']:
            job.update(job_category=json['job_category'])

        if 'recruiter' in json and json['recruiter'] != job['recruiter']:
            job.update(recruiter=json['recruiter'])

        if 'organization' in json and json['organization'] != job[
                'organization']:
            job.update(organization=json['organization'])

        if 'position' in json and json['position'] != job['position']:
            job.update(position=json['position'])

        if 'salary_min' in json and json['salary_min'] != job['salary_min']:
            job.update(salary_min=json['salary_min'])

        if 'salary_max' in json and json['salary_max'] != job['salary_max']:
            job.update(salary_max=json['salary_max'])

        if 'currency' in json and json['currency'] != job['currency']:
            job.update(currency=json['currency'])

        if 'is_available' in json and json['is_available'] != job[
                'is_available']:
            job.update(is_available=json['is_available'])

        job.reload()

        return me_obj_to_serializable(job)
Exemplo n.º 26
0
    def post(self):

        json = request.json
        abort_if_invalid_request_params(json, [
            'user', 'position', 'organization', 'job_category', 'date_start',
            'date_end', 'country'
        ])

        experience = Experience()
        experience.user = ObjectId(json['user'])
        experience.position = json['position']
        experience.organization = json['organization']
        experience.job_category = json['job_category']
        experience.date_start = json['date_start']
        experience.date_end = json['date_end']
        experience.country = json['country']

        experience.save()
        return me_obj_to_serializable(experience)
Exemplo n.º 27
0
    def put(self):
        json = request.json

        abort_if_invalid_request_params(json, ['id'])
        application = Application.objects.get(id=json['id'])

        if 'job' in json and json['job'] != application['job']:
            application.update(job=json['job'])

        if 'resume' in json and json['resume'] != application['resume']:
            application.update(resume=json['resume'])

        if 'cover_letter' in json and json['cover_letter'] != application[
                'cover_letter']:
            application.update(cover_letter=json['cover_letter'])

        application.reload()

        return me_obj_to_serializable(application)
Exemplo n.º 28
0
    def put(self):
        json = request.json

        abort_if_invalid_request_params(json, ['id'])
        certificate = Certificate.objects.get(id=json['id'])

        if 'title' in json and json['title'] != certificate['title']:
            certificate.update(title=json['title'])

        if 'description' in json and json['description'] != certificate[
                'description']:
            certificate.update(description=json['description'])

        if 'url' in json and json['url'] != certificate['url']:
            certificate.update(url=json['url'])

        certificate.reload()

        return me_obj_to_serializable(certificate)
Exemplo n.º 29
0
    def post(self):
        json = request.json
        abort_if_invalid_request_params(json, ['recruiter', 'application'])

        evaluation = ApplicantEvaluation()
        evaluation.recruiter = json['recruiter']
        evaluation.application = json['application']

        if 'notes' in json:
            evaluation.notes = json['notes']

        if 'in_progress' in json:
            evaluation.in_progress = json['in_progress']

        if 'hired' in json:
            evaluation.hired = json['hired']

        evaluation.save()

        return me_obj_to_serializable(evaluation)
Exemplo n.º 30
0
    def get(self):
        args = request.args

        if 'id' in args:
            return me_obj_to_serializable(Job.objects.get(id=args['id']))
        elif 'job' in args:
            return me_obj_to_serializable(Job.objects(job=args['job']))
        elif 'recruiter' in args:
            return me_obj_to_serializable(
                Job.objects(recruiter=args['recruiter']))
        elif 'position' in args:
            return me_obj_to_serializable(
                Job.objects(position=args['position']))
        elif 'organization' in args:
            return me_obj_to_serializable(
                Job.objects(organization=args['organization']))
        elif 'name' in args:
            return me_obj_to_serializable(Job.objects(name=args['name']))
        else:
            return me_obj_to_serializable(Job.objects)