Esempio n. 1
0
 def __init__(self, *args, **kwargs):
     eid = kwargs.pop("eid", "")
     super(ApplicationCaseForm, self).__init__(*args, **kwargs)
     if not eid:
         return
     self.fields["applicant"] = ModelChoiceField(queryset=applicant.get_applicants_by_creator(eid))
     self.fields["job"] = ModelChoiceField(queryset=job.get_jobs_by_eid(eid))
Esempio n. 2
0
def list_candidates(request):
    """functions for rendering candidate pages"""
    candidates = []
    try:
        emp = employee.get_employee_by_user(request.user.id)
        for c in applicant.get_applicants_by_creator(employee_id=emp.id):
            candi = model_to_dict(c)
            if not candi['photo']:
                candi['photo'] = 'avartars/avartar_default.jpg'
            candidates.append(candi)
    except Exception as ex:
        print ex
        pass
    return render_to_response(
            'list_candidates.html',
            {'candidates': candidates},
            context_instance=RequestContext(request))