Bladeren bron

moving functions to backend

main
Simon Bowie 2 jaren geleden
bovenliggende
commit
c7d5b863eb
2 gewijzigde bestanden met toevoegingen van 13 en 10 verwijderingen
  1. +2
    -10
      web/app/hidden.py
  2. +11
    -0
      web/app/solr.py

+ 2
- 10
web/app/hidden.py Bestand weergeven

@@ -23,14 +23,6 @@ def active():
text = f.read()
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 Bestand weergeven

@@ -171,6 +171,17 @@ def parse_result(id, input):

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):
core = 'all'
output = []

Laden…
Annuleren
Opslaan