Skip to content

Commit

Permalink
pass the callable but don't call it
Browse files Browse the repository at this point in the history
  • Loading branch information
atarkowska committed Feb 20, 2018
1 parent d153ca0 commit ae2a30c
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions emgapi/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand All @@ -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') \
Expand All @@ -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()
Expand All @@ -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')

Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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')

Expand Down

0 comments on commit ae2a30c

Please sign in to comment.