forked from botswana-harvard/edc-reference
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/0.3.16' into main
- Loading branch information
Showing
7 changed files
with
127 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
0.3.16 | ||
------ | ||
- refactor ReferenceGetter to require `site` | ||
- link ModelAdmin class to subject dashboard | ||
- allow search of field values in ModelAdmin | ||
|
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,24 +1,34 @@ | ||
from django.contrib import admin | ||
from edc_model_admin.mixins import TemplatesModelAdminMixin | ||
from edc_model_admin.dashboard import ModelAdminSubjectDashboardMixin | ||
from edc_sites.admin import SiteModelAdminMixin | ||
|
||
from .admin_site import edc_reference_admin | ||
from .models import Reference | ||
|
||
|
||
@admin.register(Reference, site=edc_reference_admin) | ||
class ReferenceAdmin(TemplatesModelAdminMixin, admin.ModelAdmin): | ||
class ReferenceAdmin(SiteModelAdminMixin, ModelAdminSubjectDashboardMixin, admin.ModelAdmin): | ||
date_hierarchy = "report_datetime" | ||
|
||
list_display = ( | ||
"identifier", | ||
"dashboard", | ||
"model", | ||
"report_datetime", | ||
"visit", | ||
"timepoint", | ||
"field_name", | ||
"value", | ||
) | ||
list_filter = ("model", "timepoint", "field_name") | ||
search_fields = ("identifier",) | ||
search_fields = ( | ||
"identifier", | ||
"value_str", | ||
"value_int", | ||
"value_date", | ||
"value_datetime", | ||
"value_uuid", | ||
) | ||
|
||
def visit(self, obj=None): | ||
return f"{obj.visit_code}.{obj.visit_code_sequence}" |
34 changes: 34 additions & 0 deletions
34
edc_reference/migrations/0012_alter_reference_managers_reference_site.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,34 @@ | ||
# Generated by Django 4.2.1 on 2023-07-08 16:25 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django.db.models.manager | ||
import edc_sites.model_mixins | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("sites", "0002_alter_domain_unique"), | ||
("edc_reference", "0011_auto_20200929_0238"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelManagers( | ||
name="reference", | ||
managers=[ | ||
("objects", django.db.models.manager.Manager()), | ||
("on_site", edc_sites.model_mixins.CurrentSiteManager()), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name="reference", | ||
name="site", | ||
field=models.ForeignKey( | ||
editable=False, | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="+", | ||
to="sites.site", | ||
), | ||
), | ||
] |
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