Package pyxmpp :: Package jabber :: Module register :: Class Register
[show private | hide private]
[frames | no frames]

Type Register

         object --+    
                  |    
StanzaPayloadObject --+
                      |
                     Register


Delayed delivery tag.

Represents 'jabber:iq:register' (JEP-0077) element of a Jabber <iq/> stanza.

Please note that it is recommended to use get_form and submit_form records instead of accessing the form and legacy fields directly. This way both legacy and Data Forms registration would work transparently to the application.


Method Summary
  __init__(self, xmlnode)
Initialize the Register object.
  complete_xml_element(self, xmlnode, doc)
Complete the XML node with self content.
pyxmpp.jabber.dataforms.Form get_form(self, form_type)
Return Data Form for the Register object.
Register submit_form(self, form)
Make Register object for submitting the registration form.
  __from_xml(self, xmlnode)
Initialize Register from an XML node.
    Inherited from StanzaPayloadObject
libxml2.xmlNode or libxml2.xmlDoc as_xml(self, parent, doc)
Get the XML representation of self.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Instance Variable Summary
unicode address: Address field (legacy protocol)
unicode city: City field (legacy protocol)
unicode date: Date field (legacy protocol)
unicode email: E-mail field (legacy protocol)
unicode first: First name field (legacy protocol)
pyxmpp.jabber.dataforms.Form form: registration form (when available)
unicode instrutions: Registration instructions (legacy protocol)
unicode key: Key field (legacy protocol, obsolete)
unicode last: Last name field (legacy protocol)
unicode misc: Misc field (legacy protocol, obsolete)
unicode name: Name field (legacy protocol)
unicode nick: Nickname (legacy protocol)
unicode password: Password (legacy protocol)
unicode phone: Phone field (legacy protocol)
bool registered: True if entity is already registered
True when the account should be removed remove: True when the account should be removed
unicode state: State field (legacy protocol)
unicode text: Text field (legacy protocol, obsolete)
unicode url: URL field (legacy protocol)
unicode username: Username field (legacy protocol)
unicode zip: ZIP code field (legacy protocol)

Class Variable Summary
unicode xml_element_name: name for the XML element provided by the class.
unicode xml_element_namespace: namespace URI for the XML element provided by the class.

Method Details

__init__(self, xmlnode=None)
(Constructor)

Initialize the Register object.
Parameters:
xmlnode - an optional XML node to parse.
           (type=libxml2.xmlNode)
Overrides:
__builtin__.object.__init__

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.
           (type=libxml2.xmlNode)
doc - document to which the element belongs.
           (type=libxml2.xmlDoc)
Overrides:
pyxmpp.objects.StanzaPayloadObject.complete_xml_element

get_form(self, form_type='form')

Return Data Form for the Register object.

Convert legacy fields to a data form if self.form is None, return self.form otherwise.

Parameters:
form_type - If "form", then a form to fill-in should be returned. If "sumbit", then a form with submitted data.
           (type=unicode)
Returns:
self.form or a form created from the legacy fields
           (type=pyxmpp.jabber.dataforms.Form)

submit_form(self, form)

Make Register object for submitting the registration form.

Convert form data to legacy fields if self.form is None.

Parameters:
form - The form to submit. Its type doesn't have to be "submit" (a "submit" form will be created here), so it could be the form obtained from get_form just with the data entered.
Returns:
new registration element
           (type=Register)

__from_xml(self, xmlnode)

Initialize Register from an XML node.
Parameters:
xmlnode - the jabber:x:register XML element.
           (type=libxml2.xmlNode)

Instance Variable Details

address

Address field (legacy protocol)
Type:
unicode

city

City field (legacy protocol)
Type:
unicode

date

Date field (legacy protocol)
Type:
unicode

email

E-mail field (legacy protocol)
Type:
unicode

first

First name field (legacy protocol)
Type:
unicode

form

registration form (when available)
Type:
pyxmpp.jabber.dataforms.Form

instrutions

Registration instructions (legacy protocol)
Type:
unicode

key

Key field (legacy protocol, obsolete)
Type:
unicode

last

Last name field (legacy protocol)
Type:
unicode

misc

Misc field (legacy protocol, obsolete)
Type:
unicode

name

Name field (legacy protocol)
Type:
unicode

nick

Nickname (legacy protocol)
Type:
unicode

password

Password (legacy protocol)
Type:
unicode

phone

Phone field (legacy protocol)
Type:
unicode

registered

True if entity is already registered
Type:
bool

remove

True when the account should be removed
Type:
True when the account should be removed

state

State field (legacy protocol)
Type:
unicode

text

Text field (legacy protocol, obsolete)
Type:
unicode

url

URL field (legacy protocol)
Type:
unicode

username

Username field (legacy protocol)
Type:
unicode

zip

ZIP code field (legacy protocol)
Type:
unicode

Class Variable Details

xml_element_name

name for the XML element provided by the class.
Type:
unicode
Value:
'query'                                                                

xml_element_namespace

namespace URI for the XML element provided by the class.
Type:
unicode
Value:
'jabber:iq:register'