seshat.apps.core.models

Attributes

AA

AP

APS

AS

A_TO_P

Certainty

NFY

POLITY_TAG_CHOICES

PP

PS

P_TO_A

Tags

U

UU

WORLD_REGION_CHOICES

Classes

Capital

Model representing a capital.

Citation

Model representing a specific citation.

Cliopatria

Model representing Cliopatria polity borders dataset.

Country

Model representing a country.

GADMCountries

Model representing a country (GADM).

GADMProvinces

Model representing a province (GADM).

GADMShapefile

Macro_region

Model representing a macro region.

Nga

Model representing a NGA.

Ngapolityrel

Model representing a relationship between a NGA and a polity.

Polity

Model representing a polity.

Reference

Model Representing a reference.

Religion

Model representing a religion.

ScpThroughCtn

Model representing a through model for the many-to-many relationship between

Section

Model representing a section.

SeshatComment

Model representing a comment.

SeshatCommentPart

Model representing a part of a comment.

SeshatCommon

Model representing a common Seshat model.

SeshatPrivateComment

Model representing a private comment.

SeshatPrivateCommentPart

Model representing a part of a private comment.

Seshat_region

Model representing a Seshat region.

Subsection

Model representing a subsection.

Variablehierarchy

Model representing a variable hierarchy.

Functions

give_me_a_color_for_expert(value)

Returns a color for a given expert.

return_citations_for_comments(self)

This function is used to return the citations of the model instance

return_citations_plus_for_comments(self)

Returns a string of all the citations for a comment.

return_number_of_citations_for_comments(self)

Returns the number of citations for a comment.

return_number_of_citations_plus_for_comments(self)

Returns the number of citations for a comment.

Module Contents

class seshat.apps.core.models.Capital

Bases: django.contrib.gis.db.models.Model

Model representing a capital.

class Meta
Noindex:

ordering = ['is_verified']
get_absolute_url()

Returns the url to access a particular instance of the model.

Noindex:

Returns:

A string of the url to access a particular instance of the model.

Return type:

str

alternative_names
current_country
is_verified
latitude
longitude
name
note
url_on_the_map
year_from
year_to
class seshat.apps.core.models.Citation

Bases: django.contrib.gis.db.models.Model

Model representing a specific citation.

class Meta
Noindex:

constraints
ordering = ['-modified_date']
full_citation_display()

Returns a string of the full citation. If the citation has a title, it is included in the string. If the citation has a creator, it is included in the string. If the citation has a year, it is included in the string. If the citation has a page_from, it is included in the string. If the citation has a page_to, it is included in the string.

Returns:

A string of the full citation.

Return type:

str

get_absolute_url()

Returns the url to access a particular instance of the model.

Noindex:

Returns:

A string of the url to access a particular instance of the model.

Return type:

str

save(*args, **kwargs)

Saves the citation to the database.

Parameters:
  • *args – Additional arguments.

  • **kwargs – Additional keyword arguments.

Raises:

IntegrityError – If the citation cannot be saved to the database.

Returns:

None

zoteroer()

Returns the Zotero link for the citation.

Returns:

The Zotero link for the citation.

Return type:

str

property citation_short_title
Returns a short title for the citation. If the title is longer than
40 characters, it is truncated. If the title is not provided, a default
title is returned.
Returns:

A short title for the citation.

Return type:

str

created_date
id
modified_date
page_from
page_to
ref
class seshat.apps.core.models.Cliopatria

Bases: django.contrib.gis.db.models.Model

Model representing Cliopatria polity borders dataset.

area
colour
components
end_year
geom
id
member_of
name
polity_end_year
polity_start_year
seshat_id
simplified_geom
start_year
wikipedia_name
class seshat.apps.core.models.Country

Bases: django.contrib.gis.db.models.Model

Model representing a country.

class Meta
Noindex:

unique_together = ('name',)
verbose_name = 'country'
verbose_name_plural = 'countries'
name
polity
class seshat.apps.core.models.GADMCountries

Bases: django.contrib.gis.db.models.Model

Model representing a country (GADM).

COUNTRY
geom
class seshat.apps.core.models.GADMProvinces

Bases: django.contrib.gis.db.models.Model

Model representing a province (GADM).

COUNTRY
ENGTYPE_1
NAME_1
geom
class seshat.apps.core.models.GADMShapefile

Bases: django.contrib.gis.db.models.Model

