Relations¶
We already explained that every entity in can be related to every other entity. We have relation classes for all relation types.
Models¶
-
class
relations.models.
AnnotationRelationLinkManager
[source]¶ Manager used to retrieve only those relations that are highlighted in the texts. Reads out the
annotation_project
andusers_show_highlighter
session variables and provides a filter. Needs adjango.request
object in order to read out thesession
variable.Example:
relation = PersonPlace.objects.filter(related_place='Wien').filter_ann_project(request=request)
Returns only those relations that are connected with an annotation that fits the session variables or are not connected to any annotation at all.
-
class
relations.models.
EventEvent
(*args, **kwargs)[source]¶ Describes a relation between an Event and an Event
Parameters: - relation_type (int) – Foreign Key to
vocabularies.models.EventEventRelation
- related_eventA (int) – Foreign Key to
entities.models.Event
- related_eventB (int) – Foreign Key to
entities.models.Event
- relation_type (int) – Foreign Key to
-
class
relations.models.
EventWork
(*args, **kwargs)[source]¶ Describes a relation between an Event and a Work
Parameters: - relation_type (int) – Foreign Key to
vocabularies.models.EventWorkRelation
- related_event (int) – Foreign Key to
entities.models.Event
- related_work (int) – Foreign Key to
entities.models.Work
- relation_type (int) – Foreign Key to
-
class
relations.models.
InstitutionEvent
(*args, **kwargs)[source]¶ Describes a relation bewteen an Institution and an Event
Parameters: - relation_type (int) – Foreign Key to
vocabularies.models.InstitutionEventRelation
- related_institution (int) – Foreign Key to
entities.models.Institution
- related_event (int) – Foreign Key to
entities.models.Event
- relation_type (int) – Foreign Key to
-
class
relations.models.
InstitutionInstitution
(*args, **kwargs)[source]¶ Defines and describes a relation between two Institutions
Parameters: - relation_type (int) – Foreign Key to
vocabularies.models.InstitutionInstitutionRelation
- related_institutionA (int) – Foreign Key to
entities.models.Institution
- related_institutionB (int) – Foreign Key to
entities.models.Institution
- relation_type (int) – Foreign Key to
-
class
relations.models.
InstitutionPlace
(*args, **kwargs)[source]¶ Describes a relation bewteen an Institution and a Place
Parameters: - relation_type (int) – Foreign Key to
vocabularies.models.InstitutionPlaceRelation
- related_institution (int) – Foreign Key to
entities.models.Institution
- related_place (int) – Foreign Key to
entities.models.Place
- relation_type (int) – Foreign Key to
-
class
relations.models.
InstitutionWork
(*args, **kwargs)[source]¶ Describes a relation bewteen an Institution and a Work
Parameters: - relation_type (int) – Foreign Key to
vocabularies.models.InstitutionWorkRelation
- related_institution (int) – Foreign Key to
entities.models.Institution
- related_work (int) – Foreign Key to
entities.models.Work
- relation_type (int) – Foreign Key to
-
class
relations.models.
PersonEvent
(*args, **kwargs)[source]¶ Defines and describes a relation bewteen a Person and an Event
Parameters: - relation_type (int) – Foreign Key to
vocabularies.models.PersonEventRelation
- related_person (int) – Foreign Key to
entities.models.Person
- related_event (int) – Foreign Key to
entities.models.Event
- relation_type (int) – Foreign Key to
-
class
relations.models.
PersonInstitution
(*args, **kwargs)[source]¶ Defines and describes a relation between a Person and a Institution
Parameters: - relation_type (int) – Foreign Key to
vocabularies.models.PersonInstitutionRelation
- related_person (int) – Foreign Key to
entities.models.Person
- related_institution (int) – Foreign Key to
entities.models.Institution
- relation_type (int) – Foreign Key to
-
class
relations.models.
PersonPerson
(*args, **kwargs)[source]¶ Defines and describes a relation between a Person and another Person
Parameters: - relation_type (int) – Foreign Key to
vocabularies.models.PersonPersonRelation
- related_personA (int) – Foreign Key to
entities.models.Person
- related_personB (int) – Foreign Key to
entities.models.Person
-
get_table_dict
(entity)[source]¶ Function that returns dict used in relation tables.
Parameters: entity – entities.models.Person
instance that is the starting point of the table.Returns: dict
- relation_type (int) – Foreign Key to
-
class
relations.models.
PersonPlace
(*args, **kwargs)[source]¶ Defines and describes a relation between a Person and a Place
Parameters: - relation_type (int) – Foreign Key to
vocabularies.models.PersonPlaceRelation
- related_person (int) – Foreign Key to
entities.models.Person
- related_place (int) – Foreign Key to
entities.models.Place
- relation_type (int) – Foreign Key to
-
class
relations.models.
PersonWork
(*args, **kwargs)[source]¶ Defines and describes a relation between a Person and a Work
Parameters: - relation_type (int) – Foreign Key to
vocabularies.models.PersonWorkRelation
- related_person (int) – Foreign Key to
entities.models.Person
- related_work (int) – Foreign Key to
entities.models.Work
- relation_type (int) – Foreign Key to
-
class
relations.models.
PlaceEvent
(*args, **kwargs)[source]¶ Describes a relation between an Place and an Event
Parameters: - relation_type (int) – Foreign Key to
vocabularies.models.PlaceEventRelation
- related_place (int) – Foreign Key to
entities.models.Place
- related_event (int) – Foreign Key to
entities.models.Event
- relation_type (int) – Foreign Key to
-
class
relations.models.
PlacePlace
(*args, **kwargs)[source]¶ Describes a relation bewteen an Place and a Place
Parameters: - relation_type (int) – Foreign Key to
vocabularies.models.PlacePlaceRelation
- related_placeA (int) – Foreign Key to
entities.models.Place
- related_placeB (int) – Foreign Key to
entities.models.Place
-
get_table_dict
(entity)[source]¶ Dict for the tabels in the html view
Parameters: entity – Object of type entities.models.Place
; Used to determine which Place is the main antity and which one the related.Returns:
- relation_type (int) – Foreign Key to
-
class
relations.models.
PlaceWork
(*args, **kwargs)[source]¶ Describes a relation between an Place and a Work
Parameters: - relation_type (int) – Foreign Key to
vocabularies.models.PlaceWorkRelation
- related_place (int) – Foreign Key to
entities.models.Place
- related_Work (int) – Foreign Key to
entities.models.Work
- relation_type (int) – Foreign Key to
-
class
relations.models.
WorkWork
(*args, **kwargs)[source]¶ Describes a relation between an Work and a Work
Parameters: - relation_type (int) – Foreign Key to
vocabularies.models.WorkWorkRelation
- related_workA (int) – Foreign Key to
entities.models.Work
- related_workB (int) – Foreign Key to
entities.models.Work
- relation_type (int) – Foreign Key to