Models

Django models are the basis of Jangle, and are used to represent various standards, tags, and subtags.

More information on submodules, including querysets and managers:

Note

Sphinx autodoc uses Django’s docstrings for fields and other attributes generated by Django. I’m working to exclude and override these with empty docstrings, but there are still some weird docstrings floating around. You’ll know when you see them.

class jangle.models.SimpleISOLanguageCollection(*args, **kwargs)[source]

Basic data for an ISO 639-5 language collection.

part_5

ISO 639-5 alpha-3 code.

names_en

English names. Separated with “;” if multiple exist.

names_fr

French names. Separated with “;” if multiple exist.

property loc_uri: str

URI on the Library of Congress. Contains MADS/SKOS RDF data.

property ietf: str

Code used in IETF language tags.

objects = <jangle.models.languages.SimpleISOLanguageCollectionManager object>
subtag

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

class jangle.models.ISOLanguageCodes(*args, **kwargs)[source]

ISO 639-2 and 639-1 language codeset, saved from the Library of Congress.

language: Optional[ISOLanguage]
part_2b

Bibliographic code (ISO 639-2/B).

part_2t

Terminological code (ISO 639-2/T).

part_1

Alpha-2 code (ISO 639-1).

names_en

English names. Separated with “;” if multiple exist.

names_fr

French names. Separated with “;” if multiple exist.

property ietf: str

Code used in IETF language tags.

objects = <jangle.models.languages.ISOLanguageCodesManager object>
subtag

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

class jangle.models.ISOLanguage(*args, **kwargs)[source]

Represents an ISO 639-3 language, saved from SIL international

