Models

../_images/Models.png

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
items()[source]

List items in form (key, value).

Returns:list(tuple())
url

Property that gives access to request__path field.

Type:str
verbose_str()[source]

Verbose string representation.

Returns:Verbose string representation.
Return 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.
items()[source]

List items in form (key, value).

Returns:list(tuple())
verbose_str()[source]

Verbose string representation.

Returns:Verbose string representation.
Return type:str
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
get_model()[source]

Obtains Model class that corresponds to this ModelAction instance.

Returns:Model class.
Return type:object
items()[source]

List items in form (key, value).

Returns:list(tuple())
verbose_str()[source]

Verbose string representation.

Returns:Verbose string representation.
Return type:str