-
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.
1. modified entity form and filter set for person 2. still don't know how to set the current language for application
- Loading branch information
Showing
10 changed files
with
246 additions
and
45 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
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
107 changes: 107 additions & 0 deletions
107
apis_ontology/migrations/0031_alter_person_options_alter_versionperson_options_and_more.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,107 @@ | ||
# Generated by Django 5.1.3 on 2024-11-15 21:53 | ||
|
||
import django.db.models.deletion | ||
import parler.fields | ||
import parler.models | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("apis_ontology", "0030_alter_versioninstance_options_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name="person", | ||
options={}, | ||
), | ||
migrations.AlterModelOptions( | ||
name="versionperson", | ||
options={ | ||
"get_latest_by": ("history_date", "history_id"), | ||
"ordering": ("-history_date", "-history_id"), | ||
"verbose_name": "historical person", | ||
"verbose_name_plural": "historical persons", | ||
}, | ||
), | ||
migrations.RemoveField( | ||
model_name="person", | ||
name="name", | ||
), | ||
migrations.RemoveField( | ||
model_name="versionperson", | ||
name="name", | ||
), | ||
migrations.AddField( | ||
model_name="person", | ||
name="name_latin", | ||
field=models.CharField( | ||
blank=True, | ||
default="", | ||
editable=False, | ||
max_length=255, | ||
verbose_name="Name", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="versionperson", | ||
name="name_latin", | ||
field=models.CharField( | ||
blank=True, | ||
default="", | ||
editable=False, | ||
max_length=255, | ||
verbose_name="Name", | ||
), | ||
), | ||
migrations.CreateModel( | ||
name="PersonTranslation", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"language_code", | ||
models.CharField( | ||
db_index=True, max_length=15, verbose_name="Language" | ||
), | ||
), | ||
( | ||
"name", | ||
models.CharField( | ||
blank=True, default="", max_length=255, verbose_name="Name" | ||
), | ||
), | ||
( | ||
"master", | ||
parler.fields.TranslationsForeignKey( | ||
editable=False, | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="translations", | ||
to="apis_ontology.person", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "person Translation", | ||
"db_table": "apis_ontology_person_translation", | ||
"db_tablespace": "", | ||
"managed": True, | ||
"default_permissions": (), | ||
"unique_together": {("language_code", "master")}, | ||
}, | ||
bases=(parler.models.TranslatableModel, models.Model), | ||
), | ||
migrations.RunSQL( | ||
"INSERT INTO apis_ontology_person_translation(language_code, name , master_id) SELECT 'en', name_latin, rootobject_ptr_id FROM apis_ontology_person;" | ||
), | ||
] |
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
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
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
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 |
---|---|---|
@@ -1,31 +1,37 @@ | ||
from apis_ontology.views import ExcerptsView | ||
from apis_ontology.views import ExcerptsView, language_switcher | ||
from django.contrib import admin | ||
from django.urls import include, path | ||
from django.views.generic import TemplateView | ||
from django.contrib.staticfiles.urls import staticfiles_urlpatterns | ||
from django.conf.urls.i18n import i18n_patterns | ||
|
||
from apis_core.apis_entities.api_views import GetEntityGeneric | ||
|
||
|
||
urlpatterns = [ | ||
path("admin/", admin.site.urls), | ||
path("apis/", include("apis_core.urls", namespace="apis")), | ||
path("apis/collections/", include("apis_core.collections.urls")), | ||
path("accounts/", include("django.contrib.auth.urls")), | ||
path("apis/collections/", include("apis_core.collections.urls")), | ||
path("entity/<int:pk>/", GetEntityGeneric.as_view(), name="GetEntityGenericRoot"), | ||
path("", TemplateView.as_view(template_name="base.html")), | ||
path( | ||
"apis/excerpts/<str:xml_id>/<str:render_style>/", | ||
ExcerptsView.as_view(), | ||
name="excerpts_view", | ||
), | ||
path( | ||
"switch_language/<str:language_code>/", | ||
language_switcher, | ||
name="language_switcher", | ||
), | ||
path("apis/", include("apis_core.urls", namespace="apis")), | ||
] | ||
|
||
# Static files and other patterns | ||
urlpatterns += staticfiles_urlpatterns() | ||
urlpatterns += [ | ||
path("", include("django_acdhch_functions.urls")), | ||
] | ||
|
||
# Additional URLs | ||
urlpatterns += [ | ||
path("", include("django_acdhch_functions.urls")), | ||
path("select2/", include("django_select2.urls")), | ||
] |
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
Oops, something went wrong.