Package XSLForms :: Module Fields :: Class FieldProcessor
[show private | hide private]
[frames | no frames]

Class FieldProcessor

Known Subclasses:
Form

A class which converts fields in the documented form to XML
instance documents.

Method Summary
  __init__(self, encoding, values_are_lists)
Initialise the fields processor with the given 'encoding', which is optional and which only applies to field data in Python string form (and not Unicode objects).
  complete_documents(self, documents, fields)
Complete the given 'documents' using the 'fields' items list.
  complete_selectors(self, selectors, fields, documents, create)
Fill in the given 'selectors' dictionary using the given 'fields' so that it contains mappings from selector names to parts of the specified 'documents'.
  get_selectors(self, fields, documents, create)
Get a dictionary containing a mapping of selector names to selected parts of the given 'documents'.
  make_documents(self, fields)
Make a dictionary mapping model names to new documents prepared from the given 'fields' dictionary.
  new_document(self, name)
Return an instance root of the given 'name' in a new document.
  new_instance(self, name)
Return an instance root of the given 'name' in a new document.
  _append_element(self, node, name)
Within 'node' append an element with the given 'name'.
  _ensure_elements(self, document, index)
In the given 'document', extend the child elements list so that a node can be stored at the given 'index'.
  _enter_element(self, node, name, index)
From 'node' enter the element with the given 'name' at the given 'index' position amongst the child elements.
  _find_element(self, node, name, index)
From 'node' find the element with the given 'name' at the given 'index' position amongst the child elements.
  _get_model_name_and_components(self, field)
From 'field', return the model name and components which describe the path within the instance document associated with that model.

Method Details

__init__(self, encoding='utf-8', values_are_lists=0)
(Constructor)

Initialise the fields processor with the given 'encoding',
which is optional and which only applies to field data in
Python string form (and not Unicode objects).

If the optional 'values_are_lists' parameter is set to true
then each actual field value will be obtained by taking the
first element from each supplied field value.

complete_documents(self, documents, fields)

Complete the given 'documents' using the 'fields' items list.

complete_selectors(self, selectors, fields, documents, create)

Fill in the given 'selectors' dictionary using the given
'fields' so that it contains mappings from selector names to
parts of the specified 'documents'. If 'create' is set to a
true value, selected elements will be created if not already
present; otherwise, ignore such selectors.

get_selectors(self, fields, documents, create=0)

Get a dictionary containing a mapping of selector names to
selected parts of the given 'documents'. If 'create' is set
to a true value, selected elements will be created if not
already present.

make_documents(self, fields)

Make a dictionary mapping model names to new documents prepared
from the given 'fields' dictionary.

new_document(self, name)

Return an instance root of the given 'name' in a new document.

new_instance(self, name)

Return an instance root of the given 'name' in a new document.

_append_element(self, node, name)

Within 'node' append an element with the given 'name'.

_ensure_elements(self, document, index)

In the given 'document', extend the child elements list
so that a node can be stored at the given 'index'.

_enter_element(self, node, name, index)

From 'node' enter the element with the given 'name' at the
given 'index' position amongst the child elements. Create
missing child elements if necessary.

_find_element(self, node, name, index)

From 'node' find the element with the given 'name' at the
given 'index' position amongst the child elements. Return
None if no such element exists.

_get_model_name_and_components(self, field)

From 'field', return the model name and components which
describe the path within the instance document associated
with that model.

Generated by Epydoc 2.1 on Fri Jan 19 00:38:41 2007 http://epydoc.sf.net