CC_1
CC_2
CC_3
CC_4
CC_5
CONTINENT
COUNTRY
DISPUTEDBY
ENGTYPE_1
ENGTYPE_2
ENGTYPE_3
ENGTYPE_4
ENGTYPE_5
GID_0
GID_1
GID_2
GID_3
GID_4
GID_5
GOVERNEDBY
HASC_1
HASC_2
HASC_3
ISO_1
NAME_0
NAME_1
NAME_2
NAME_3
NAME_4
NAME_5
NL_NAME_1
NL_NAME_2
NL_NAME_3
REGION
SOVEREIGN
SUBCONT
TYPE_1
TYPE_2
TYPE_3
TYPE_4
TYPE_5
UID
VALIDFR_1
VALIDFR_2
VALIDFR_3
VALIDFR_4
VARNAME_0
VARNAME_1
VARNAME_2
VARNAME_3
VARNAME_4
VARREGION
geom
class seshat.apps.core.models.Macro_region

Bases: django.contrib.gis.db.models.Model

Model representing a macro region.

class Meta
Noindex:

ordering = ['name']
name
class seshat.apps.core.models.Nga

Bases: django.contrib.gis.db.models.Model

Model representing a NGA.

class Meta
Noindex:

ordering = ['name']
get_absolute_url()

Returns the url to access a particular instance of the model.

Noindex:

Returns:

A string of the url to access a particular instance of the model.

Return type:

str

capital_city
fao_country
latitude
longitude
name
nga_code
subregion
world_region
class seshat.apps.core.models.Ngapolityrel

Bases: django.contrib.gis.db.models.Model

Model representing a relationship between a NGA and a polity.

is_home_nga
name
nga_party
polity_party
year_from
year_to
class seshat.apps.core.models.Polity

Bases: django.contrib.gis.db.models.Model

Model representing a polity.

class Meta
Noindex:

ordering = ['long_name']
unique_together = ('name',)
verbose_name = 'polity'
verbose_name_plural = 'polities'
clean()

Verifies a number of conditions on the start and end years of the polity.

Raises:
  • ValidationError – If the start year is greater than the end year.

  • ValidationError – If the end year is greater than the current year.

  • ValidationError – If the start year is greater than the current year.

Returns:

None

created_date
end_year
general_description
home_nga
home_seshat_region
long_name
modified_date
name
new_name
polity_tag
private_comment
private_comment_n
shapefile_name
start_year
class seshat.apps.core.models.Reference

Bases: django.contrib.gis.db.models.Model

Model Representing a reference.

class Meta
Noindex:

ordering = ['-created_date', 'title']
unique_together = ('zotero_link',)
get_absolute_url()

Returns the url to access a particular instance of the model.

Noindex:

Returns:

A string of the url to access a particular instance of the model.

Return type:

str

created_date
creator
item_type
long_name
modified_date
property reference_short_title
Returns a short title for the reference. If the title is longer than
60 characters, it is truncated. If the title is not provided, a default
title is returned.
Returns:

A short title for the reference.

Return type:

str

title
year
class seshat.apps.core.models.Religion

Bases: django.contrib.gis.db.models.Model

Model representing a religion.

class Meta
Noindex:

ordering = ['name']
name
religion_family
religion_genus
religion_name
class seshat.apps.core.models.ScpThroughCtn

Bases: django.contrib.gis.db.models.Model

Model representing a through model for the many-to-many relationship between a comment part and a citation.

citation
parent_paragraphs
seshatcommentpart
class seshat.apps.core.models.Section

Bases: django.contrib.gis.db.models.Model

Model representing a section.

class Meta
Noindex:

unique_together = ('name',)
name
class seshat.apps.core.models.SeshatComment

Bases: django.contrib.gis.db.models.Model

Model representing a comment.

get_absolute_url()

Returns the url to access a particular instance of the model.

Noindex:

Returns:

A string of the url to access a particular instance of the model.

Return type:

str

zoteroer()

Returns the Zotero link for the comment.

Returns:

The Zotero link for the comment.

Return type:

str

text
class seshat.apps.core.models.SeshatCommentPart

Bases: django.contrib.gis.db.models.Model

Model representing a part of a comment.

class Meta
Noindex:

ordering = ['comment_order', 'modified_date']
get_absolute_url()

Returns the url to access a particular instance of the model.

Noindex:

Returns:

A string of the url to access a particular instance of the model.

Return type:

str

citation_index
property citations_count
Returns the number of citations for a comment.
Returns:

The number of citations for a comment.

Return type:

int

property citations_count_plus
Returns the number of citations for a comment.
Returns:

The number of citations for a comment.

Return type:

int

