Merge pull request #79 from ramielrowe/search_count

Tweaking counts and adding 'All' option to search result count
This commit is contained in:
Andrew Melton 2013-04-10 12:05:33 -07:00
commit 84afc2741d
2 changed files with 6 additions and 4 deletions

View File

@ -476,7 +476,9 @@ def search(request, deployment_id):
rows = rows.filter(**{column: value}) rows = rows.filter(**{column: value})
if not updates: if not updates:
rows = rows.exclude(event='compute.instance.update') rows = rows.exclude(event='compute.instance.update')
rows = rows.order_by('-when')[:int(count)] rows = rows.order_by('-when')
if count != 'All':
rows = rows[:int(count)]
_post_process_raw_data(rows) _post_process_raw_data(rows)
c['rows'] = rows c['rows'] = rows
c['allow_expansion'] = True c['allow_expansion'] = True

View File

@ -61,10 +61,10 @@ function search_form(deployment_id)
<input type='text' id='query' size='60' value=''/> <input type='text' id='query' size='60' value=''/>
Include Updates: <input type='checkbox' id="updates" checked /> Include Updates: <input type='checkbox' id="updates" checked />
<select id='count'> <select id='count'>
<option>10 <option selected>25
<option selected>20
<option>50
<option>100 <option>100
<option>250
<option>All
</select> </select>
<input type='submit' value='Search' onclick='return search_form({{deployment_id}});'/> <input type='submit' value='Search' onclick='return search_form({{deployment_id}});'/>
</form> </form>