-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from acdh-oeaw/model-all
Model entities
- Loading branch information
Showing
8 changed files
with
1,379 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
320 changes: 320 additions & 0 deletions
320
apis_ontology/migrations/0002_person_versionperson_versionperson_collection.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,320 @@ | ||
# Generated by Django 4.2.11 on 2024-04-22 05:57 | ||
|
||
import apis_core.generic.abc | ||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import simple_history.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("apis_metainfo", "0012_remove_rootobject_deprecated_name"), | ||
("contenttypes", "0002_remove_content_type_name"), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
("apis_ontology", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Person", | ||
fields=[ | ||
( | ||
"rootobject_ptr", | ||
models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
serialize=False, | ||
to="apis_metainfo.rootobject", | ||
), | ||
), | ||
("start_date", models.DateField(blank=True, editable=False, null=True)), | ||
( | ||
"start_start_date", | ||
models.DateField(blank=True, editable=False, null=True), | ||
), | ||
( | ||
"start_end_date", | ||
models.DateField(blank=True, editable=False, null=True), | ||
), | ||
("end_date", models.DateField(blank=True, editable=False, null=True)), | ||
( | ||
"end_start_date", | ||
models.DateField(blank=True, editable=False, null=True), | ||
), | ||
( | ||
"end_end_date", | ||
models.DateField(blank=True, editable=False, null=True), | ||
), | ||
( | ||
"start_date_written", | ||
models.CharField( | ||
blank=True, max_length=255, null=True, verbose_name="Start" | ||
), | ||
), | ||
( | ||
"end_date_written", | ||
models.CharField( | ||
blank=True, max_length=255, null=True, verbose_name="End" | ||
), | ||
), | ||
( | ||
"alternative_names", | ||
models.TextField( | ||
blank=True, null=True, verbose_name="Alternative names" | ||
), | ||
), | ||
( | ||
"external_links", | ||
models.TextField( | ||
blank=True, null=True, verbose_name="External links" | ||
), | ||
), | ||
( | ||
"review", | ||
models.BooleanField( | ||
default=False, | ||
help_text="Should be set to True, if the data record holds up quality standards.", | ||
), | ||
), | ||
( | ||
"notes", | ||
models.TextField(blank=True, null=True, verbose_name="Notes"), | ||
), | ||
("published", models.BooleanField(default=False)), | ||
( | ||
"name", | ||
models.CharField( | ||
blank=True, default="", max_length=255, verbose_name="Name" | ||
), | ||
), | ||
( | ||
"gender", | ||
models.CharField( | ||
choices=[("male", "Male"), ("female", "Female")], | ||
default="male", | ||
max_length=6, | ||
), | ||
), | ||
( | ||
"nationality", | ||
models.CharField( | ||
blank=True, | ||
choices=[("Indic", "Indic"), ("Tibetan", "Tibetan")], | ||
max_length=10, | ||
null=True, | ||
), | ||
), | ||
("comments", models.TextField(blank=True, null=True)), | ||
( | ||
"collection", | ||
models.ManyToManyField( | ||
editable=False, to="apis_metainfo.collection" | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
bases=("apis_metainfo.rootobject", models.Model), | ||
), | ||
migrations.CreateModel( | ||
name="VersionPerson", | ||
fields=[ | ||
( | ||
"rootobject_ptr", | ||
models.ForeignKey( | ||
auto_created=True, | ||
blank=True, | ||
db_constraint=False, | ||
null=True, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
parent_link=True, | ||
related_name="+", | ||
to="apis_metainfo.rootobject", | ||
), | ||
), | ||
( | ||
"id", | ||
models.IntegerField( | ||
auto_created=True, blank=True, db_index=True, verbose_name="ID" | ||
), | ||
), | ||
("start_date", models.DateField(blank=True, editable=False, null=True)), | ||
( | ||
"start_start_date", | ||
models.DateField(blank=True, editable=False, null=True), | ||
), | ||
( | ||
"start_end_date", | ||
models.DateField(blank=True, editable=False, null=True), | ||
), | ||
("end_date", models.DateField(blank=True, editable=False, null=True)), | ||
( | ||
"end_start_date", | ||
models.DateField(blank=True, editable=False, null=True), | ||
), | ||
( | ||
"end_end_date", | ||
models.DateField(blank=True, editable=False, null=True), | ||
), | ||
( | ||
"start_date_written", | ||
models.CharField( | ||
blank=True, max_length=255, null=True, verbose_name="Start" | ||
), | ||
), | ||
( | ||
"end_date_written", | ||
models.CharField( | ||
blank=True, max_length=255, null=True, verbose_name="End" | ||
), | ||
), | ||
( | ||
"version_tag", | ||
models.CharField(blank=True, max_length=255, null=True), | ||
), | ||
( | ||
"alternative_names", | ||
models.TextField( | ||
blank=True, null=True, verbose_name="Alternative names" | ||
), | ||
), | ||
( | ||
"external_links", | ||
models.TextField( | ||
blank=True, null=True, verbose_name="External links" | ||
), | ||
), | ||
( | ||
"review", | ||
models.BooleanField( | ||
default=False, | ||
help_text="Should be set to True, if the data record holds up quality standards.", | ||
), | ||
), | ||
( | ||
"notes", | ||
models.TextField(blank=True, null=True, verbose_name="Notes"), | ||
), | ||
("published", models.BooleanField(default=False)), | ||
( | ||
"name", | ||
models.CharField( | ||
blank=True, default="", max_length=255, verbose_name="Name" | ||
), | ||
), | ||
( | ||
"gender", | ||
models.CharField( | ||
choices=[("male", "Male"), ("female", "Female")], | ||
default="male", | ||
max_length=6, | ||
), | ||
), | ||
( | ||
"nationality", | ||
models.CharField( | ||
blank=True, | ||
choices=[("Indic", "Indic"), ("Tibetan", "Tibetan")], | ||
max_length=10, | ||
null=True, | ||
), | ||
), | ||
("comments", models.TextField(blank=True, null=True)), | ||
("history_id", models.AutoField(primary_key=True, serialize=False)), | ||
("history_date", models.DateTimeField(db_index=True)), | ||
("history_change_reason", models.CharField(max_length=100, null=True)), | ||
( | ||
"history_type", | ||
models.CharField( | ||
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], | ||
max_length=1, | ||
), | ||
), | ||
( | ||
"history_user", | ||
models.ForeignKey( | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="+", | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
( | ||
"self_contenttype", | ||
models.ForeignKey( | ||
blank=True, | ||
db_constraint=False, | ||
editable=False, | ||
null=True, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name="+", | ||
to="contenttypes.contenttype", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "Version", | ||
"verbose_name_plural": "Versions", | ||
"ordering": ("-history_date", "-history_id"), | ||
"get_latest_by": ("history_date", "history_id"), | ||
}, | ||
bases=( | ||
simple_history.models.HistoricalChanges, | ||
models.Model, | ||
apis_core.generic.abc.GenericModel, | ||
), | ||
), | ||
migrations.CreateModel( | ||
name="VersionPerson_collection", | ||
fields=[ | ||
( | ||
"id", | ||
models.IntegerField( | ||
auto_created=True, blank=True, db_index=True, verbose_name="ID" | ||
), | ||
), | ||
("m2m_history_id", models.AutoField(primary_key=True, serialize=False)), | ||
( | ||
"collection", | ||
models.ForeignKey( | ||
blank=True, | ||
db_constraint=False, | ||
db_tablespace="", | ||
null=True, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name="+", | ||
to="apis_metainfo.collection", | ||
), | ||
), | ||
( | ||
"history", | ||
models.ForeignKey( | ||
db_constraint=False, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
to="apis_ontology.versionperson", | ||
), | ||
), | ||
( | ||
"person", | ||
models.ForeignKey( | ||
blank=True, | ||
db_constraint=False, | ||
db_tablespace="", | ||
null=True, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name="+", | ||
to="apis_ontology.person", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "VersionPerson_collection", | ||
}, | ||
bases=(simple_history.models.HistoricalChanges, models.Model), | ||
), | ||
] |
Oops, something went wrong.