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

Class Zip

source code

object --+            
         |            
     Field --+        
             |        
        String --+    
                 |    
           Pattern --+
                     |
                    Zip

Represents a zip code.
>>> zip = Zip('dummy')
>>> zip.validate('94043')
True
>>> zip.validate('abCD123')
True
>>> zip.validate('123*') != True
True
>>> zip.validate('E6 1EX')
True
>>> zip_pattern = Zip('dummy', complete=False)
>>> zip_pattern.validate('SW*')
True


Instance Methods [hide private]
 
__init__(self, path, complete=True, **kwargs)
Initizlizes a Pattern field.
source code
 
validate(self, data)
Checks if the pattern matches the data.
source code

Inherited from String: data2str, str2data

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 Pattern: pattern

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, complete=True, **kwargs)
(Constructor)

source code 
Initizlizes a Pattern field.
Overrides: Pattern.__init__
(inherited documentation)

validate(self, data)

source code 
Checks if the pattern matches the data.
Decorators:
  • @apply_parent_validation(Pattern, error_prefix= "Zip: ")
Overrides: Pattern.validate
(inherited documentation)