def get(self): individual = Individual.get_by_id(int(self.request.get('id'))) individual.name = self.request.get('name') individual.put() self.response.headers['Content-Type'] = 'application/json' self.response.write(json.dumps(individual.serialize()))
def get(self): old_id = int(self.request.get('primary_id')) new_id = self.request.get('assigned_id') individual = Individual.get_by_id(old_id) individual.assigned_id = new_id individual.put() self.response.headers['Content-Type'] = 'application/json' self.response.write(json.dumps({'success': True}))
def get(self): ids = json.loads(self.request.get('ids')) record = Team(user=-1, paid=False, name="Individual Team", year=get_year()) record.put() for i in ids: indiv = Individual.get_by_id(i) indiv.team = record.key.id() indiv.put() self.response.headers['Content-Type'] = 'application/json' self.response.write(json.dumps({"success": True}))
def get(self): ids = json.loads(self.request.get('ids')) record = Team( user = -1, paid = False, name = "Individual Team", year = get_year() ) record.put() for i in ids: indiv = Individual.get_by_id(i) indiv.team = record.key.id() indiv.put() self.response.headers['Content-Type'] = 'application/json' self.response.write(json.dumps({"success": True}))