Put research parameters into correct fields

This commit is contained in:
PCoder 2021-08-31 22:59:41 +05:30
parent 1b62922706
commit 2e7e25a529
2 changed files with 5 additions and 5 deletions

View file

@ -119,14 +119,13 @@ def refresh_data(filename, fmt=None):
with transaction.atomic(): with transaction.atomic():
research_methods = add_linked(person, Method, row['Methods']) research_methods = add_linked(person, Method, row['Methods'])
person.research_methods = research_methods methods_people = [MethodsPeople.objects.get_or_create(method_id=m.id, person_id=person.id) for m in research_methods]
research_scales = add_linked(person, Scale, row['Scale']) research_scales = add_linked(person, Scale, row['Scale'])
person.research_scales = research_scales scales_people = [ScalesPeople.objects.get_or_create(scale_id=s.id, person_id=person.id) for s in research_scales]
research_taxa = add_linked(person, Taxon, row['Taxa']) research_taxa = add_linked(person, Taxon, row['Taxa'])
person.research_taxa = research_taxa taxa_people = [TaxaPeople.objects.get_or_create(taxon_id=t.id, person_id=person.id) for t in research_taxa]
research_fields = add_linked(person, Field, row['Field of expertise']) research_fields = add_linked(person, Field, row['Field of expertise'])
person.research_fields = research_fields fields_people = [FieldsPeople.objects.get_or_create(field_id=f.id, person_id=person.id) for f in research_fields]
person.index() person.index()
person.save() person.save()
count = count + 1 count = count + 1

View file

@ -349,6 +349,7 @@ def get_progress(request):
def generate(): def generate():
while 1: while 1:
p = str(100*c_progress) p = str(100*c_progress)
print("progress = %s" % p)
yield 'data: { "p":'+p+',"f":"'+c_filename+'"}\n\n' yield 'data: { "p":'+p+',"f":"'+c_filename+'"}\n\n'
time.sleep(1.0) time.sleep(1.0)
if c_filename == "": if c_filename == "":