Exemplo n.º 1
0
	def render(self, ctx, key, args, errors):
		converter = iformal.IStringConvertible(self.original)
		if errors:
			value = args.get(key, [])
		else:
			value = map(converter.fromType, args.get(key, []) or [])
		return self._renderTag(ctx, key, value, converter, False)
Exemplo n.º 2
0
 def render(self, ctx, key, args, errors):
     if errors:
         value = args.get(key, [''])[0]
     else:
         value = iformal.IStringConvertible(self.original).fromType(
             args.get(key))
     return T.textarea(name=key, id=key, mce_editable='true')[value or '']
Exemplo n.º 3
0
 def renderImmutable(self, ctx, key, args, errors):
     value = iformal.IStringConvertible(self.original).fromType(
         args.get(key))
     if value:
         value = T.xml(value)
     else:
         value = ''
     return T.div(id=key, class_="readonly-textarea-container")[T.div(
         class_='readonly-textarea readonly')[value]]
Exemplo n.º 4
0
 def processInput(self, ctx, key, args, default=''):
     values = args.get(key, default.split())
     rv = []
     for value in values:
         value = iformal.IStringConvertible(self.original).toType(value)
         if self.noneOption is not None and value == self.noneOption[0]:
             value = None
         rv.append(self.original.validate(value))
     return rv
Exemplo n.º 5
0
	def processInput(self, ctx, key, args, default=''):
		values = args.get(key, default.split())
		rv = []
		for value in values:
			value = iformal.IStringConvertible(self.original).toType(value)
			if self.noneOption is not None and value==iformal.IKey(
					self.noneOption).key():
				# NoneOption means "any" here, don't generate a condition
				return None
			rv.append(self.original.validate(value))
		return rv
Exemplo n.º 6
0
 def processInput(self, ctx, key, args, default=''):
     value = args.get(key, [default])[0].decode(util.getPOSTCharset(ctx))
     value = iformal.IStringConvertible(self.original).toType(value)
     return self.original.validate(value)
Exemplo n.º 7
0
 def renderImmutable(self, ctx, key, args, errors):
     converter = iformal.IStringConvertible(self.original)
     value = converter.fromType(args.get(key))
     return self._renderTag(ctx, key, value, converter, True)
    def processInput(self, ctx, key, args, default=None):
			# default is ignored here
        value = args.get(key, [''])[0].decode(util.getPOSTCharset(ctx))
        value = iformal.IStringConvertible(self.original).fromType(value)
        return self.original.validate(value)
 def render(self, ctx, key, args, errors):
     if errors:
         value = args.get(key, [''])[0]
     else:
         value = iformal.IStringConvertible(self.original).fromType(args.get(key))
     return self._renderTag(ctx, key, value, False)