class LanguageType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
ANCIENT = 'A'
CONSTRUCTED = 'C'
EXTINCT = 'E'
HISTORICAL = 'H'
LIVING = 'L'
SPECIAL = 'S'
class Scope(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
INDIVIDUAL = 'I'
MACROLANGUAGE = 'M'
SPECIAL = 'S'
names: models.manager.RelatedManager[ISOLanguageName]
codes

ISO 693-1 and 639-2 codes.

ref_name

Reference name.

part_3

Alpha-3 code (ISO 639-3).

lang_type

Type.

scope
comment
codes_id
ext_subtag

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

get_lang_type_display(*, field=<django.db.models.fields.CharField: lang_type>)
get_scope_display(*, field=<django.db.models.fields.CharField: scope>)
individuals

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

macrolanguage_id
regionname_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

subtag

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

macrolanguage

Macrolanguage.

property ietf: str

Shortest ISO 639 code (part 1 or 3).

objects = <jangle.models.languages.ISOLanguageManager object>
class jangle.models.ISOLanguageName(*args, **kwargs)[source]

Represents an English name for an ISO 639-3 language, saved from SIL International.

iso_lang_id
iso_lang

ISO Language.

printable

Printable translated name.

inverted

Inverted translated name.

objects = <jangle.models.languages.ISOLanguageNameManager object>
class jangle.models.Script(*args, **kwargs)[source]

Represents an ISO 15924 script, saved from https://www.unicode.org/iso15924/.

code

ISO 15924 code.

no

ISO 15924 number.

names_en

English names.

names_fr

French names.

pva

Unicode property value alias. See https://www.unicode.org/Public/UCD/latest/ucd/PropertyValueAliases.txt.

unicode_version
subtag

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

script_date

Date.

property no_str: str

Formatted string of ISO 15924 number.

objects = <jangle.models.scripts.ScriptManager object>
class jangle.models.Region(id, tier, no, parent)[source]
names: models.manager.RelatedManager[RegionName]
class Tier(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
GLOBAL = 0
REGIONAL = 1
CONTINENTAL = 2
SUB_REGIONAL = 3
INTERMEDIARY = 4
COUNTRY = 5
tier

Classification.

no

ISO 3166-1 numeric / UN M.49 code.

parent

Parent region encompassing this one, if existing.

property no_str: str

Formatted string of numeric code.

get_name(iso_language: ISOLanguage) str[source]
get_tier_display(*, field=<django.db.models.fields.PositiveSmallIntegerField: tier>)
iso

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

objects = <django.db.models.manager.Manager object>
parent_id
region_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

subtag

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

class jangle.models.RegionName(id, region, name, iso_lang)[source]
region
name
iso_lang

ISO language.

iso_lang_id
objects = <django.db.models.manager.Manager object>
region_id
class jangle.models.ISORegion(*args, **kwargs)[source]

ISO 3166 region.

region
objects = <django.db.models.manager.Manager object>
region_id
alpha_2

ISO 3166-1 alpha-2 code.

alpha_3

ISO 3166-1 alpha-3 code.

in_ldc

In UN Least Developed Countries (LDC).

in_lldc

In UN Land Locked Developing Countries (LLDC).

in_sids

In UN Small Island Developing States (SIDS).

class jangle.models.IANASubtagRegistry(*args, **kwargs)[source]

Represents a saved instance of the IANA Language Subtag Registry.

See https://www.iana.org/assignments/iso_lang-subtags-templates/iso_lang-subtags-templates.xhtml, https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry.

records: models.manager.RelatedManager[IANASubtagRecord]
file_date
saved

Time registry was saved.

objects = <jangle.models.tags.IANASubtagRegistryManager object>
class jangle.models.IANASubtagRecord(*args, **kwargs)[source]

Abstract model to represent a record in the IANA language subtag registry.

descriptions: models.manager.RelatedManager[IANASubtagDescription]
registry
deprecated

Date deprecated.

added

Date added.

comments
pref_value

Preferred value.

first_description() str[source]
objects = <django.db.models.manager.Manager object>
registry_id
class jangle.models.IANASubtagDescription(id, subtag, text, index)[source]
subtag

IANA subtag record.

text
index
objects = <django.db.models.manager.Manager object>
subtag_id
class jangle.models.LanguageSubtag(id, iana, code, macrolanguage, scope, suppress_script, iso_lang_codes, iso_lang, iso_lang_collection)[source]
iso_lang_codes
iso_lang
iso_lang_collection
save(*args, **kwargs) None[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

code

ISO 639 or registered code.

get_scope_display(*, field=<django.db.models.fields.CharField: scope>)
iana

IANA (sub)tag record.

iana_id
iso_lang_codes_id
iso_lang_collection_id
iso_lang_id
macrolanguage
objects = <django.db.models.manager.Manager object>
scope

Classification.

suppress_script

Script used to write the overwhelming majority of documents in this language.

suppress_script_id
class jangle.models.ExtlangSubtag(id, iana, code, macrolanguage, scope, suppress_script, iso_lang)[source]
iso_lang
save(*args, **kwargs) None[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

code

ISO 639 or registered code.

get_scope_display(*, field=<django.db.models.fields.CharField: scope>)
iana

IANA (sub)tag record.

iana_id
iso_lang_id
macrolanguage
objects = <django.db.models.manager.Manager object>
scope

Classification.

suppress_script

Script used to write the overwhelming majority of documents in this language.

suppress_script_id
class jangle.models.ScriptSubtag(*args, **kwargs)[source]
script

External ISO-15924 data from unicode.org.

iana

IANA (sub)tag record.

iana_id
objects = <django.db.models.manager.Manager object>
script_id
class jangle.models.RegionSubtag(*args, **kwargs)[source]
code
region

External UN M.49 and ISO 3166 data.

save(*args, **kwargs) None[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

iana

IANA (sub)tag record.

iana_id
objects = <django.db.models.manager.Manager object>
region_id
class jangle.models.VariantSubtag(*args, **kwargs)[source]
text
iana

IANA (sub)tag record.

iana_id
objects = <django.db.models.manager.Manager object>
tags_through

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class jangle.models.LanguageTag(*args, **kwargs)[source]

Represents an RFC5646 language tag.

See https://www.rfc-editor.org/rfc/rfc5646.html.

variants_through: models.manager.RelatedManager[LanguageTagVariantSubtag]
extensions: models.manager.RelatedManager[ExtensionSubtag]
iana

Original IANA (sub)tag record.

grandfathered_tag
lang

Language subtag.

extlang

Extlang subtag.

script

Script subtag.

region

Region subtag.

variants

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

extlang_id
iana_id
lang_id
private

Private tag or subtag.

region_id
script_id
property is_private: bool
property pref_tag: LanguageTag

Preferred tag as defined in the IANA registry, or self.

property text: str
property description: str

English description of what the tag represents.

lite() LanguageTag[source]
objects = <jangle.models.tags.LanguageTagManager object>
class jangle.models.LanguageTagVariantSubtag(*args, **kwargs)[source]
objects = <django.db.models.manager.Manager object>
tag_id
variant_id
tag
variant
index
class jangle.models.ExtensionSubtag(*args, **kwargs)[source]
objects = <django.db.models.manager.Manager object>
tag_id
texts: models.manager.RelatedManager[ExtensionSubtagText]
tag
singleton
index
class jangle.models.ExtensionSubtagText(*args, **kwargs)[source]
extension_id
objects = <django.db.models.manager.Manager object>
extension
text
index