def delete(self,id): try: j = Job.get_object(id) j.delete() self.write('Job object deleted') except: raise web.HTTPError(404)
def get(self,id): try: j = Job.get_object(id) j_attrs = j.get_atts() j_attrs['post_ts'] = str(j_attrs['post_ts']) self.write(json.dumps(j_attrs)) except: raise web.HTTPError(404)
def put(self,id): try: j = Job.get_object(id) new_values = urlparse.parse_qs(self.request.body) for k in new_values: new_values[k] = new_values[k][0] j.set_attr(new_values) j.save() self.write('Job object modified') except: raise web.HTTPError(404)
from company import Company from history import History for l in [ 'Delhi', 'Bangalore', 'Mumbai', 'Pune', 'Hyderabad' ]: loc = Location(l) loc.save() for c in [ 'IT/Hardware', 'IT/Software', 'Sales', 'Marketing', 'Finance', 'Management', 'ITES' ]: cat = Cat(c) cat.save() for c in [ 'ABC', 'XYZ' ]: co = Company(c) co.save() r = Rec(fname='Ashish',lname='Mukherjee',password='******',email='*****@*****.**', cpny_id = 1) r.save() j = Job(job_code = 'SSE - 1000',loc_id=1,title = 'Senior Software Engineer - Java',descr = 'Seeking mid-level Java programmer',kw = 'java',rec_id = 1,cat_id = 1,cpny_id = 1) j.save() j = JobSeeker(fname = 'Ashish', lname = 'Mukherjee', email = '*****@*****.**', phone = '8800199033', title = 'Experienced Java Engineer', resume = 'AshishMukherjee.doc', loc_id = 1, cat_id = 1, kw = 'Java', vdo = '') j.save() h = History(job_id = 1, rec_id = 1, cand_id = 1, comments = 'Nice resume', stage = 'WIP') h.save() j = Job.get_object(1) j.set_attr({ 'title': 'SSE- Java/J2EE' }) j.save()