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

Module gxml

source code

Gchecky.gxml module provides an abstraction layer when dealing with Google Checkout API services (GC API). It translates XML messages into human-friendly python structures and vice versa.

In practice it means that when you have recieved a notification message from GC API, and you want to understand what's in that XML message, you simply pass it to gchecky and it parses (and automatically validates it for you) the XML text into python objects - instances of the class corresponding to the message type. Then that object is passed to your hook method along with extracted google order_id.

For example when an <order-state-change /> XML message is send to you by GC API gchecky will call on_order_state_change passing it an instance of gchecky.gxml.order_state_change_t along with google order_id.

This is very convenient since you don't have to manipulate xml text, or xml DOM tree, neither do you have to validate the recieved message - it is already done by gchecky.

See gchecky.controller module for information on how to provide hooks to the controller or customize it.


Author: etarassov

Version: $Revision: 126 $

Contact: gchecky at gmail

Classes [hide private]
  Field
Holds all the meta-information about mapping the current field value into/from the xml DOM tree.
  NodeManager
The class keeps track of all the subclasses of Node class.
  Node
The base class for any class which represents data that could be mapped into XML DOM structure.
  DocumentManager
Keeps track of all the Document subclasses.
  Document
A Node which could be stored as a standalone xml document.
  List
The field describes a homogene list of values which could be stored as a set of XML nodes with the same tag names.
  Complex
Represents a field which is not a simple POD but a complex data structure.
  String
A field representing a string value.
  Pattern
A string matching a pattern.
  Decimal
  Double
Floating point value
  Boolean
  Long
  Integer
  Url
Note: a 'http://localhost/' does not considered to be a valid url.
  Email
  Html
  LanguageCode
  Phone
  Zip
Represents a zip code.
  IP
Represents an IP address.
  ID
  Any
Any text value.
  Timestamp
Functions [hide private]
 
apply_parent_validation(clazz, error_prefix=None)
Decorator to automatically invoke parent class validation before applying custom validation rules.
source code
Variables [hide private]
  GOOGLE_CHECKOUT_API_XML_SCHEMA = 'http://checkout.google.com/s...
Function Details [hide private]

apply_parent_validation(clazz, error_prefix=None)

source code 
Decorator to automatically invoke parent class validation before applying custom validation rules. Usage:
   class Child(Parent):
       @apply_parent_validation(Child, error_prefix="From Child: ")
       def validate(data):
           # I can assume now that the parent validation method succeeded.
           # ...

Variables Details [hide private]

GOOGLE_CHECKOUT_API_XML_SCHEMA

Value:
'http://checkout.google.com/schema/2'