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)
Beispiel #2
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)
    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)
Beispiel #4
0
	def delete(self):
		json = request.json
		abort_if_invalid_request_params(json, ['id'])

		Resume.objects.get(id=json['id']).delete()

		return None
    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)
Beispiel #6
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)
Beispiel #7
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)
Beispiel #8
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)
Beispiel #9
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)
Beispiel #10
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)
    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)
    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)
Beispiel #13
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)
    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)
Beispiel #15
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)
Beispiel #16
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)
    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)
Beispiel #18
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)
    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)
Beispiel #20
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)
    def delete(self):
        json = request.json

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

        return None
    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)
    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)
Beispiel #24
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)
Beispiel #25
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)
    def put(self):
        json = request.json

        if 'id' in json:
            organization = Organization.objects.get(id=json['id'])
        elif '_code' in json:
            organization = Organization.objects.get(code=json['_code'])
        else:
            abort_if_invalid_request_params(json, ['id', '_code'])

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

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

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

        organization.reload()

        return me_obj_to_serializable(organization)
Beispiel #27
0
	def put(self):
		json = request.json

		abort_if_invalid_request_params(json, ['id'])
		education = Education.objects.get(id=json['id'])

		if 'degree' in json and json['degree'] != education['degree']:
			education.update(degree = json['degree'])

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

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

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

		return me_obj_to_serializable(education)
Beispiel #28
0
	def get(self):
		args = request.args
		abort_if_invalid_request_params(args, ['id'])
		return me_obj_to_serializable(Resume.objects.get(id=args['id'])['experiences'])
Beispiel #29
0
 def delete(self):
     json = request.json
     abort_if_invalid_request_params(json, ['id'])
     ApplicantEvaluation.objects.get(id=json['id']).delete()
     return None