Difference between revisions of "TruxtonSensitiveSiteList"
(Created page with "This class lets you add list of geographic coordinates that should be alerted on. This will populate the <code>[SensitiveSiteList]</code> table in the database. =Attributes a...") |
|||
| Line 3: | Line 3: | ||
=Attributes and Methods= | =Attributes and Methods= | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
==<code>description</code>== | ==<code>description</code>== | ||
| − | A description of the | + | A description of the list. |
| − | This corresponds to the <code>[Description]</code> column of the <code>[ | + | This corresponds to the <code>[Description]</code> column of the <code>[SensitiveSiteList]</code> table. |
==<code>id</code>== | ==<code>id</code>== | ||
| − | This is the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the | + | This is the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the list. |
| − | + | This corresponds to the <code>[ID]</code> column of the <code>[SensitiveSiteList]</code> table. | |
| − | |||
| − | |||
==<code>name</code>== | ==<code>name</code>== | ||
| − | The name of the | + | The name of the list. |
| − | This corresponds to the <code>[Name]</code> column of the <code>[ | + | This corresponds to the <code>[Name]</code> column of the <code>[SensitiveSiteList]</code> table. |
==<code>picture</code>== | ==<code>picture</code>== | ||
Revision as of 16:47, 29 May 2021
This class lets you add list of geographic coordinates that should be alerted on.
This will populate the [SensitiveSiteList] table in the database.
Contents
Attributes and Methods
description
A description of the list.
This corresponds to the [Description] column of the [SensitiveSiteList] table.
id
This is the GUID of the list.
This corresponds to the [ID] column of the [SensitiveSiteList] table.
name
The name of the list.
This corresponds to the [Name] column of the [SensitiveSiteList] table.
picture
A base64 encoded 300x300 PNG image of the subject.
save()
This will commit the information to the [Suspect] table.
It will return True if the record was saved to the database, False if there was an error.
tag(tag, reason, origin)
This creates a tag associated with this event in Truxton.
The tag parameter is a short, one or two word, bit of text that will be displayed in the UI.
The reason a sentence explaining why this event was tagged.
The origin is either TAG_ORIGIN_AUTOMATIC (1) or TAG_ORIGIN_HUMAN (2).
It will return
True if the tag was associated with the file, False on failure.
Sample
def add_subject():
t = truxton.create()
s = t.newsubject()
s.id = "00138955-133D-D2C1-A9E9-ADFF27FA80F4"
s.name = "Alexander Downer"
s.description = "Australian High Commissioner to the United Kingdom."
s.birthday = ticks("1951-09-09T00:00:00-00:00")
s.picture = b64(SUPPORT_DOCUMENTS_FOLDER + "Images/Alexander Downer.png")
s.save()
s.tag("AUS", "Australia - Friendly Foreign Government", truxton.TAG_ORIGIN_HUMAN)
return
def b64(filename):
with open( filename, "rb" ) as input_file:
data = input_file.read()
return str(base64.b64encode(data))[2:-1]