Models¶
Ebury Audit models
-
class
audit_tools.audit.models.
Access
(*args, **values)[source]¶ Information gathered from a request and response objects. Contains the following structure:
Variables: - interlink_id – Interlink id.
- request – Request.
- response – Response content, type and status code.
- exception – Exception raised.
- time – Request and response time.
- view – View full_name, app, name, args and kwargs.
- user – User id and name.
- custom – Custom providers field.
- process – Reference to Process object.
-
get_user
()[source]¶ Obtains User object that corresponds to this Access instance.
Returns: User object. Return type: django.contrib.auth.models.User
-
get_view
()[source]¶ Obtains view object that corresponds to this Access instance.
Returns: View. Return type: object
-
is_exception
()[source]¶ Check if this Access contains a exception.
Returns: True if contains exception. Return type: bool
-
is_response
()[source]¶ Check if this Access contains a response.
Returns: True if contains response. Return type: bool
-
url
¶ Property that gives access to request__path field.
Type: str
-
class
audit_tools.audit.models.
Process
(*args, **values)[source]¶ Represents a process that launch a django management command. Contains the following structure:
Variables: - name – Process name.
- args – Process args.
- machine – Machine that launched this process.
- user – User that launched this process.
- pid – Process pid.
- creation_time – Time when process was launched.
-
class
audit_tools.audit.models.
ModelAction
(*args, **values)[source]¶ Information from create, update or delete operations over a model. Contains the following structure:
Variables: - model – Model full_name, app and name.
- action – Create, update or delete action.
- content – Old and new values and changes.
- instance – Instance object id and description.
- timestamp – Time when action occurs.
- access – Reference to Access object.
- process – Reference to Process object.
-
changes
¶ Property that gives access to content__changes field.
Type: dict
-
get_instance
()[source]¶ Obtains instance object that corresponds to this ModelAction instance.
Returns: Instance object. Return type: object