comment
comment_citations
comment_citations_plus
comment_curator
comment_order
comment_part_text
property display_citations
Display the citations of the model instance.
Noindex:

Note

The method is a property, and an alias for the return_citations_for_comments function.

Returns:

The citations of the model instance, separated by comma.

Return type:

str

property display_citations_plus
Returns a string of all the citations for a comment.
Noindex:

Note

The method is a property, and an alias for the return_citations_for_comments function.

Returns:

A string of all the citations for a comment.

Return type:

str

modified_date
class seshat.apps.core.models.SeshatCommon

Bases: django.contrib.gis.db.models.Model

Model representing a common Seshat model.

class Meta
Noindex:

abstract = True
ordering = ['polity']
citations
comment
created_date
curator
description
drb_reviewed
expert_reviewed
finalized
is_disputed
is_uncertain
modified_date
name
note
polity
private_comment
tag
year_from
year_to
class seshat.apps.core.models.SeshatPrivateComment

Bases: django.contrib.gis.db.models.Model

Model representing a private comment.

get_absolute_url()

Returns the url to access a particular instance of the model.

Noindex:

Returns:

A string of the url to access a particular instance of the model.

Return type:

str

text
class seshat.apps.core.models.SeshatPrivateCommentPart

Bases: django.contrib.gis.db.models.Model

Model representing a part of a private comment.

class Meta
Noindex:

ordering = ['created_date', 'last_modified_date']
get_absolute_url()

Returns the url to access a particular instance of the model.

Noindex:

Returns:

A string of the url to access a particular instance of the model.

Return type:

str

created_date
is_done
last_modified_date
private_comment
private_comment_owner
private_comment_part_text
private_comment_reader
class seshat.apps.core.models.Seshat_region

Bases: django.contrib.gis.db.models.Model

Model representing a Seshat region.

class Meta
Noindex:

ordering = ['mac_region__name', 'name']
mac_region
name
subregions_list
class seshat.apps.core.models.Subsection

Bases: django.contrib.gis.db.models.Model

Model representing a subsection.

class Meta
Noindex:

unique_together = ('name', 'section')
name
section
class seshat.apps.core.models.Variablehierarchy

Bases: django.contrib.gis.db.models.Model

Model representing a variable hierarchy.

class Meta
Noindex:

unique_together = ('name', 'section', 'subsection')
explanation
is_verified
name
section
subsection
seshat.apps.core.models.give_me_a_color_for_expert(value)

Returns a color for a given expert.

Parameters:

value (int) – The id of the expert.

Returns:

A color for the expert.

Return type:

str

seshat.apps.core.models.return_citations_for_comments(self)

This function is used to return the citations of the model instance (returning the value used in the display_citations method of the model instance).

Note

The model instance must have the following attribute: - citations

The model instance must have the following methods: - zoteroer

Parameters:

self (model instance) – The model instance.

Returns:

The citations of the model instance, separated by comma.

Return type:

str

seshat.apps.core.models.return_citations_plus_for_comments(self)

Returns a string of all the citations for a comment.

Returns:

A string of all the citations for a comment.

Return type:

str

seshat.apps.core.models.return_number_of_citations_for_comments(self)

Returns the number of citations for a comment.

Returns:

The number of citations for a comment.

Return type:

int

seshat.apps.core.models.return_number_of_citations_plus_for_comments(self)

Returns the number of citations for a comment.

Returns:

The number of citations for a comment.

Return type:

int

seshat.apps.core.models.AA = 'A'
seshat.apps.core.models.AP = 'A;P'
seshat.apps.core.models.APS = 'A;P*'
seshat.apps.core.models.AS = 'A*'
seshat.apps.core.models.A_TO_P = 'A~P'
seshat.apps.core.models.Certainty
seshat.apps.core.models.NFY = 'NFY'
seshat.apps.core.models.POLITY_TAG_CHOICES = (('LEGACY', 'Equinox 2020 Polities'), ('POL_AFR_EAST', 'NEW East African Polities'),...
seshat.apps.core.models.PP = 'P'
seshat.apps.core.models.PS = 'P*'
seshat.apps.core.models.P_TO_A = 'P~A'
seshat.apps.core.models.Tags = (('TRS', 'Confident'), ('SSP', 'Suspected'), ('IFR', 'Inferred'))
seshat.apps.core.models.U = 'U'
seshat.apps.core.models.UU = 'U*'
seshat.apps.core.models.WORLD_REGION_CHOICES = (('Europe', 'Europe'), ('Southwest Asia', 'Southwest Asia'), ('Africa', 'Africa'), ('Central...