Difference between revisions of "TruxtonJurisdiction"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "This class lets you add to the <code>Jurisdiction</code> table in Truxton. =Attributes and Methods= ==<code>id</code>== An 64-bit integer value for the jurisdiction. ==<code...")
 
Line 1: Line 1:
This class lets you add to the <code>Jurisdiction</code> table in Truxton.
+
This class lets you add to the <code>[Jurisdiction]</code> table in Truxton.
  
 
=Attributes and Methods=
 
=Attributes and Methods=
Line 12: Line 12:
  
 
==<code>save()</code>==
 
==<code>save()</code>==
This will commit the information to the <code>Jurisdiction</code> table.
+
This will commit the information to the <code>[Jurisdiction]</code> table.
 
It will return [https://docs.python.org/3/library/constants.html#True True] if the record was saved to the database, [https://docs.python.org/3/library/constants.html#False False] if there was an error.
 
It will return [https://docs.python.org/3/library/constants.html#True True] if the record was saved to the database, [https://docs.python.org/3/library/constants.html#False False] if there was an error.
  
 
=Sample=
 
=Sample=
 
+
<source lang="Python" highlight="6-10">
<syntaxhighlight lang="Python" highlight="6-10">
 
 
import truxton
 
import truxton
  
Line 41: Line 40:
 
if __name__ == "__main__":
 
if __name__ == "__main__":
 
   main()
 
   main()
</syntaxhighlight>
+
</source>

Revision as of 07:26, 8 December 2020

This class lets you add to the [Jurisdiction] table in Truxton.

Attributes and Methods

id

An 64-bit integer value for the jurisdiction.

name

A human readable label for the jurisdiction.

description

A longer description of the jurisdiction.

save()

This will commit the information to the [Jurisdiction] table. It will return True if the record was saved to the database, False if there was an error.

Sample

import truxton

def main():
  t = truxton.create()

  jurisdiction = t.newjurisdiction();
  jurisdiction.id = 100
  jurisdiction.name = "DOJ-DC"
  jurisdiction.description = "Justice Department DC Headquarters"
  jurisdiction.save()

  investigation = t.newinvestigation()

  investigation.name = "Collusion"
  investigation.description = "United States vs. Michael Flynn"
  investigation.case = "DC-SNAFU-2016.2020"
  investigation.jurisdiction = jurisdiction.id
  investigation.status = truxton.INVESTIGATION_STATUS_OPEN
  investigation.type = truxton.INVESTIGATION_TYPE_FRAUD
  investigation.save()

if __name__ == "__main__":
  main()