-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed model fields for candidates/primary to relation based, cleanu…
…p & improvements
- Loading branch information
1 parent
27c0a25
commit 2ac87e6
Showing
10 changed files
with
200 additions
and
115 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
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
80 changes: 80 additions & 0 deletions
80
hawc/apps/lit/migrations/0027_duplicatecandidategroup_delete_dedupesettings_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,80 @@ | ||
# Generated by Django 5.1.4 on 2025-02-10 12:18 | ||
|
||
import django.db.models.deletion | ||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("assessment", "0047_alter_labeleditem_options"), | ||
("lit", "0026_reference_hidden"), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="DuplicateCandidateGroup", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"resolution", | ||
models.PositiveSmallIntegerField( | ||
choices=[ | ||
(0, "Unresolved"), | ||
(1, "Resolved"), | ||
(2, "False positive"), | ||
], | ||
default=0, | ||
), | ||
), | ||
("notes", models.TextField(blank=True)), | ||
("created", models.DateTimeField(auto_now_add=True)), | ||
("last_updated", models.DateTimeField(auto_now=True)), | ||
( | ||
"assessment", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="duplicates", | ||
to="assessment.assessment", | ||
), | ||
), | ||
( | ||
"candidates", | ||
models.ManyToManyField(related_name="duplicate_candidates", to="lit.reference"), | ||
), | ||
( | ||
"primary", | ||
models.ForeignKey( | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="duplicate_primaries", | ||
to="lit.reference", | ||
), | ||
), | ||
( | ||
"resolving_user", | ||
models.ForeignKey( | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="resolved_duplicates", | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
], | ||
), | ||
migrations.DeleteModel( | ||
name="DedupeSettings", | ||
), | ||
migrations.DeleteModel( | ||
name="DuplicateCandidates", | ||
), | ||
] |
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,18 +1,20 @@ | ||
<div hx-target="this" hx-swap="delete swap:1s"> | ||
<form hx-post="{% url 'lit:api:duplicate-resolve-duplicate' object.pk %}"> | ||
<div> | ||
<label> | ||
<input type="radio" id="none-{{object.pk}}" name="resolution" value="none" /> | ||
No duplicates | ||
</label> | ||
<form hx-post="{% url 'lit:api:duplicate-resolve-duplicate' object.pk %}"> | ||
<div> | ||
<label> | ||
<input type="radio" id="none-{{object.pk}}" name="resolution" value="none" /> | ||
No duplicates | ||
</label> | ||
</div> | ||
{% for candidate in object.candidates.all %} | ||
<div> | ||
<input type="radio" id="primary-{{object.pk}}-{{candidate.pk}}" name="resolution" value="{{candidate.pk}}" /> | ||
<div style="display:inline-block; vertical-align: top;"> | ||
{% include 'lit/_reference_with_tags.html' with ref=candidate %} | ||
</div> | ||
{% for candidate in object.candidates %} | ||
<div> | ||
<input type="radio" id="primary-{{object.pk}}-{{candidate}}" name="resolution" value="{{candidate}}" /> | ||
<div style="display:inline-block;">{{candidate}}</div> | ||
</div> | ||
{% endfor %} | ||
<textarea name="notes" placeholder="Notes"></textarea> | ||
<button type="submit">Resolve</button> | ||
</form> | ||
</div> | ||
{% endfor %} | ||
<textarea name="notes" placeholder="Notes"></textarea> | ||
<button type="submit">Resolve</button> | ||
</form> | ||
</div> |
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
Oops, something went wrong.