Contract

This document provides the API references for the contracts in the database.

API

class models.Contract

A contract is a relationship between entities enrolled in the database. Each contract has a set of contractors (who paid), and contracted (who were paid), and relevant information about the contract.

All the fields of this model are retrieved from Base. Except for base_id and added_date, all entries can be null if they don’t exist in Base. They are:

description

The description of the contract.

price

The price of the contract, in cents (to be an integer).

category

A Foreign key to the contract Category.

contractors

A ManyToMany relationship with entities. Related name “contracts_made”.

contracted

A ManyToMany relationship with entities.

added_date

The date it was added to Base database.

signing_date

The date it was signed.

close_date

The date is was closed. It is normally null.

base_id

The primary key of the contract on the Base database. It is “unique” and can used to create the link to Base (see get_base_url())

contract_type

A Foreign key to one of the types of contracts.

procedure_type

A Foreign key to one of the types of procedures.

contract_description

A text about the object of the contract (i.e. what was bought or sold).

country
district
council

Country, district, council.

This model has a getter:

get_base_url()

Returns the url of this entity in Base.