xia_meta_auth.user.ApiKey
- class xia_meta_auth.user.ApiKey(**kwargs)
Bases:
EmbeddedDocument
- __init__(**kwargs)
Methods
__init__
(**kwargs)from_db
(**kwargs)Transform database data to internal data
from_display
(**kwargs)Transform Display data to internal data
get_display_data
([lazy])Get Display data (visualized form of data)
Get Raw data (materialized form of data)
Get Runtime data (calculated from raw data when runtime is activated)
Get a sample document data
to_db
([ignore_unknown, no_class])Translate the runtime data into raw data (materialized form of data)
validate
()Validate if all of the component of document follows the predefined rules
Attributes
acl
description
domain
expires
hashed_key
- classmethod from_db(**kwargs)
Transform database data to internal data
- Parameters
**kwargs (object) – python dict got from system
- Returns
python dict object
- classmethod from_display(**kwargs)
Transform Display data to internal data
- Parameters
**kwargs (object) – display object got from front end
- Returns
python dict object
- get_display_data(lazy: bool = True)
Get Display data (visualized form of data)
- Returns
python dict object
Notes
We will return the detail form if it is possible
- get_raw_data()
Get Raw data (materialized form of data)
- Returns
python dict object
- get_runtime_data()
Get Runtime data (calculated from raw data when runtime is activated)
- Returns
python dict object
- classmethod get_sample()
Get a sample document data
- to_db(ignore_unknown: bool = False, no_class: bool = False)
Translate the runtime data into raw data (materialized form of data)
- Parameters
no_class (bool) – Don’t save the class name into document
ignore_unknown (bool) – When a field is not defined in the document, should we send it back to the database
- Returns
python dict object
- validate()
Validate if all of the component of document follows the predefined rules
- Returns
Always None. No exception raised means the validation passed