Package common :: Module dataforms :: Class DataField
[hide private]
[frames] | no frames]

Class DataField

source code


Keeps data about one field - var, field type, labels, instructions... Base class for different kinds of fields. Use Field() function to construct one of these
Instance Methods [hide private]
 
__init__(self, typ=None, var=None, value=None, label=None, desc=None, required=False, options=None, extend=None)
Takes "tag" argument as the name of node (prepended by namespace, if needed and separated from it by a space), attrs dictionary as the set of arguments, payload list as the set of textual strings and child nodes that this node carries within itself and "parent" argument that is another node that this one will be the child of.
source code
 
type()
Type of field.
source code
 
var()
Field identifier
source code
 
label()
Human-readable field name
source code
 
description()
Human-readable description of field meaning
source code
 
required()
Controls whether this field required to fill.
source code
 
media()
Media data
source code
 
is_valid(self) source code

Inherited from xmpp.simplexml.Node: __contains__, __delitem__, __getattr__, __getitem__, __setitem__, __str__, addChild, addData, clearData, delAttr, delChild, getAttr, getAttrs, getChildren, getData, getName, getNamespace, getParent, getPayload, getTag, getTagAttr, getTagData, getTags, has_attr, iterTags, lookup_nsp, setAttr, setData, setName, setNamespace, setParent, setPayload, setTag, setTagAttr, setTagData

Inherited from object: __delattr__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__

Class Methods [hide private]

Inherited from ExtendedNode: __new__

Class Variables [hide private]

Inherited from xmpp.simplexml.Node: FORCE_NODE_RECREATION

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, typ=None, var=None, value=None, label=None, desc=None, required=False, options=None, extend=None)
(Constructor)

source code 
Takes "tag" argument as the name of node (prepended by namespace, if needed and separated from it by a space), attrs dictionary as the set of arguments, payload list as the set of textual strings and child nodes that this node carries within itself and "parent" argument that is another node that this one will be the child of. Also the __init__ can be provided with "node" argument that is either a text string containing exactly one node or another Node instance to begin with. If both "node" and other arguments is provided then the node initially created as replica of "node" provided and then modified to be compliant with other arguments.
Overrides: object.__init__
(inherited documentation)

type()

source code 
Type of field. Recognized values are: 'boolean', 'fixed', 'hidden', 'jid-multi', 'jid-single', 'list-multi', 'list-single', 'text-multi', 'text-private', 'text-single'. If you set this to something different, DataField will store given name, but treat all data as text-single
Decorators:
  • @nested_property

var()

source code 
Field identifier
Decorators:
  • @nested_property

label()

source code 
Human-readable field name
Decorators:
  • @nested_property

description()

source code 
Human-readable description of field meaning
Decorators:
  • @nested_property

required()

source code 
Controls whether this field required to fill. Boolean
Decorators:
  • @nested_property

media()

source code 
Media data
Decorators:
  • @nested_property

is_valid(self)

source code