Browse Source

moving functions to backend

main
Simon Bowie 2 years ago
parent
commit
c7d5b863eb
2 changed files with 13 additions and 10 deletions
  1. +2
    -10
      web/app/hidden.py
  2. +11
    -0
      web/app/solr.py

+ 2
- 10
web/app/hidden.py View File

text = f.read() text = f.read()
text = markdown.markdown(text) text = markdown.markdown(text)


core = 'active'
results_list = []
i = 0
while i <= 9:
search_results = solr.random_search(core)
results = search_results[0]
for result in results:
results_list.append(result)
i += 1
results = solr.get_number_random_records('active', 10)


return render_template('theme.html', text=text, results=results_list)
return render_template('theme.html', text=text, results=results)

+ 11
- 0
web/app/solr.py View File



return output return output


def get_number_random_records(core, number):
results_list = []
i = 0
while i <= number-1:
search_results = random_search(core)
results = search_results[0]
for result in results:
results_list.append(result)
i += 1
return results_list

def get_ten_random_elements(field): def get_ten_random_elements(field):
core = 'all' core = 'all'
output = [] output = []

Loading…
Cancel
Save