|
| auto_current_user |
|
| auto_current_user_add |
|
| verbose_name |
|
| name |
|
| default |
|
| required |
|
| validator |
|
| choices |
|
| indexed |
|
| creation_counter |
|
| model_class |
|
|
| data_type = users.User |
|
int | creation_counter = 0 |
|
| data_type = str |
|
def google.appengine.ext.db.UserProperty.__init__ |
( |
|
self, |
|
|
|
verbose_name = None , |
|
|
|
name = None , |
|
|
|
required = False , |
|
|
|
validator = None , |
|
|
|
choices = None , |
|
|
|
auto_current_user = False , |
|
|
|
auto_current_user_add = False , |
|
|
|
indexed = True |
|
) |
| |
Initializes this Property with the given options.
Note: this does *not* support the 'default' keyword argument.
Use auto_current_user_add=True instead.
Args:
verbose_name: User friendly name of property.
name: Storage name for property. By default, uses attribute name
as it is assigned in the Model sub-class.
required: Whether property is required.
validator: User provided method used for validation.
choices: User provided set of valid property values.
auto_current_user: If true, the value is set to the current user
each time the entity is written to the datastore.
auto_current_user_add: If true, the value is set to the current user
the first time the entity is written to the datastore.
indexed: Whether property is indexed.
def google.appengine.ext.db.UserProperty.default_value |
( |
|
self | ) |
|
Default value for user.
Returns:
Value of users.get_current_user() if auto_current_user or
auto_current_user_add is set; else None. (But *not* the default
implementation, since we don't support the 'default' keyword
argument.)
def google.appengine.ext.db.UserProperty.get_updated_value_for_datastore |
( |
|
self, |
|
|
|
model_instance |
|
) |
| |
Get new value for property to send to datastore.
Returns:
Value of users.get_current_user() if auto_current_user is set;
else AUTO_UPDATE_UNCHANGED.
def google.appengine.ext.db.UserProperty.validate |
( |
|
self, |
|
|
|
value |
|
) |
| |
Validate user.
Returns:
A valid value.
Raises:
BadValueError if property is not instance of 'User'.
The documentation for this class was generated from the following file:
- code/googleappengine-read-only/python/google/appengine/ext/db/__init__.py