Package coprs :: Module models :: Class Action
[hide private]
[frames] | no frames]

Class Action

source code


Representation of a custom action that needs backends cooperation/admin attention/...

Instance Methods [hide private]
 
__str__(self) source code
 
__unicode__(self) source code
 
to_dict(self, **kwargs)
Usage:
source code

Inherited from helpers.Serializer: serializable_attributes

Class Variables [hide private]
  id = db.Column(db.Integer, primary_key= True)
  action_type = db.Column(db.Integer, nullable= False)
  object_type = db.Column(db.String(20))
  object_id = db.Column(db.Integer)
  old_value = db.Column(db.String(255))
  new_value = db.Column(db.String(255))
  data = db.Column(db.Text)
  result = db.Column(db.Integer, default= helpers.BackendResultE...
  message = db.Column(db.Text)
  created_on = db.Column(db.Integer)
  ended_on = db.Column(db.Integer)
Method Details [hide private]

__str__(self)
(Informal representation operator)

source code 
Overrides: object.__str__
(inherited documentation)

to_dict(self, **kwargs)

source code 

Usage:

SQLAlchObject.to_dict() => returns a flat dict of the object
SQLAlchObject.to_dict({"foo": {}}) => returns a dict of the object
    and will include a flat dict of object foo inside of that
SQLAlchObject.to_dict({"foo": {"bar": {}}, "spam": {}}) => returns
    a dict of the object, which will include dict of foo
    (which will include dict of bar) and dict of spam.

Options can also contain two special values: __columns_only__
and __columns_except__

If present, the first makes only specified fields appear,
the second removes specified fields. Both of these fields
must be either strings (only works for one field) or lists
(for one and more fields).

SQLAlchObject.to_dict({"foo": {"__columns_except__": ["id"]},
    "__columns_only__": "name"}) =>

The SQLAlchObject will only put its "name" into the resulting dict,
while "foo" all of its fields except "id".

Options can also specify whether to include foo_id when displaying
related foo object (__included_ids__, defaults to True).
This doesn"t apply when __columns_only__ is specified.

Overrides: helpers.Serializer.to_dict
(inherited documentation)

Class Variable Details [hide private]

result

Value:
db.Column(db.Integer, default= helpers.BackendResultEnum("waiting"))