Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions app/Meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def insert_experiments(username,fileName,status=True):
#Checking necessary columns are there.
columns=data.columns.values.tolist()
accepted_columns=['name','start_date','end_date','description']
if(all(x in accepted_columns for x in columns)):
if(all(x in columns for x in accepted_columns)):
if status == False:
msg = {'Message' : 'Successfully Validated',
'Table' : 'Experiments'}
Expand Down Expand Up @@ -149,7 +149,7 @@ def insert_sites(fileName,shp_file,dbf_file,prj_file,shx_file,status=True):
poly = Polygon(flat_list)
data.loc[index, 'geometry'] = poly

if(all(x in accepted_columns for x in columns)):
if(all(x in columns for x in accepted_columns)):
if status == False:
msg = {'Message' : 'Successfully Validated',
'Table' : 'Sites'}
Expand Down Expand Up @@ -226,7 +226,7 @@ def insert_treatments(username,fileName,status=True):
columns=data.columns.values.tolist()
accepted_columns=['name','definition','control']

if(all(x in accepted_columns for x in columns)):
if(all(x in columns for x in accepted_columns)):
if status == False:
msg = {'Message' : 'Successfully Validated',
'Table' : 'Treatments'}
Expand Down Expand Up @@ -288,7 +288,7 @@ def insert_cultivars(fileName, status=True):
columns=data.columns.values.tolist()
accepted_columns=['name','species','ecotype','notes']

if(all(x in accepted_columns for x in columns)):
if(all(x in columns for x in accepted_columns)):
if status == False:
msg = {'Message' : 'Successfully Validated',
'Table' : 'Cultivars'}
Expand Down Expand Up @@ -356,7 +356,7 @@ def insert_citations(username,fileName, status=True):
columns=data.columns.values.tolist()
accepted_columns=['author','year','title','journal','vol','pg','url','pdf','doi']

if(all(x in accepted_columns for x in columns)):
if(all(x in columns for x in accepted_columns)):
if status == False:
msg = {'Message' : 'Successfully Validated',
'Table' : 'Citations'}
Expand Down Expand Up @@ -413,7 +413,7 @@ def insert_experimentSites(fileName, status=True):
columns=data.columns.values.tolist()
accepted_columns=['experiment_name','sitename']

if(all(x in accepted_columns for x in columns)):
if(all(x in columns for x in accepted_columns)):
if status == False:
msg = {'Message' : 'Successfully Validated',
'Table' : 'Experiments_sites'}
Expand Down Expand Up @@ -474,7 +474,7 @@ def insert_experimentTreatments(fileName, status=True):
columns=data.columns.values.tolist()
accepted_columns=['experiment_name','treatment_name']

if(all(x in accepted_columns for x in columns)):
if(all(x in columns for x in accepted_columns)):
if status == False:
msg = {'Message' : 'Successfully Validated',
'Table' : 'Experiments_treatments'}
Expand Down Expand Up @@ -534,7 +534,7 @@ def insert_sitesCultivars(fileName, status=True):
columns=data.columns.values.tolist()
accepted_columns=['sitename','cultivar_name','specie_id']

if(all(x in accepted_columns for x in columns)):
if(all(x in columns for x in accepted_columns)):
if status == False:
msg = {'Message' : 'Successfully Validated',
'Table' : 'Sites_cultivars'}
Expand Down Expand Up @@ -595,7 +595,7 @@ def insert_citationsSites(fileName, status=True):
columns=data.columns.values.tolist()
accepted_columns=['author','year','title','sitename']

if(all(x in accepted_columns for x in columns)):
if(all(x in columns for x in accepted_columns)):
if status == False:
msg = {'Message' : 'Successfully Validated',
'Table' : 'Citations_sites'}
Expand Down
1 change: 1 addition & 0 deletions app/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ WSGIserver
gevent
pandas==0.24.2
connexion==2.2.0
jsonschema==3.2.0
Flask==1.0
Werkzeug==0.15.3
SQLAlchemy==1.3.0
Expand Down