Package gchecky :: Module gxml :: Class String
[hide private]
[frames] | no frames]

Class String

source code

object --+    
         |    
     Field --+
             |
            String
Known Subclasses:
data.CountryCode, data.PresentOrNot, Pattern, Html, ID

A field representing a string value.

Instance Methods [hide private]
 
__init__(self, path, max_length=None, empty=True, **kwargs)
Specify initial parameters for this field instance.
source code
 
data2str(self, data)
Override this method in subclasses
source code
 
str2data(self, text)
Override this method in subclasses
source code
 
validate(self, data)
Validate data according to this fields parameters.
source code

Inherited from Field: __repr__, create_node_for_path, get_any_node_for_path, get_initial_value, get_nodes_for_path, get_one_node_for_path, load, save

Inherited from Field (private): _traits

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Class Methods [hide private]

Inherited from Field: deconstruct_path, reconstruct_path

Instance Variables [hide private]

Inherited from Field: default, empty, path, required, save_node_and_xml, values

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, path, max_length=None, empty=True, **kwargs)
(Constructor)

source code 
Specify initial parameters for this field instance. The list of actual parameters depends on the subclass.
Overrides: Field.__init__
(inherited documentation)

data2str(self, data)

source code 
Override this method in subclasses
Overrides: Field.data2str
(inherited documentation)

str2data(self, text)

source code 
Override this method in subclasses
Overrides: Field.str2data
(inherited documentation)

validate(self, data)

source code 

Validate data according to this fields parameters.

@return True if data is ok, otherwise return a string (!) describing
        why the data is invalid.

Note that this method returns either True or an error string, not False!

The Field class considers any data as valid and returns True.

Overrides: Field.validate
(inherited documentation)