Pārlūkot izejas kodu

moving functions to backend

main
Simon Bowie pirms 2 gadiem
vecāks
revīzija
c7d5b863eb
2 mainītis faili ar 13 papildinājumiem un 10 dzēšanām
  1. +2
    -10
      web/app/hidden.py
  2. +11
    -0
      web/app/solr.py

+ 2
- 10
web/app/hidden.py Parādīt failu

@@ -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 Parādīt failu

@@ -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 = []

Notiek ielāde…
Atcelt
Saglabāt