diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml deleted file mode 100644 index 9ccc9d5f8..000000000 --- a/.github/workflows/black.yml +++ /dev/null @@ -1,11 +0,0 @@ -#SPDX-FileCopyrightText: 2023 Birger Schacht -#SPDX-License-Identifier: MIT -name: Run black Linter - -on: [push, pull_request] - -jobs: - black: - uses: acdh-oeaw/prosnet-workflows/.github/workflows/poetry-black.yml@dev - with: - src: "." diff --git a/.github/workflows/ruff-formatter.yml b/.github/workflows/ruff-formatter.yml new file mode 100644 index 000000000..463a8d44c --- /dev/null +++ b/.github/workflows/ruff-formatter.yml @@ -0,0 +1,12 @@ +#SPDX-FileCopyrightText: 2023 Birger Schacht +#SPDX-License-Identifier: MIT +name: Run ruff Linter + +on: [push, pull_request] + +jobs: + ruff: + uses: acdh-oeaw/prosnet-workflows/.github/workflows/poetry-ruff.yml@v0.4.2 + with: + src: "." + options: "format --check" diff --git a/apis_core/api_routers.py b/apis_core/api_routers.py index 74afd0690..52403c601 100644 --- a/apis_core/api_routers.py +++ b/apis_core/api_routers.py @@ -197,7 +197,6 @@ def generic_serializer_creation_factory(): select_related.append(f.name) class TemplateSerializer(GenericHyperlinkedModelSerializer): - id = serializers.ReadOnlyField() if getattr(settings, "APIS_API_ID_WRITABLE", False): id = serializers.IntegerField() @@ -209,7 +208,6 @@ class TemplateSerializer(GenericHyperlinkedModelSerializer): _app_label = app_label class Meta: - model = entity exclude = exclude_lst_fin @@ -239,9 +237,9 @@ def __init__(self, *args, **kwargs): many=ck_many, read_only=True ) - TemplateSerializer.__name__ = ( - TemplateSerializer.__qualname__ - ) = f"{entity_str.title().replace(' ', '')}Serializer" + TemplateSerializer.__name__ = TemplateSerializer.__qualname__ = ( + f"{entity_str.title().replace(' ', '')}Serializer" + ) class TemplateSerializerRetrieve(TemplateSerializer): def __init__(self, *args, **kwargs): @@ -312,9 +310,9 @@ def __init__(self, *args, **kwargs): "IntegerField", "AutoField", ]: - filter_fields[ - f"{field.name}__{f2.name}" - ] = allowed_fields_filter[f2.__class__.__name__] + filter_fields[f"{field.name}__{f2.name}"] = ( + allowed_fields_filter[f2.__class__.__name__] + ) continue if field.__class__.__name__ in allowed_fields_filter.keys(): filter_fields[field.name] = allowed_fields_filter[ @@ -330,14 +328,12 @@ def __init__(self, *args, **kwargs): filter_fields[f1[0]] = f1[1] class MetaFilter(object): - model = entity fields = filter_fields filterset_dict["Meta"] = MetaFilter class TemplateViewSet(ListViewObjectFilterMixin, viewsets.ModelViewSet): - _select_related = select_related _prefetch_rel = prefetch_rel pagination_class = CustomPagination @@ -397,9 +393,9 @@ def list_viewset(self, request): def dispatch(self, request, *args, **kwargs): return super(self.__class__, self).dispatch(request, *args, **kwargs) - TemplateViewSet.__name__ = ( - TemplateViewSet.__qualname__ - ) = f"Generic{entity_str.title().replace(' ', '')}ViewSet" + TemplateViewSet.__name__ = TemplateViewSet.__qualname__ = ( + f"Generic{entity_str.title().replace(' ', '')}ViewSet" + ) serializers_dict[TemplateSerializer] = TemplateSerializer views[f"{entity_str.lower().replace(' ', '')}"] = TemplateViewSet diff --git a/apis_core/apis_entities/fields.py b/apis_core/apis_entities/fields.py index e3e98b6c7..08fddaf9b 100644 --- a/apis_core/apis_entities/fields.py +++ b/apis_core/apis_entities/fields.py @@ -7,6 +7,7 @@ from dal_select2.widgets import Select2WidgetMixin as DALSelect2WidgetMixin from django import forms + # "Rewrite" select2 widgets from Django Autocomplete Light so # that they don't use Django's admin-provided jQuery, which # causes errors with jQuery provided by us. diff --git a/apis_core/apis_entities/migrations/0001_initial.py b/apis_core/apis_entities/migrations/0001_initial.py index 2586313fc..86adb9b57 100644 --- a/apis_core/apis_entities/migrations/0001_initial.py +++ b/apis_core/apis_entities/migrations/0001_initial.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/apis_core/apis_entities/migrations/0002_remove_tempentityclass_text.py b/apis_core/apis_entities/migrations/0002_remove_tempentityclass_text.py index bb2e8164a..5ddda4945 100644 --- a/apis_core/apis_entities/migrations/0002_remove_tempentityclass_text.py +++ b/apis_core/apis_entities/migrations/0002_remove_tempentityclass_text.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_entities", "0001_initial"), ] diff --git a/apis_core/apis_entities/migrations/0003_remove_tempentityclass_source.py b/apis_core/apis_entities/migrations/0003_remove_tempentityclass_source.py index da53e8c82..c6478c033 100644 --- a/apis_core/apis_entities/migrations/0003_remove_tempentityclass_source.py +++ b/apis_core/apis_entities/migrations/0003_remove_tempentityclass_source.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_entities", "0002_remove_tempentityclass_text"), ] diff --git a/apis_core/apis_entities/migrations/0004_delete_tempentityclass.py b/apis_core/apis_entities/migrations/0004_delete_tempentityclass.py index e6a860b57..5f420847d 100644 --- a/apis_core/apis_entities/migrations/0004_delete_tempentityclass.py +++ b/apis_core/apis_entities/migrations/0004_delete_tempentityclass.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_entities", "0003_remove_tempentityclass_source"), ] diff --git a/apis_core/apis_entities/serializers.py b/apis_core/apis_entities/serializers.py index 3bf2c1540..60453eb15 100644 --- a/apis_core/apis_entities/serializers.py +++ b/apis_core/apis_entities/serializers.py @@ -159,9 +159,7 @@ def to_representation(self, obj): Entity Link - """.format( - str(obj), ent_obj, ent_url, ent_obj, obj.pk - ) + """.format(str(obj), ent_obj, ent_url, ent_obj, obj.pk) r = { "type": ent_obj.lower(), "label": str(obj), diff --git a/apis_core/apis_entities/serializers_generic.py b/apis_core/apis_entities/serializers_generic.py index 94e94a670..6d34732b2 100644 --- a/apis_core/apis_entities/serializers_generic.py +++ b/apis_core/apis_entities/serializers_generic.py @@ -153,9 +153,9 @@ def add_relation_label(self, obj): cm = obj.__class__.__name__ res_1 = dict() res_1["id"] = obj.relation_type.pk - res_1[ - "url" - ] = f"{base_uri}{reverse('apis_core:apis_api:{}relation-detail'.format(cm).lower(), kwargs={'pk': obj.relation_type.pk},)}" + res_1["url"] = ( + f"{base_uri}{reverse('apis_core:apis_api:{}relation-detail'.format(cm).lower(), kwargs={'pk': obj.relation_type.pk},)}" + ) if self.reverse and len(obj.relation_type.label_reverse) > 0: res_1["label"] = obj.relation_type.label_reverse elif self.reverse: diff --git a/apis_core/apis_metainfo/migrations/0001_initial.py b/apis_core/apis_metainfo/migrations/0001_initial.py index da194ea34..33d3e05b2 100644 --- a/apis_core/apis_metainfo/migrations/0001_initial.py +++ b/apis_core/apis_metainfo/migrations/0001_initial.py @@ -7,7 +7,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [] diff --git a/apis_core/apis_metainfo/migrations/0002_auto_20220201_1241.py b/apis_core/apis_metainfo/migrations/0002_auto_20220201_1241.py index 1a13c633e..e9ba285e7 100644 --- a/apis_core/apis_metainfo/migrations/0002_auto_20220201_1241.py +++ b/apis_core/apis_metainfo/migrations/0002_auto_20220201_1241.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/apis_core/apis_metainfo/migrations/0003_auto_20220218_1530.py b/apis_core/apis_metainfo/migrations/0003_auto_20220218_1530.py index 36fe3fbbf..b884cffd9 100644 --- a/apis_core/apis_metainfo/migrations/0003_auto_20220218_1530.py +++ b/apis_core/apis_metainfo/migrations/0003_auto_20220218_1530.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_metainfo", "0002_auto_20220201_1241"), ] diff --git a/apis_core/apis_metainfo/migrations/0004_auto_20230310_0804.py b/apis_core/apis_metainfo/migrations/0004_auto_20230310_0804.py index 98fadca54..8a4159760 100644 --- a/apis_core/apis_metainfo/migrations/0004_auto_20230310_0804.py +++ b/apis_core/apis_metainfo/migrations/0004_auto_20230310_0804.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_metainfo", "0003_auto_20220218_1530"), ] diff --git a/apis_core/apis_metainfo/migrations/0005_delete_uricandidate.py b/apis_core/apis_metainfo/migrations/0005_delete_uricandidate.py index fc4346fdb..26674deaa 100644 --- a/apis_core/apis_metainfo/migrations/0005_delete_uricandidate.py +++ b/apis_core/apis_metainfo/migrations/0005_delete_uricandidate.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_metainfo", "0004_auto_20230310_0804"), ] diff --git a/apis_core/apis_metainfo/migrations/0006_delete_text.py b/apis_core/apis_metainfo/migrations/0006_delete_text.py index 66f3aabdd..b32acfa62 100644 --- a/apis_core/apis_metainfo/migrations/0006_delete_text.py +++ b/apis_core/apis_metainfo/migrations/0006_delete_text.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_entities", "0002_remove_tempentityclass_text"), ("apis_metainfo", "0005_delete_uricandidate"), diff --git a/apis_core/apis_metainfo/migrations/0007_delete_source.py b/apis_core/apis_metainfo/migrations/0007_delete_source.py index 0dd044b82..8a671d25b 100644 --- a/apis_core/apis_metainfo/migrations/0007_delete_source.py +++ b/apis_core/apis_metainfo/migrations/0007_delete_source.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_entities", "0003_remove_tempentityclass_source"), ("apis_metainfo", "0006_delete_text"), diff --git a/apis_core/apis_metainfo/migrations/0008_alter_rootobject_self_contenttype.py b/apis_core/apis_metainfo/migrations/0008_alter_rootobject_self_contenttype.py index 2b6b15ca7..278902e60 100644 --- a/apis_core/apis_metainfo/migrations/0008_alter_rootobject_self_contenttype.py +++ b/apis_core/apis_metainfo/migrations/0008_alter_rootobject_self_contenttype.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - dependencies = [ ("contenttypes", "0002_remove_content_type_name"), ("apis_metainfo", "0007_delete_source"), diff --git a/apis_core/apis_metainfo/migrations/0009_remove_collection_collection_type.py b/apis_core/apis_metainfo/migrations/0009_remove_collection_collection_type.py index 89ce5f2ab..394c8cf6c 100644 --- a/apis_core/apis_metainfo/migrations/0009_remove_collection_collection_type.py +++ b/apis_core/apis_metainfo/migrations/0009_remove_collection_collection_type.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_metainfo", "0008_alter_rootobject_self_contenttype"), ] diff --git a/apis_core/apis_metainfo/migrations/0010_rename_name_rootobject_deprecated_name.py b/apis_core/apis_metainfo/migrations/0010_rename_name_rootobject_deprecated_name.py index 7bd2b17d5..ecd477bc3 100644 --- a/apis_core/apis_metainfo/migrations/0010_rename_name_rootobject_deprecated_name.py +++ b/apis_core/apis_metainfo/migrations/0010_rename_name_rootobject_deprecated_name.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_metainfo", "0009_remove_collection_collection_type"), ] diff --git a/apis_core/apis_metainfo/migrations/0011_alter_rootobject_deprecated_name.py b/apis_core/apis_metainfo/migrations/0011_alter_rootobject_deprecated_name.py index ffe6b3d0d..203230dde 100644 --- a/apis_core/apis_metainfo/migrations/0011_alter_rootobject_deprecated_name.py +++ b/apis_core/apis_metainfo/migrations/0011_alter_rootobject_deprecated_name.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_metainfo", "0010_rename_name_rootobject_deprecated_name"), ] diff --git a/apis_core/apis_metainfo/migrations/0012_remove_rootobject_deprecated_name.py b/apis_core/apis_metainfo/migrations/0012_remove_rootobject_deprecated_name.py index 0961110ee..acdd891f8 100644 --- a/apis_core/apis_metainfo/migrations/0012_remove_rootobject_deprecated_name.py +++ b/apis_core/apis_metainfo/migrations/0012_remove_rootobject_deprecated_name.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_metainfo", "0011_alter_rootobject_deprecated_name"), ] diff --git a/apis_core/apis_metainfo/serializers.py b/apis_core/apis_metainfo/serializers.py index 56ae9c3fe..da0a65e0b 100644 --- a/apis_core/apis_metainfo/serializers.py +++ b/apis_core/apis_metainfo/serializers.py @@ -7,7 +7,6 @@ class CollectionSerializer(serializers.HyperlinkedModelSerializer): - url = serializers.HyperlinkedIdentityField( view_name="apis:apis_api:text-detail", lookup_field="pk" ) diff --git a/apis_core/apis_metainfo/tables.py b/apis_core/apis_metainfo/tables.py index dd70eca77..79f9b4a76 100644 --- a/apis_core/apis_metainfo/tables.py +++ b/apis_core/apis_metainfo/tables.py @@ -65,15 +65,12 @@ def helper_render_date(value, var_date, var_start_date, var_end_date): # Various if-else branches checking which of the date fields are not None and should be used if var_start_date is not None and var_end_date is not None: - overlay_help_text = str(var_start_date) + " - " + str(var_end_date) elif var_date is not None: - overlay_help_text = str(var_date) else: - return "—" return format_html("" + value + "") @@ -82,7 +79,6 @@ def helper_render_date(value, var_date, var_start_date, var_end_date): # Again this function serves a generic purpose and must be assigned as class method to django-tables2 tables.Table class # The whole logic is very similare to the generic_order_* functions above, so see their comments for more details. def generic_render_start_date_written(self, record, value): - return helper_render_date( value=value, var_date=record.start_date, @@ -92,7 +88,6 @@ def generic_render_start_date_written(self, record, value): def generic_render_end_date_written(self, record, value): - return helper_render_date( value=value, var_date=record.end_date, diff --git a/apis_core/apis_relations/forms.py b/apis_core/apis_relations/forms.py index 028b278e3..20a882a6d 100644 --- a/apis_core/apis_relations/forms.py +++ b/apis_core/apis_relations/forms.py @@ -39,7 +39,6 @@ class Meta: } def __init__(self, entity_type_self_str, entity_type_other_str): - super().__init__() self.helper = FormHelper() @@ -100,19 +99,16 @@ def load_subj_obj_prop( # triple and the property name_forward or name_reverse are loaded correctly here. if property_direction == PropertyAutocomplete.SELF_SUBJ_OTHER_OBJ_STR: - triple_subj = entity_instance_self triple_obj = entity_instance_other property_direction_name = property_instance.name_forward elif property_direction == PropertyAutocomplete.SELF_OBJ_OTHER_SUBJ_STR: - triple_subj = entity_instance_other triple_obj = entity_instance_self property_direction_name = property_instance.name_reverse else: - raise Exception("No valid property direction given.") self.fields["subj"].initial = triple_subj @@ -163,7 +159,6 @@ def load_remaining_data_from_input( def save(self): if self.instance.pk is None: - self.instance = TempTriple.objects.create( subj=self.fields["subj"].initial, obj=self.fields["obj"].initial, @@ -171,7 +166,6 @@ def save(self): ) else: - self.instance.subj = self.fields["subj"].initial self.instance.obj = self.fields["obj"].initial self.instance.prop = self.fields["prop"].initial diff --git a/apis_core/apis_relations/migrations/0001_initial.py b/apis_core/apis_relations/migrations/0001_initial.py index 3e804e5aa..c68e84114 100644 --- a/apis_core/apis_relations/migrations/0001_initial.py +++ b/apis_core/apis_relations/migrations/0001_initial.py @@ -7,7 +7,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/apis_core/apis_relations/migrations/0002_property_property_class_uri.py b/apis_core/apis_relations/migrations/0002_property_property_class_uri.py index 7282f3c7b..88a116c8c 100644 --- a/apis_core/apis_relations/migrations/0002_property_property_class_uri.py +++ b/apis_core/apis_relations/migrations/0002_property_property_class_uri.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_relations", "0001_initial"), ] diff --git a/apis_core/apis_relations/migrations/0003_auto_20230123_1715.py b/apis_core/apis_relations/migrations/0003_auto_20230123_1715.py index 0feea20c8..de4fb6fc8 100644 --- a/apis_core/apis_relations/migrations/0003_auto_20230123_1715.py +++ b/apis_core/apis_relations/migrations/0003_auto_20230123_1715.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_relations", "0002_property_property_class_uri"), ] diff --git a/apis_core/apis_relations/migrations/0004_auto_20230124_1201.py b/apis_core/apis_relations/migrations/0004_auto_20230124_1201.py index b3677a58f..b71ed266e 100644 --- a/apis_core/apis_relations/migrations/0004_auto_20230124_1201.py +++ b/apis_core/apis_relations/migrations/0004_auto_20230124_1201.py @@ -7,7 +7,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_metainfo", "0003_auto_20220218_1530"), ("apis_relations", "0003_auto_20230123_1715"), diff --git a/apis_core/apis_relations/migrations/0005_alter_property_obj_class_alter_property_subj_class.py b/apis_core/apis_relations/migrations/0005_alter_property_obj_class_alter_property_subj_class.py index 767674901..b976aa155 100644 --- a/apis_core/apis_relations/migrations/0005_alter_property_obj_class_alter_property_subj_class.py +++ b/apis_core/apis_relations/migrations/0005_alter_property_obj_class_alter_property_subj_class.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("contenttypes", "0002_remove_content_type_name"), ("apis_relations", "0004_auto_20230124_1201"), diff --git a/apis_core/apis_relations/tables.py b/apis_core/apis_relations/tables.py index 30be3edd5..2ac17cc38 100644 --- a/apis_core/apis_relations/tables.py +++ b/apis_core/apis_relations/tables.py @@ -90,7 +90,6 @@ def order_object(self, queryset, is_descending): def get_generic_triple_table(other_entity_class_name, entity_pk_self, detail): - # TODO RDF : add code from before refactoring and comment it out class TripleTableBase(tables.Table): """ diff --git a/apis_core/apis_relations/views.py b/apis_core/apis_relations/views.py index 8b4dc2587..9c6497746 100644 --- a/apis_core/apis_relations/views.py +++ b/apis_core/apis_relations/views.py @@ -79,7 +79,6 @@ def get_form_ajax(request): form.load_remaining_data_from_triple(triple) else: - raise Exception("Missing necessary form data") param_dict = { @@ -136,7 +135,6 @@ def save_ajax_form( ) if ObjectID is not False: - triple = TempTriple.objects.get(pk=ObjectID) form.load_remaining_data_from_triple(triple) diff --git a/apis_core/apis_vocabularies/migrations/0001_initial.py b/apis_core/apis_vocabularies/migrations/0001_initial.py index 2df0545d3..34ff80dc1 100644 --- a/apis_core/apis_vocabularies/migrations/0001_initial.py +++ b/apis_core/apis_vocabularies/migrations/0001_initial.py @@ -6,7 +6,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/apis_core/apis_vocabularies/migrations/0002_remove_texttype_collections_and_more.py b/apis_core/apis_vocabularies/migrations/0002_remove_texttype_collections_and_more.py index 4a2a6ce1f..e38760853 100644 --- a/apis_core/apis_vocabularies/migrations/0002_remove_texttype_collections_and_more.py +++ b/apis_core/apis_vocabularies/migrations/0002_remove_texttype_collections_and_more.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_vocabularies", "0001_initial"), ] diff --git a/apis_core/apis_vocabularies/migrations/0003_delete_vocabnames_delete_vocabsuri.py b/apis_core/apis_vocabularies/migrations/0003_delete_vocabnames_delete_vocabsuri.py index b368b4012..673637bb9 100644 --- a/apis_core/apis_vocabularies/migrations/0003_delete_vocabnames_delete_vocabsuri.py +++ b/apis_core/apis_vocabularies/migrations/0003_delete_vocabnames_delete_vocabsuri.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_vocabularies", "0002_remove_texttype_collections_and_more"), ] diff --git a/apis_core/apis_vocabularies/migrations/0004_delete_collectiontype.py b/apis_core/apis_vocabularies/migrations/0004_delete_collectiontype.py index 1f24ebfcb..e9cad1b03 100644 --- a/apis_core/apis_vocabularies/migrations/0004_delete_collectiontype.py +++ b/apis_core/apis_vocabularies/migrations/0004_delete_collectiontype.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_vocabularies", "0003_delete_vocabnames_delete_vocabsuri"), ] diff --git a/apis_core/apis_vocabularies/migrations/0005_delete_vocabsbaseclass.py b/apis_core/apis_vocabularies/migrations/0005_delete_vocabsbaseclass.py index cb9aa5006..b18f47787 100644 --- a/apis_core/apis_vocabularies/migrations/0005_delete_vocabsbaseclass.py +++ b/apis_core/apis_vocabularies/migrations/0005_delete_vocabsbaseclass.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("apis_vocabularies", "0004_delete_collectiontype"), ] diff --git a/apis_core/collections/migrations/0001_initial.py b/apis_core/collections/migrations/0001_initial.py index 8d25c2169..e89241b1f 100644 --- a/apis_core/collections/migrations/0001_initial.py +++ b/apis_core/collections/migrations/0001_initial.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/apis_core/collections/migrations/0002_alter_skoscollection_options.py b/apis_core/collections/migrations/0002_alter_skoscollection_options.py index de5b24933..0b8105e21 100644 --- a/apis_core/collections/migrations/0002_alter_skoscollection_options.py +++ b/apis_core/collections/migrations/0002_alter_skoscollection_options.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("collections", "0001_initial"), ] diff --git a/apis_core/utils/DateParser.py b/apis_core/utils/DateParser.py index 6ac8d9dea..4069da183 100644 --- a/apis_core/utils/DateParser.py +++ b/apis_core/utils/DateParser.py @@ -348,5 +348,4 @@ def get_date_help_text_from_dates( def get_date_help_text_default(): - return "Dates are interpreted by defined rules. If this fails, an iso-date can be explicitly set with '<YYYY-MM-DD>'." diff --git a/apis_core/utils/filtermethods.py b/apis_core/utils/filtermethods.py index f926808b0..dbc7697c4 100644 --- a/apis_core/utils/filtermethods.py +++ b/apis_core/utils/filtermethods.py @@ -2,6 +2,7 @@ This module contains filter functions that can be used by django-filter filters See https://django-filter.readthedocs.io/en/main/ref/filters.html#method """ + from django.db.models import Q @@ -51,6 +52,7 @@ def flexible_string(queryset, name, value): # filtermethods for specific usecases: + # TODO RDF: Check if this should be removed or adapted def related_entity_name(queryset, name, value): """ diff --git a/manage.py b/manage.py index fc368ea09..860f67547 100755 --- a/manage.py +++ b/manage.py @@ -34,7 +34,6 @@ def work_around_dal_select2_bug(): lines = f.readlines() for i, line in enumerate(lines): - if ( line == " processResults: function (data, page) {\n" and lines[i + 1] @@ -44,7 +43,6 @@ def work_around_dal_select2_bug(): and lines[i + 3] == " value.id = value.text;\n" ): - lines[i + 3] = " value.id = value.id;\n" with open(file_to_fix, "w") as f: diff --git a/poetry.lock b/poetry.lock index 317887e2d..1a739fc20 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "alabaster" @@ -86,39 +86,6 @@ files = [ [package.extras] dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] -[[package]] -name = "black" -version = "22.12.0" -description = "The uncompromising code formatter." -optional = false -python-versions = ">=3.7" -files = [ - {file = "black-22.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9eedd20838bd5d75b80c9f5487dbcb06836a43833a37846cf1d8c1cc01cef59d"}, - {file = "black-22.12.0-cp310-cp310-win_amd64.whl", hash = "sha256:159a46a4947f73387b4d83e87ea006dbb2337eab6c879620a3ba52699b1f4351"}, - {file = "black-22.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d30b212bffeb1e252b31dd269dfae69dd17e06d92b87ad26e23890f3efea366f"}, - {file = "black-22.12.0-cp311-cp311-win_amd64.whl", hash = "sha256:7412e75863aa5c5411886804678b7d083c7c28421210180d67dfd8cf1221e1f4"}, - {file = "black-22.12.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c116eed0efb9ff870ded8b62fe9f28dd61ef6e9ddd28d83d7d264a38417dcee2"}, - {file = "black-22.12.0-cp37-cp37m-win_amd64.whl", hash = "sha256:1f58cbe16dfe8c12b7434e50ff889fa479072096d79f0a7f25e4ab8e94cd8350"}, - {file = "black-22.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:77d86c9f3db9b1bf6761244bc0b3572a546f5fe37917a044e02f3166d5aafa7d"}, - {file = "black-22.12.0-cp38-cp38-win_amd64.whl", hash = "sha256:82d9fe8fee3401e02e79767016b4907820a7dc28d70d137eb397b92ef3cc5bfc"}, - {file = "black-22.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:101c69b23df9b44247bd88e1d7e90154336ac4992502d4197bdac35dd7ee3320"}, - {file = "black-22.12.0-cp39-cp39-win_amd64.whl", hash = "sha256:559c7a1ba9a006226f09e4916060982fd27334ae1998e7a38b3f33a37f7a2148"}, - {file = "black-22.12.0-py3-none-any.whl", hash = "sha256:436cc9167dd28040ad90d3b404aec22cedf24a6e4d7de221bec2730ec0c97bcf"}, - {file = "black-22.12.0.tar.gz", hash = "sha256:229351e5a18ca30f447bf724d007f890f97e13af070bb6ad4c0a441cd7596a2f"}, -] - -[package.dependencies] -click = ">=8.0.0" -mypy-extensions = ">=0.4.3" -pathspec = ">=0.9.0" -platformdirs = ">=2" - -[package.extras] -colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.7.4)"] -jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] -uvloop = ["uvloop (>=0.15.2)"] - [[package]] name = "certifi" version = "2024.2.2" @@ -818,17 +785,6 @@ files = [ {file = "MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"}, ] -[[package]] -name = "mypy-extensions" -version = "1.0.0" -description = "Type system extensions for programs checked with the mypy type checker." -optional = false -python-versions = ">=3.5" -files = [ - {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, - {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, -] - [[package]] name = "packaging" version = "24.0" @@ -851,21 +807,6 @@ files = [ {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, ] -[[package]] -name = "platformdirs" -version = "4.2.0" -description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -optional = false -python-versions = ">=3.8" -files = [ - {file = "platformdirs-4.2.0-py3-none-any.whl", hash = "sha256:0614df2a2f37e1a662acbd8e2b25b92ccf8632929bc6d43467e17fe89c75e068"}, - {file = "platformdirs-4.2.0.tar.gz", hash = "sha256:ef0cc731df711022c174543cb70a9b5bd22e5a9337c8624ef2c2ceb8ddad8768"}, -] - -[package.extras] -docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)"] - [[package]] name = "pygments" version = "2.17.2" @@ -1543,4 +1484,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "3ef4310711c8457a551cf95dd4819f3ccc7565b7a9a164b1ca70153614d10c14" +content-hash = "9d49d218517b78b86850ab5473938bd68349c670e5f5370e5effe65ed1de2df7" diff --git a/pyproject.toml b/pyproject.toml index 3629a2f07..8dbd5408d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,6 @@ faker = "*" [tool.poetry.group.dev] optional = true [tool.poetry.group.dev.dependencies] -black = "22.12" djlint = "^1.31.1" ruff = ">=0.2.1,<0.5.0" deptry = ">=0.12,<0.17"