def post(self, venue_id): venue = Venue.get_by_id(int(venue_id)) if not venue: self.abort(404) venue.title = self.request.get('title') venue.description = self.request.get('description') venue.called_phone = self.request.get('called_phone') if self.request.get('image_file') or self.request.get('image_url'): if self.request.get('image_file'): new_url = get_new_image_url( 'Venue', venue.key.id(), image_data=str(self.request.get('image_file'))) elif self.request.get('image_url') and self.request.get( 'image_url') != venue.pic: new_url = get_new_image_url('Venue', venue.key.id(), url=self.request.get('image_url')) else: new_url = None if new_url: venue.pic = new_url venue.phones = self.request.get('phones').split(',') venue.emails = self.request.get('emails').split(',') venue.legal = LegalInfo.get_by_id(int(self.request.get('legal'))).key venue.problem = self.request.get('problem').strip() venue.put() legals = LegalInfo.query().fetch() self.render('/venues/edit_venue.html', venue=venue, success=True, legals=legals)
def post(self): venue = Venue() venue.title = self.request.get('title') venue.description = self.request.get('description') venue.phones = self.request.get('phones').split(',') venue.emails = self.request.get('emails').split(',') venue.coordinates = ndb.GeoPt(float(self.request.get('lat')), float(self.request.get('lon'))) venue.legal = LegalInfo.get_by_id(self.request.get_range('legal')).key venue.update_address() venue.put() self.redirect('/company/venues')
def post(self): legal_id = self.request.get_range('legal_id') legal = LegalInfo.get_by_id(legal_id) if not legal: self.abort(400) legal.name = self.request.get('company_name') legal.address = self.request.get('company_address') legal.site = self.request.get('site') legal.person_ooo = self.request.get('legal_person') legal.person_ip = self.request.get('legal_person_ip') legal.contacts = self.request.get('legal_contacts') legal.email = self.request.get('legal_email') legal.inn = self.request.get('inn') legal.kpp = self.request.get('kpp') legal.ogrn = self.request.get('ogrn') legal.ogrnip = self.request.get('ogrnip') legal.report_emails = self.request.get('report_emails') legal.put() self.redirect('/company/docs/legal/list')
def get(self): legal_id = self.request.get_range('legal_id') legal = LegalInfo.get_by_id(legal_id) if not legal: self.abort(400) self.render('/docs/add_legal.html', legal=legal)