Esempio n. 1
0
    def post(self):
        resource_type = self.get_argument('resource_type', '')
        name = self.get_argument('name', '')
        email = self.get_argument('email', '')
        address = self.get_argument('address', '')
        city = self.get_argument('city', '')
        state = self.get_argument('state', '')
        zipcode = self.get_argument('zipcode', '')
        hours = self.get_argument('hours', '')
        notes = self.get_argument('notes', '')
        phone = self.get_argument('phone', '')
        url = self.get_argument('url', '')
        va_status = self.get_argument('va_status', '')

        resource = Resource(self.db, config)
        request_result = resource.request_shelter(resource_type, name, email,
                                                  address, city, state,
                                                  zipcode, hours, notes, phone,
                                                  url, va_status)

        if request_result['meta']['status'] == 'ERROR':
            self.get_current_user()
            kwargs = dict(self.application.static_kwargs)
            kwargs['page_name'] = 'mobile_shelter_register'
            kwargs['config'] = config
            kwargs['done'] = 0
            kwargs['resource_id'] = None
            self.write(
                self.application.loader.load(
                    'mobile/shelter_register.html').generate(**kwargs))
        else:
            next_url = '/mobile/shelter/register?done=1'
            self.redirect(next_url)
Esempio n. 2
0
 def post(self):
     name = self.get_argument('name', '')
     email = self.get_argument('email', '')
     address = self.get_argument('address', '')
     city = self.get_argument('city', '')
     state = self.get_argument('state', '')
     zipcode = self.get_argument('zipcode', '')
     hours = self.get_argument('hours', '')
     notes = self.get_argument('notes', '')
     resource = Resource(self.db, config)
     self.write(
         resource.request_shelter(name, email, address, city, state,
                                  zipcode, hours, notes))
Esempio n. 3
0
 def post(self):
     resource_type = self.get_argument('resource_type', None)
     name = self.get_argument('name', '')
     email = self.get_argument('email', '')
     address = self.get_argument('address', '')
     city = self.get_argument('city', '')
     state = self.get_argument('state', '')
     zipcode = self.get_argument('zipcode', '')
     hours = self.get_argument('hours', '')
     notes = self.get_argument('notes', '')
     phone = self.get_argument('phone', '')
     url = self.get_argument('url', '')
     va_status = self.get_argument('va_status', '')
     resource = Resource(self.db, config)
     request_result = resource.request_shelter(resource_type, name, email, address, city, state, zipcode, hours, notes, phone, url, va_status)
     self.redirect('/ios/shelter/register?done=1')