From ae2a30c9ac08b659b2babd800ce25f431a546b58 Mon Sep 17 00:00:00 2001 From: Ola Tarkowska Date: Tue, 20 Feb 2018 16:12:27 +0000 Subject: [PATCH 1/2] pass the callable but don't call it --- emgapi/filters.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/emgapi/filters.py b/emgapi/filters.py index 67545096f..b04690d7c 100644 --- a/emgapi/filters.py +++ b/emgapi/filters.py @@ -32,8 +32,6 @@ def published_year(): - # TODO: workaround for django.db.utils.ProgrammingError: - # (1146, "Table doesn't exist") try: years = emg_models.Publication.objects \ .filter(published_year__isnull=False, published_year__gt=0) \ @@ -45,8 +43,6 @@ def published_year(): def metadata_keywords(): - # TODO: workaround for django.db.utils.ProgrammingError: - # (1146, "Table doesn't exist") try: keywords = emg_models.VariableNames.objects.all() \ .order_by('var_name') \ @@ -57,8 +53,6 @@ def metadata_keywords(): def pipeline_version(): - # TODO: workaround for django.db.utils.ProgrammingError: - # (1146, "Table doesn't exist") try: pipelines = emg_models.Pipeline.objects.all() \ .order_by('release_version').distinct() @@ -78,7 +72,7 @@ class PublicationFilter(django_filters.FilterSet): label='ISBN', help_text='ISBN') published_year = filters.ChoiceFilter( - choices=published_year(), + choices=published_year, name='published_year', distinct=True, label='Published year', help_text='Published year') @@ -303,7 +297,7 @@ def filter_instrument_model(self, qs, name, value): return qs.filter(pk__in=samples) metadata_key = filters.ChoiceFilter( - choices=metadata_keywords(), + choices=metadata_keywords, method='filter_metadata_key', name='metadata_key', distinct=True, label='Metadata keyword', help_text='Metadata keyword') @@ -512,7 +506,7 @@ def filter_instrument_model(self, qs, name, value): instrument_model__iregex=WORD_MATCH_REGEX.format(value)) metadata_key = filters.ChoiceFilter( - choices=metadata_keywords(), + choices=metadata_keywords, method='filter_metadata_key', name='metadata_key', distinct=True, label='Metadata keyword', help_text='Metadata keyword') @@ -594,7 +588,7 @@ class Meta: class AnalysisJobFilter(RunFilter): pipeline_version = filters.ChoiceFilter( - choices=pipeline_version(), + choices=pipeline_version, name='pipeline', distinct=True, label='Pipeline version', help_text='Pipeline version') From 3d17b70dacd1cdc8c215ff7ba63797683a37df60 Mon Sep 17 00:00:00 2001 From: Ola Tarkowska Date: Tue, 20 Feb 2018 15:06:13 +0000 Subject: [PATCH 2/2] bump version 1.0.6 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9fe09bbeb..9566b02e8 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ _requirements = os.path.join(_base, 'requirements.txt') _requirements_test = os.path.join(_base, 'requirements-test.txt') -version = "1.0.5" +version = "1.0.6" install_requirements = [] with open(_requirements) as f: