Skip to content

Commit

Permalink
Tweak resource query
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader authored and johnglover committed Aug 13, 2013
1 parent efc2b73 commit 5857635
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ckan/logic/action/get.py
Expand Up @@ -1318,8 +1318,10 @@ def resource_search(context, data_dict):
offset = data_dict.get('offset')
limit = data_dict.get('limit')

# TODO: should we check for user authentication first?
q = model.Session.query(model.Resource)
q = model.Session.query(model.Resource).join(model.ResourceGroup).join(model.Package)
q = q.filter(model.Package.state == 'active')
q = q.filter(model.Resource.state == 'active')

resource_fields = model.Resource.get_columns()
for field, terms in fields.items():

Expand Down

0 comments on commit 5857635

Please sign in to comment.