Ejemplo n.º 1
0
 def _process_args(self):
     self._with_kpi = request.args.get('withKPI', type=bool)
     self._actionSucceeded = request.args.get('actionSucceeded',
                                              default=False,
                                              type=bool)
     location_name = request.view_args.get('locationId')
     self._location = Location.find_one(name=location_name)
Ejemplo n.º 2
0
    def _process_args(self):
        name = request.view_args.get('locationId')
        self._location = Location.find_one(name=name)
        self._new_attr = None
        attr_title = request.form.get('newCustomAttributeName',
                                      default='').strip()
        if attr_title:
            attr_name = attr_title.replace(' ', '-').lower()
            if self._location.get_attribute_by_name(attr_name):
                raise BadRequest(
                    _('There is already an attribute named: {0}').format(
                        attr_name))

            self._new_attr = RoomAttribute(
                name=attr_name,
                title=attr_title,
                type='str',
                is_required=request.form.get(
                    'newCustomAttributeIsRequired') == 'on',
                is_hidden=request.form.get(
                    'newCustomAttributeIsHidden') == 'on')
Ejemplo n.º 3
0
 def _process_args(self):
     self._eq = request.form.get(self.PARAM)
     name = request.view_args.get('locationId')
     self._location = Location.find_one(name=name)
Ejemplo n.º 4
0
 def _process_args(self):
     name = request.view_args.get('locationId')
     self._location = Location.find_one(name=name)
     self._attr = request.args.get('removeCustomAttributeName', '')