Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 1 | |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 3 | <html><head><title>Python: module apiclient.ext.appengine</title> |
| 4 | </head><body bgcolor="#f0f0f8"> |
| 5 | |
| 6 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> |
| 7 | <tr bgcolor="#7799ee"> |
| 8 | <td valign=bottom> <br> |
| 9 | <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="apiclient.html"><font color="#ffffff">apiclient</font></a>.<a href="apiclient.ext.html"><font color="#ffffff">ext</font></a>.appengine</strong></big></big></font></td |
| 10 | ><td align=right valign=bottom |
Joe Gregorio | 2401bd6 | 2011-12-15 09:18:49 -0500 | [diff] [blame] | 11 | ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jcgregorio/projects/apiclient-release/apiclient/ext/appengine.py">/home/jcgregorio/projects/apiclient-release/apiclient/ext/appengine.py</a></font></td></tr></table> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 12 | <p><tt>Utilities for Google App Engine<br> |
| 13 | <br> |
| 14 | Utilities for making it easier to use the<br> |
| 15 | Google API Client for Python on Google App Engine.</tt></p> |
| 16 | <p> |
| 17 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 18 | <tr bgcolor="#aa55cc"> |
| 19 | <td colspan=3 valign=bottom> <br> |
| 20 | <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> |
| 21 | |
| 22 | <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> |
| 23 | <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="google.appengine.ext.db.html">google.appengine.ext.db</a><br> |
| 24 | </td><td width="25%" valign=top><a href="pickle.html">pickle</a><br> |
| 25 | </td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p> |
| 26 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 27 | <tr bgcolor="#ee77aa"> |
| 28 | <td colspan=3 valign=bottom> <br> |
| 29 | <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> |
| 30 | |
| 31 | <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> |
| 32 | <td width="100%"><dl> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 33 | <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> |
| 34 | </font></dt><dd> |
| 35 | <dl> |
| 36 | <dt><font face="helvetica, arial"><a href="apiclient.ext.appengine.html#StorageByKeyName">StorageByKeyName</a> |
| 37 | </font></dt></dl> |
| 38 | </dd> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 39 | <dt><font face="helvetica, arial"><a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>(<a href="__builtin__.html#object">__builtin__.object</a>) |
| 40 | </font></dt><dd> |
| 41 | <dl> |
| 42 | <dt><font face="helvetica, arial"><a href="apiclient.ext.appengine.html#FlowThreeLeggedProperty">FlowThreeLeggedProperty</a> |
| 43 | </font></dt><dt><font face="helvetica, arial"><a href="apiclient.ext.appengine.html#OAuthCredentialsProperty">OAuthCredentialsProperty</a> |
| 44 | </font></dt></dl> |
| 45 | </dd> |
| 46 | </dl> |
| 47 | <p> |
| 48 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 49 | <tr bgcolor="#ffc8d8"> |
| 50 | <td colspan=3 valign=bottom> <br> |
| 51 | <font color="#000000" face="helvetica, arial"><a name="FlowThreeLeggedProperty">class <strong>FlowThreeLeggedProperty</strong></a>(<a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>)</font></td></tr> |
| 52 | |
| 53 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 54 | <td colspan=2><tt>Utility property that allows easy<br> |
| 55 | storage and retreival of an<br> |
| 56 | apiclient.oauth.FlowThreeLegged<br> </tt></td></tr> |
| 57 | <tr><td> </td> |
| 58 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 59 | <dd><a href="apiclient.ext.appengine.html#FlowThreeLeggedProperty">FlowThreeLeggedProperty</a></dd> |
| 60 | <dd><a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a></dd> |
| 61 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 62 | </dl> |
| 63 | <hr> |
| 64 | Methods defined here:<br> |
| 65 | <dl><dt><a name="FlowThreeLeggedProperty-empty"><strong>empty</strong></a>(self, value)</dt></dl> |
| 66 | |
| 67 | <dl><dt><a name="FlowThreeLeggedProperty-get_value_for_datastore"><strong>get_value_for_datastore</strong></a>(self, model_instance)</dt><dd><tt># For writing to datastore.</tt></dd></dl> |
| 68 | |
| 69 | <dl><dt><a name="FlowThreeLeggedProperty-make_value_from_datastore"><strong>make_value_from_datastore</strong></a>(self, value)</dt><dd><tt># For reading from datastore.</tt></dd></dl> |
| 70 | |
| 71 | <dl><dt><a name="FlowThreeLeggedProperty-validate"><strong>validate</strong></a>(self, value)</dt></dl> |
| 72 | |
| 73 | <hr> |
| 74 | Data and other attributes defined here:<br> |
| 75 | <dl><dt><strong>data_type</strong> = <class 'apiclient.oauth.FlowThreeLegged'><dd><tt>Does the Three Legged Dance for OAuth 1.0a.</tt></dl> |
| 76 | |
| 77 | <hr> |
| 78 | Methods inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br> |
| 79 | <dl><dt><a name="FlowThreeLeggedProperty-__get__"><strong>__get__</strong></a>(self, model_instance, model_class)</dt><dd><tt>Returns the value for this property on the given model instance.<br> |
| 80 | <br> |
| 81 | See <a href="http://docs.python.org/ref/descriptors.html">http://docs.python.org/ref/descriptors.html</a> for a description of<br> |
| 82 | the arguments to this class and what they mean.</tt></dd></dl> |
| 83 | |
| 84 | <dl><dt><a name="FlowThreeLeggedProperty-__init__"><strong>__init__</strong></a>(self, verbose_name<font color="#909090">=None</font>, name<font color="#909090">=None</font>, default<font color="#909090">=None</font>, required<font color="#909090">=False</font>, validator<font color="#909090">=None</font>, choices<font color="#909090">=None</font>, indexed<font color="#909090">=True</font>)</dt><dd><tt>Initializes this <a href="google.appengine.ext.db.html#Property">Property</a> with the given options.<br> |
| 85 | <br> |
| 86 | Args:<br> |
| 87 | verbose_name: User friendly name of property.<br> |
| 88 | name: Storage name for property. By default, uses attribute name<br> |
| 89 | as it is assigned in the Model sub-class.<br> |
| 90 | default: Default value for property if none is assigned.<br> |
| 91 | required: Whether property is required.<br> |
| 92 | validator: User provided method used for validation.<br> |
| 93 | choices: User provided set of valid property values.<br> |
| 94 | indexed: Whether property is indexed.</tt></dd></dl> |
| 95 | |
| 96 | <dl><dt><a name="FlowThreeLeggedProperty-__property_config__"><strong>__property_config__</strong></a>(self, model_class, property_name)</dt><dd><tt>Configure property, connecting it to its model.<br> |
| 97 | <br> |
| 98 | Configure the property so that it knows its property name and what class<br> |
| 99 | it belongs to.<br> |
| 100 | <br> |
| 101 | Args:<br> |
| 102 | model_class: Model class which <a href="google.appengine.ext.db.html#Property">Property</a> will belong to.<br> |
| 103 | property_name: Name of property within Model instance to store property<br> |
| 104 | values in. By default this will be the property name preceded by<br> |
| 105 | an underscore, but may change for different subclasses.</tt></dd></dl> |
| 106 | |
| 107 | <dl><dt><a name="FlowThreeLeggedProperty-__set__"><strong>__set__</strong></a>(self, model_instance, value)</dt><dd><tt>Sets the value for this property on the given model instance.<br> |
| 108 | <br> |
| 109 | See <a href="http://docs.python.org/ref/descriptors.html">http://docs.python.org/ref/descriptors.html</a> for a description of<br> |
| 110 | the arguments to this class and what they mean.</tt></dd></dl> |
| 111 | |
| 112 | <dl><dt><a name="FlowThreeLeggedProperty-datastore_type"><strong>datastore_type</strong></a>(self)</dt><dd><tt>Deprecated backwards-compatible accessor method for self.<strong>data_type</strong>.</tt></dd></dl> |
| 113 | |
| 114 | <dl><dt><a name="FlowThreeLeggedProperty-default_value"><strong>default_value</strong></a>(self)</dt><dd><tt>Default value for unassigned values.<br> |
| 115 | <br> |
| 116 | Returns:<br> |
| 117 | Default value as provided by <a href="#FlowThreeLeggedProperty-__init__">__init__</a>(default).</tt></dd></dl> |
| 118 | |
Joe Gregorio | 2401bd6 | 2011-12-15 09:18:49 -0500 | [diff] [blame] | 119 | <dl><dt><a name="FlowThreeLeggedProperty-get_updated_value_for_datastore"><strong>get_updated_value_for_datastore</strong></a>(self, model_instance)</dt><dd><tt>Determine new value for auto-updated property.<br> |
| 120 | <br> |
| 121 | Some properies (e.g. DateTimeProperty, UserProperty) optionally update their<br> |
| 122 | value on every put(). This call must return the new desired value for such<br> |
| 123 | properties. For all other properties, this call must return<br> |
| 124 | AUTO_UPDATE_UNCHANGED.<br> |
| 125 | <br> |
| 126 | Args:<br> |
| 127 | model_instance: Instance to get new value for.<br> |
| 128 | <br> |
| 129 | Returns:<br> |
| 130 | Datastore representation of the new model value in a form that is<br> |
| 131 | appropriate for storing in the datastore, or AUTO_UPDATE_UNCHANGED.</tt></dd></dl> |
| 132 | |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 133 | <hr> |
| 134 | Data descriptors inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br> |
| 135 | <dl><dt><strong>__dict__</strong></dt> |
| 136 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 137 | </dl> |
| 138 | <dl><dt><strong>__weakref__</strong></dt> |
| 139 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 140 | </dl> |
| 141 | <hr> |
| 142 | Data and other attributes inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br> |
| 143 | <dl><dt><strong>creation_counter</strong> = 0</dl> |
| 144 | |
| 145 | </td></tr></table> <p> |
| 146 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 147 | <tr bgcolor="#ffc8d8"> |
| 148 | <td colspan=3 valign=bottom> <br> |
| 149 | <font color="#000000" face="helvetica, arial"><a name="OAuthCredentialsProperty">class <strong>OAuthCredentialsProperty</strong></a>(<a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>)</font></td></tr> |
| 150 | |
| 151 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 152 | <td colspan=2><tt>Utility property that allows easy<br> |
| 153 | storage and retrieval of<br> |
| 154 | apiclient.oath.OAuthCredentials<br> </tt></td></tr> |
| 155 | <tr><td> </td> |
| 156 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 157 | <dd><a href="apiclient.ext.appengine.html#OAuthCredentialsProperty">OAuthCredentialsProperty</a></dd> |
| 158 | <dd><a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a></dd> |
| 159 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 160 | </dl> |
| 161 | <hr> |
| 162 | Methods defined here:<br> |
| 163 | <dl><dt><a name="OAuthCredentialsProperty-empty"><strong>empty</strong></a>(self, value)</dt></dl> |
| 164 | |
| 165 | <dl><dt><a name="OAuthCredentialsProperty-get_value_for_datastore"><strong>get_value_for_datastore</strong></a>(self, model_instance)</dt><dd><tt># For writing to datastore.</tt></dd></dl> |
| 166 | |
| 167 | <dl><dt><a name="OAuthCredentialsProperty-make_value_from_datastore"><strong>make_value_from_datastore</strong></a>(self, value)</dt><dd><tt># For reading from datastore.</tt></dd></dl> |
| 168 | |
| 169 | <dl><dt><a name="OAuthCredentialsProperty-validate"><strong>validate</strong></a>(self, value)</dt></dl> |
| 170 | |
| 171 | <hr> |
| 172 | Data and other attributes defined here:<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 173 | <dl><dt><strong>data_type</strong> = <class 'apiclient.oauth.OAuthCredentials'><dd><tt>Credentials <a href="__builtin__.html#object">object</a> for OAuth 1.0a</tt></dl> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 174 | |
| 175 | <hr> |
| 176 | Methods inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br> |
| 177 | <dl><dt><a name="OAuthCredentialsProperty-__get__"><strong>__get__</strong></a>(self, model_instance, model_class)</dt><dd><tt>Returns the value for this property on the given model instance.<br> |
| 178 | <br> |
| 179 | See <a href="http://docs.python.org/ref/descriptors.html">http://docs.python.org/ref/descriptors.html</a> for a description of<br> |
| 180 | the arguments to this class and what they mean.</tt></dd></dl> |
| 181 | |
| 182 | <dl><dt><a name="OAuthCredentialsProperty-__init__"><strong>__init__</strong></a>(self, verbose_name<font color="#909090">=None</font>, name<font color="#909090">=None</font>, default<font color="#909090">=None</font>, required<font color="#909090">=False</font>, validator<font color="#909090">=None</font>, choices<font color="#909090">=None</font>, indexed<font color="#909090">=True</font>)</dt><dd><tt>Initializes this <a href="google.appengine.ext.db.html#Property">Property</a> with the given options.<br> |
| 183 | <br> |
| 184 | Args:<br> |
| 185 | verbose_name: User friendly name of property.<br> |
| 186 | name: Storage name for property. By default, uses attribute name<br> |
| 187 | as it is assigned in the Model sub-class.<br> |
| 188 | default: Default value for property if none is assigned.<br> |
| 189 | required: Whether property is required.<br> |
| 190 | validator: User provided method used for validation.<br> |
| 191 | choices: User provided set of valid property values.<br> |
| 192 | indexed: Whether property is indexed.</tt></dd></dl> |
| 193 | |
| 194 | <dl><dt><a name="OAuthCredentialsProperty-__property_config__"><strong>__property_config__</strong></a>(self, model_class, property_name)</dt><dd><tt>Configure property, connecting it to its model.<br> |
| 195 | <br> |
| 196 | Configure the property so that it knows its property name and what class<br> |
| 197 | it belongs to.<br> |
| 198 | <br> |
| 199 | Args:<br> |
| 200 | model_class: Model class which <a href="google.appengine.ext.db.html#Property">Property</a> will belong to.<br> |
| 201 | property_name: Name of property within Model instance to store property<br> |
| 202 | values in. By default this will be the property name preceded by<br> |
| 203 | an underscore, but may change for different subclasses.</tt></dd></dl> |
| 204 | |
| 205 | <dl><dt><a name="OAuthCredentialsProperty-__set__"><strong>__set__</strong></a>(self, model_instance, value)</dt><dd><tt>Sets the value for this property on the given model instance.<br> |
| 206 | <br> |
| 207 | See <a href="http://docs.python.org/ref/descriptors.html">http://docs.python.org/ref/descriptors.html</a> for a description of<br> |
| 208 | the arguments to this class and what they mean.</tt></dd></dl> |
| 209 | |
| 210 | <dl><dt><a name="OAuthCredentialsProperty-datastore_type"><strong>datastore_type</strong></a>(self)</dt><dd><tt>Deprecated backwards-compatible accessor method for self.<strong>data_type</strong>.</tt></dd></dl> |
| 211 | |
| 212 | <dl><dt><a name="OAuthCredentialsProperty-default_value"><strong>default_value</strong></a>(self)</dt><dd><tt>Default value for unassigned values.<br> |
| 213 | <br> |
| 214 | Returns:<br> |
| 215 | Default value as provided by <a href="#OAuthCredentialsProperty-__init__">__init__</a>(default).</tt></dd></dl> |
| 216 | |
Joe Gregorio | 2401bd6 | 2011-12-15 09:18:49 -0500 | [diff] [blame] | 217 | <dl><dt><a name="OAuthCredentialsProperty-get_updated_value_for_datastore"><strong>get_updated_value_for_datastore</strong></a>(self, model_instance)</dt><dd><tt>Determine new value for auto-updated property.<br> |
| 218 | <br> |
| 219 | Some properies (e.g. DateTimeProperty, UserProperty) optionally update their<br> |
| 220 | value on every put(). This call must return the new desired value for such<br> |
| 221 | properties. For all other properties, this call must return<br> |
| 222 | AUTO_UPDATE_UNCHANGED.<br> |
| 223 | <br> |
| 224 | Args:<br> |
| 225 | model_instance: Instance to get new value for.<br> |
| 226 | <br> |
| 227 | Returns:<br> |
| 228 | Datastore representation of the new model value in a form that is<br> |
| 229 | appropriate for storing in the datastore, or AUTO_UPDATE_UNCHANGED.</tt></dd></dl> |
| 230 | |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 231 | <hr> |
| 232 | Data descriptors inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br> |
| 233 | <dl><dt><strong>__dict__</strong></dt> |
| 234 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 235 | </dl> |
| 236 | <dl><dt><strong>__weakref__</strong></dt> |
| 237 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 238 | </dl> |
| 239 | <hr> |
| 240 | Data and other attributes inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br> |
| 241 | <dl><dt><strong>creation_counter</strong> = 0</dl> |
| 242 | |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 243 | </td></tr></table> <p> |
| 244 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 245 | <tr bgcolor="#ffc8d8"> |
| 246 | <td colspan=3 valign=bottom> <br> |
| 247 | <font color="#000000" face="helvetica, arial"><a name="StorageByKeyName">class <strong>StorageByKeyName</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| 248 | |
| 249 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 250 | <td colspan=2><tt>Store and retrieve a single credential to and from<br> |
| 251 | the App Engine datastore.<br> |
| 252 | <br> |
| 253 | This Storage helper presumes the Credentials<br> |
| 254 | have been stored as a CredenialsProperty<br> |
| 255 | on a datastore model class, and that entities<br> |
| 256 | are stored by key_name.<br> </tt></td></tr> |
| 257 | <tr><td> </td> |
| 258 | <td width="100%">Methods defined here:<br> |
| 259 | <dl><dt><a name="StorageByKeyName-__init__"><strong>__init__</strong></a>(self, model, key_name, property_name)</dt><dd><tt>Constructor for Storage.<br> |
| 260 | <br> |
| 261 | Args:<br> |
| 262 | model: db.Model, model class<br> |
| 263 | key_name: string, key name for the entity that has the credentials<br> |
| 264 | property_name: string, name of the property that is a CredentialsProperty</tt></dd></dl> |
| 265 | |
| 266 | <dl><dt><a name="StorageByKeyName-get"><strong>get</strong></a>(self)</dt><dd><tt>Retrieve Credential from datastore.<br> |
| 267 | <br> |
| 268 | Returns:<br> |
| 269 | Credentials</tt></dd></dl> |
| 270 | |
| 271 | <dl><dt><a name="StorageByKeyName-put"><strong>put</strong></a>(self, credentials)</dt><dd><tt>Write a Credentials to the datastore.<br> |
| 272 | <br> |
| 273 | Args:<br> |
| 274 | credentials: Credentials, the credentials to store.</tt></dd></dl> |
| 275 | |
| 276 | <hr> |
| 277 | Data descriptors defined here:<br> |
| 278 | <dl><dt><strong>__dict__</strong></dt> |
| 279 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 280 | </dl> |
| 281 | <dl><dt><strong>__weakref__</strong></dt> |
| 282 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 283 | </dl> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 284 | </td></tr></table></td></tr></table><p> |
| 285 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 286 | <tr bgcolor="#55aa55"> |
| 287 | <td colspan=3 valign=bottom> <br> |
| 288 | <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> |
| 289 | |
| 290 | <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> |
| 291 | <td width="100%"><strong>__author__</strong> = 'jcgregorio@google.com (Joe Gregorio)'</td></tr></table><p> |
| 292 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 293 | <tr bgcolor="#7799ee"> |
| 294 | <td colspan=3 valign=bottom> <br> |
| 295 | <font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr> |
| 296 | |
| 297 | <tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td> |
| 298 | <td width="100%">jcgregorio@google.com (Joe Gregorio)</td></tr></table> |
| 299 | </body></html> |