Skip to content
Snippets Groups Projects
Commit 395995d5 authored by Jean-Philippe Laverdure's avatar Jean-Philippe Laverdure
Browse files

Removes <key< and <value< param from resolve_datafiles

parent 76ffa9f8
No related branches found
No related tags found
1 merge request!111Populate /secure/my-sharegroups/ with the same groups that are available to a...
...@@ -90,8 +90,6 @@ class Query(graphene.ObjectType): ...@@ -90,8 +90,6 @@ class Query(graphene.ObjectType):
dataset = graphene.Field(DataSetType, id=graphene.String(), dbid=graphene.ID()) dataset = graphene.Field(DataSetType, id=graphene.String(), dbid=graphene.ID())
datafiles = graphene.List( datafiles = graphene.List(
DataFileType, DataFileType,
key=graphene.String(),
value=graphene.String(),
key_values=graphene.JSONString(), key_values=graphene.JSONString(),
keys=graphene.List(graphene.String), keys=graphene.List(graphene.String),
values=graphene.List(graphene.String), values=graphene.List(graphene.String),
...@@ -150,8 +148,6 @@ class Query(graphene.ObjectType): ...@@ -150,8 +148,6 @@ class Query(graphene.ObjectType):
def resolve_datafiles(self, info, **kwargs): def resolve_datafiles(self, info, **kwargs):
qs = DataFile.objects.accessible_to_profile(info.context.user.profile) qs = DataFile.objects.accessible_to_profile(info.context.user.profile)
key = kwargs.get('key', None)
value = kwargs.get('value', None)
key_values = kwargs.get('key_values', None) key_values = kwargs.get('key_values', None)
keys = kwargs.get('keys', None) keys = kwargs.get('keys', None)
values = kwargs.get('values', None) values = kwargs.get('values', None)
...@@ -159,12 +155,6 @@ class Query(graphene.ObjectType): ...@@ -159,12 +155,6 @@ class Query(graphene.ObjectType):
file_hash = kwargs.get('file_hash', None) file_hash = kwargs.get('file_hash', None)
id_list = kwargs.get('in_id_list', None) id_list = kwargs.get('in_id_list', None)
if key is not None:
qs = qs.filter(annotations__has_key=key)
if value is not None:
qs = qs.filter(annotations__values__icontains=value)
if key_values is not None: if key_values is not None:
for k, v in key_values.items(): for k, v in key_values.items():
qs = qs.filter(annotations__contains={k: v}) qs = qs.filter(annotations__contains={k: v})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment