| Home | Trees | Index | Help |
|
|---|
| Package pyxmpp :: Package jabber :: Module dataforms :: Class Field |
|
object --+
|
StanzaPayloadObject --+
|
Field
A data form field.
:Ivariables:
- `name`: field name.
- `values`: field values.
- `value`: field value parsed according to the form type.
- `label`: field label (human-readable description).
- `type`: field type ("boolean", "fixed", "hidden", "jid-multi",
"jid-single", "list-multi", "list-single", "text-multi",
"text-private" or "text-single").
- `options`: field options (for "list-multi" or "list-single" fields).
- `required`: `True` when the field is required.
- `desc`: natural-language description of the field.
:Types:
- `name`: `unicode`
- `values`: `list` of `unicode`
- `value`: `bool` for "boolean" field, `JID` for "jid-single", `list` of `JID`
for "jid-multi", `list` of `unicode` for "list-multi" and "text-multi"
and `unicode` for other field types.
- `label`: `unicode`
- `type`: `str`
- `options`: `Option`
- `required`: `boolean`
- `desc`: `unicode`
| Method Summary | |
|---|---|
Initialize a `Field` object. | |
__getattr__(self,
name)
| |
__setattr__(self,
name,
value)
| |
Add an option for the field. | |
Complete the XML node with `self` content. | |
| Inherited from StanzaPayloadObject | |
Get the XML representation of `self`. | |
| Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__str__() <==> str(x) | |
| Class Variable Summary | |
|---|---|
tuple |
allowed_types = ('boolean', 'fixed', 'hidden', 'jid-mult...
|
str |
xml_element_name = 'field'
|
str |
xml_element_namespace = 'jabber:x:data'
|
| Instance Method Details |
|---|
__init__(self,
name=None,
values=None,
field_type=None,
label=None,
options=None,
required=False,
desc=None,
value=None)
|
add_option(self, values, label)
Add an option for the field.
:Parameters:
- `label`: option label (human-readable description).
- `values`: option values.
:Types:
- `label`: `unicode`
- `values`: `list` of `unicode`
|
complete_xml_element(self, xmlnode, doc)
Complete the XML node with `self` content.
:Parameters:
- `xmlnode`: XML node with the element being built. It has already
right name and namespace, but no attributes or content.
- `doc`: document to which the element belongs.
:Types:
- `xmlnode`: `libxml2.xmlNode`
- `doc`: `libxml2.xmlDoc`
|
| Class Variable Details |
|---|
allowed_types
|
xml_element_name
|
xml_element_namespace
|
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Wed May 31 22:37:00 2006 | http://epydoc.sf.net |