Package s3 :: Module s3track :: Class S3Trackable
[frames] | no frames]

Class S3Trackable

source code

object --+
         |
        S3Trackable

Trackable types instance(s)

Instance Methods
 
__init__(self, table=None, tablename=None, record=None, query=None, record_id=None, record_ids=None, rtable=None)
Constructor:
source code
 
get_location(self, timestmp=None, _fields=None, _filter=None, as_rows=False, exclude=None, empty=True)
Get the current location of the instance(s) (at the given time)
source code
 
set_location(self, location, timestmp=None)
Set the current location of instance(s) (at the given time)
source code
 
check_in(self, table, record, timestmp=None)
Bind the presence of the instance(s) to another instance
source code
 
check_out(self, table=None, record=None, timestmp=None)
Make the last log entry before timestmp independent from the referenced entity (if any)
source code
 
remove_location(self, location=None)
Remove a location from the presence log of the instance(s)
source code
 
get_base_location(self, _fields=None, _filter=None, as_rows=False, empty=True)
Get the base location of the instance(s)
source code
 
set_base_location(self, location=None)
Set the base location of the instance(s)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, table=None, tablename=None, record=None, query=None, record_id=None, record_ids=None, rtable=None)
(Constructor)

source code 

Constructor:

Parameters:
  • table - a Table object
  • tablename - a Str tablename
  • record - a Row object
  • query - a Query object
  • record_id - a record ID (if object is a Table)
  • record_ids - a list of record IDs (if object is a Table)
    • these should be in ascending order
  • rtable - the resource table (for the recursive calls)
Overrides: object.__init__

get_location(self, timestmp=None, _fields=None, _filter=None, as_rows=False, exclude=None, empty=True)

source code 

Get the current location of the instance(s) (at the given time)

Parameters:
  • timestmp - last datetime for presence (defaults to current time)
  • _fields - fields to retrieve from the location records (None for ALL)
  • _filter - filter for the locations
  • as_rows - return the result as Rows object
  • exclude - interlocks to break at (avoids circular check-ins)
  • empty - return None if no locations (set to False by gis.get_location_data())
Returns:
a location record, or a list of location records (if multiple)

To Do: Also show Timestamp of when seen there

set_location(self, location, timestmp=None)

source code 

Set the current location of instance(s) (at the given time)

Parameters:
  • location - the location (as Row or record ID)
  • timestmp - the datetime of the presence (defaults to current time)
Returns:
location

check_in(self, table, record, timestmp=None)

source code 

Bind the presence of the instance(s) to another instance

Parameters:
  • table - table name of the other resource
  • record - record in the other resource (as Row or record ID)
  • timestmp - datetime of the check-in
Returns:
nothing

check_out(self, table=None, record=None, timestmp=None)

source code 

Make the last log entry before timestmp independent from the referenced entity (if any)

Parameters:
  • timestmp - the date/time of the check-out, defaults to current time

remove_location(self, location=None)

source code 

Remove a location from the presence log of the instance(s)

To Do: implement

get_base_location(self, _fields=None, _filter=None, as_rows=False, empty=True)

source code 

Get the base location of the instance(s)

Parameters:
  • _fields - fields to retrieve from the location records (None for ALL)
  • _filter - filter for the locations
  • as_rows - return the result as Rows object
  • empty - return None if no locations (set to False by gis.get_location_data())
Returns:
the base location(s) of the current instance

set_base_location(self, location=None)

source code 

Set the base location of the instance(s)

Parameters:
  • location - the location for the base location as Row or record ID
Returns:
nothing

Note: instance tables without a location_id field will be ignored