-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mock data added draftentry
- Loading branch information
Showing
19 changed files
with
1,224 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,32 @@ | ||
# Register your models here. | ||
from django.contrib import admin | ||
|
||
from assisted_tagging.models import AssistedTaggingModelPredictionTag, AssistedTaggingPrediction, DraftEntry | ||
from deep.admin import VersionAdmin | ||
|
||
|
||
@admin.register(DraftEntry) | ||
class DraftEntryAdmin(VersionAdmin): | ||
list_display = [ | ||
'lead', | ||
'prediction_status', | ||
'excerpt', | ||
] | ||
|
||
|
||
@admin.register(AssistedTaggingPrediction) | ||
class AssistedTaggingPredictionAdmin(VersionAdmin): | ||
list_display = [ | ||
"data_type", | ||
"draft_entry", | ||
"value" | ||
] | ||
|
||
|
||
@admin.register(AssistedTaggingModelPredictionTag) | ||
class AssistedTaggingModelPredictionTagAdmin(VersionAdmin): | ||
list_display = [ | ||
'name', | ||
'is_category', | ||
'tag_id', | ||
] |
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 +1,31 @@ | ||
# | ||
import django_filters | ||
|
||
from deep.filter_set import generate_type_for_filter_set | ||
from .models import DraftEntry | ||
from utils.graphene.filters import IDListFilter, MultipleInputFilter | ||
from .enums import ( | ||
DraftEntryTypeEnum | ||
) | ||
|
||
|
||
class DraftEntryFilterSet(django_filters.FilterSet): | ||
lead = IDListFilter() | ||
draft_entry_type = MultipleInputFilter(DraftEntryTypeEnum) | ||
|
||
class Meta: | ||
model = DraftEntry | ||
fields = () | ||
|
||
def filter_lead(self, qs, _, value): | ||
return qs if value is None else qs.filter(lead=value) | ||
|
||
def filter_draft_entry_type(self, qs, _, value): | ||
return qs if value is None else qs.filter(draft_entry_type=value) | ||
|
||
|
||
DraftEntryFilterDataType, DraftEntryFilterDataInputType = generate_type_for_filter_set( | ||
DraftEntryFilterSet, | ||
"project.schema.ProjectListType", | ||
"DraftEntryFilterDataType", | ||
"DraftEntryFilterDataInputType", | ||
) |
18 changes: 18 additions & 0 deletions
18
apps/assisted_tagging/migrations/0011_draftentry_draft_entry_type.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,18 @@ | ||
# Generated by Django 3.2.17 on 2023-11-06 10:06 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('assisted_tagging', '0010_draftentry_related_geoareas'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='draftentry', | ||
name='draft_entry_type', | ||
field=models.SmallIntegerField(choices=[(0, 'Auto Extraction'), (1, 'Manual Extraction')], default=1), | ||
), | ||
] |
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
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.