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

Class Pattern

source code

object --+        
         |        
     Field --+    
             |    
        String --+
                 |
                Pattern
Known Subclasses:
Email, IP, LanguageCode, Phone, Url, Zip

A string matching a pattern.

Instance Methods [hide private]
 
__init__(self, path, pattern, **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]
  pattern = None
a regular expression to which a value has to confirm.

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, pattern, **kwargs)
(Constructor)

source code 
Initizlizes a Pattern field.
Parameters:
  • path - Field.path
  • pattern - a regular expression describing the format of the data
Overrides: String.__init__

validate(self, data)

source code 
Checks if the pattern matches the data.
Decorators:
  • @apply_parent_validation(String)
Overrides: String.validate