Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop into staging, 11 Oct 2024 #1663

Merged
merged 33 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
329d8f4
Fixed: Add name field to source models
ahankinson Sep 13, 2024
61a2d31
New: Add Source Identifier field
ahankinson Sep 13, 2024
fe72a2f
Fixed: Change "Private" to "Cantus"
ahankinson Sep 13, 2024
d0f7bf5
Fixed: Ensure the source identifiers are searchable in the admin UI
ahankinson Sep 13, 2024
b407110
Fixed: Adjust display fields
ahankinson Sep 13, 2024
4532cfd
Merge pull request #1629 from DDMAL/institution-source-changes
dchiller Sep 17, 2024
bf5c984
fix: maintain compatibility in external/export APIs
dchiller Oct 1, 2024
3265dbd
fix(ms073): temporarily turn off volpiano display
dchiller Oct 2, 2024
19a0828
feat(source ids): add command to fix dact_id and fragmentarium_id for…
dchiller Oct 3, 2024
d10152e
refactor(tests): refactor test_views.test_chant.ChantCreateViewTest
dchiller Oct 3, 2024
34c130f
refactor(tests): fix lint errors in test_chant.py
dchiller Oct 3, 2024
3907d42
refactor(chant create view): reduce duplicate queries and tests
dchiller Oct 3, 2024
6308058
fix(source melody search): remove error from "source" queryset
dchiller Oct 2, 2024
9282e98
Merge pull request #1643 from dchiller/i1641-fix-external-api-compata…
dchiller Oct 4, 2024
bcfac9b
Merge pull request #1651 from dchiller/i1644-clean-frag-and-dact-ids
dchiller Oct 4, 2024
cc14cf5
Merge pull request #1649 from dchiller/i1635-no-ms73-volpiano
dchiller Oct 4, 2024
192a164
feat(chant views): catch invalid text errors
dchiller Oct 4, 2024
ff92465
feat(source model): add source_completeness and production_method fields
dchiller Oct 2, 2024
2a272c8
refactor(forms): create StyledChoiceField on forms
dchiller Oct 2, 2024
f646e77
feat(source name): add source name to create, edit, and detail pages
dchiller Oct 2, 2024
d97563c
fix(source): make holding_institution optional for sources
dchiller Oct 2, 2024
065ef07
chore: add migrations for previous commits
dchiller Oct 2, 2024
15fcf5b
fix(source admin form): order institutions by city then name
dchiller Oct 7, 2024
20eba46
fix(source display): format colloquial name and "(fragment)"
dchiller Oct 7, 2024
8eb3df8
fix(source header): use Cantus prefix if no institution siglum
dchiller Oct 7, 2024
7a3eeea
fix(api): optimize json-cid view queries
dchiller Oct 8, 2024
a23f6f8
fix(remap_user_ids): optimize chant iteration and include revision
dchiller Oct 10, 2024
54a54bf
feat(commands): add cantus id mapping command
dchiller Oct 10, 2024
1dfe503
Merge pull request #1645 from dchiller/i1628-source-printed
dchiller Oct 11, 2024
f01050a
Merge pull request #1656 from dchiller/i1655-optimize-json-cid
dchiller Oct 11, 2024
a638402
Merge branch 'develop' into handle-latin-errors
dchiller Oct 11, 2024
8f70f12
Merge pull request #1662 from dchiller/i1661-cantus-id-mapping
dchiller Oct 11, 2024
97a13c6
Merge pull request #1653 from dchiller/handle-latin-errors
dchiller Oct 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion django/cantusdb_project/main_app/admin/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from main_app.admin.base_admin import BaseModelAdmin, EXCLUDE, READ_ONLY
from main_app.admin.filters import InputFilter
from main_app.forms import AdminSourceForm
from main_app.models import Source
from main_app.models import Source, SourceIdentifier


class SourceKeyFilter(InputFilter):
Expand All @@ -15,10 +15,19 @@ def queryset(self, request, queryset):
return queryset.filter(holding_institution__siglum__icontains=self.value())


class IdentifiersInline(admin.TabularInline):
model = SourceIdentifier
extra = 0

def get_queryset(self, request):
return super().get_queryset(request).select_related("source__holding_institution")


@admin.register(Source)
class SourceAdmin(BaseModelAdmin):
exclude = EXCLUDE + ("source_status",)
raw_id_fields = ("holding_institution",)
inlines = (IdentifiersInline,)

# These search fields are also available on the user-source inline relationship in the user admin page
search_fields = (
Expand All @@ -28,6 +37,8 @@ class SourceAdmin(BaseModelAdmin):
"holding_institution__migrated_identifier",
"id",
"provenance_notes",
"name",
"identifiers__identifier"
)
readonly_fields = (
("title", "siglum")
Expand Down
Loading
Loading