Skip to content

Commit e0d913b

Browse files
author
Miguel Leon
authored
Merge branch 'miguelworking' into master
2 parents d6b1628 + 43269ab commit e0d913b

File tree

7 files changed

+26
-11
lines changed

7 files changed

+26
-11
lines changed

ODM2AdminExamplePostgresqlDB

91.1 KB
Binary file not shown.

docker/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ RUN apt-get update --fix-missing && apt-get install -y postgresql postgresql-cli
2424

2525
RUN git clone "https://github.com/miguelcleon/ODM2-Admin"
2626

27+
2728
RUN cd ODM2-Admin && latest=$(git describe --tags) && git checkout ${latest}
2829

2930
RUN service postgresql start && su - postgres -c 'psql -U postgres -c "create database odm2_db"'

docker/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ Requirements to run [docker image](https://hub.docker.com/r/lsetiawan/odm2admin/
55
1. Docker installed on Linux, MacOS, or Windows.
66

77
To run:
8-
$ docker run -d -p 8010:8010 --name odm2admintest lsetiawan/odm2admin:latest
8+
$ docker run -d -p 8010:8010 --name odm2admintest lsetiawan/odm2admin:latest
9+

docker/startup.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ source activate odm2adminenv
55
conda install --yes -c conda-forge pytz
66

77
echo "Building database..."
8+
89
su - postgres -c 'pg_restore -d odm2_db -1 -v "/ODM2-Admin/ODM2AdminExamplePostgresqlDB"'
10+
911
su - postgres -c "psql -U postgres -d postgres -c \"alter user postgres with password 'test';\""
1012

1113
echo "Running server..."

odm2admin/management/commands/ProcessDataLoggerFile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ def handle(self, *args, **options): # (f,fileid, databeginson,columnheaderson,
152152
for j in range(numCols):
153153
# raise ValidationError(" in file " + row[j] + "
154154
# in obj column label "+dloggerfileColumns.columnlabel)
155-
if row[j] == dloggerfileColumns.columnlabel:
155+
if row[j] == dloggerfileColumns.columnlabel \
156+
and dloggerfileColumns.columndescription !="skip":
156157
foundColumn = True
157158
dloggerfileColumns.columnnum = j
158159
rowColumnMap += [dloggerfileColumns]

odm2admin/models.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,9 @@ class Dataloggerfilecolumns(models.Model):
968968
verbose_name="instrument output variable",
969969
db_column='instrumentoutputvariableid')
970970
columnlabel = models.CharField(verbose_name="column label", max_length=50)
971-
columndescription = models.CharField(verbose_name="column description", max_length=5000,
971+
columndescription = models.CharField(verbose_name="column description",
972+
help_text="To disble ingestion of a column type 'skip'",
973+
max_length=5000,
972974
blank=True)
973975
measurementequation = models.CharField(verbose_name="measurement equation", max_length=255,
974976
blank=True)
@@ -1054,7 +1056,7 @@ def save(self, *args, **kwargs):
10541056
fileid = self.dataloggerfileid.dataloggerfileid
10551057
management.call_command('ProcessDataLoggerFile', linkname,str(fileid)
10561058
, str(self.databeginson), str(self.columnheaderson),
1057-
False, False)
1059+
False, False, False)
10581060
super(ProcessDataloggerfile, self).save(*args, **kwargs)
10591061
# def get_actions(self, request):
10601062
# #Disable delete
@@ -2727,7 +2729,8 @@ def email_text(self):
27272729
return s
27282730

27292731
def csvheaderShort(self):
2730-
s = '\" {0} -unit-{1}-processing level-{2}\",'.format(
2732+
s = 'method,'
2733+
s += '\" {0} -unit-{1}-processing level-{2}\",'.format(
27312734
self.resultid.resultid.variableid.variablecode,
27322735
self.resultid.resultid.unitsid.unitsname,
27332736
self.resultid.resultid.processing_level.processinglevelcode)
@@ -2736,6 +2739,8 @@ def csvheaderShort(self):
27362739
return s
27372740

27382741
def csvoutputShort(self):
2742+
s = '\" {0}\",'.format(
2743+
self.resultid.resultid.featureactionid.action.method.methodcode)
27392744
s = '{0},'.format(self.datavalue)
27402745
s += '{0}'.format(self.qualitycodecv)
27412746
trvannotation = Timeseriesresultvalueannotations.objects.filter(valueid=self.valueid)
@@ -2807,7 +2812,8 @@ def email_text(self):
28072812
s += 'location- {0}'.format(self.samplingfeaturename)
28082813
return s
28092814
def csvheaderShort(self):
2810-
s = '\" {0} -unit-{1}-processing level-{2}\",'.format(
2815+
s = 'method,'
2816+
s += '\" {0} -unit-{1}-processing level-{2}\",'.format(
28112817
self.variablecode,
28122818
self.unitsabbreviation,
28132819
self.processinglevelcode)
@@ -2832,7 +2838,9 @@ def csvoutput(self):
28322838

28332839

28342840
def csvoutputShort(self):
2835-
s = '{0},'.format(self.datavalue)
2841+
s = '\" {0}\",'.format(
2842+
self.resultid.resultid.featureactionid.action.method.methodcode)
2843+
s += '{0},'.format(self.datavalue)
28362844
s += '{0},'.format(self.qualitycodecv)
28372845
return s
28382846

@@ -2906,7 +2914,8 @@ def email_text(self):
29062914
return s
29072915

29082916
def csvheaderShort(self):
2909-
s = '\" {0} -unit-{1}-processing level-{2}\",'.format(
2917+
s = 'method,'
2918+
s += '\" {0} -unit-{1}-processing level-{2}\",'.format(
29102919
self.variablecode,
29112920
self.unitsabbreviation,
29122921
self.processinglevelcode)
@@ -2915,7 +2924,10 @@ def csvheaderShort(self):
29152924
return s
29162925

29172926
def csvoutputShort(self):
2918-
s = '{0},'.format(self.datavalue)
2927+
result = Results.objects.get(resultid=self.resultid)
2928+
s = '\" {0}\",'.format(
2929+
result.featureactionid.action.method.methodcode)
2930+
s += '{0},'.format(self.datavalue)
29192931
s += '{0},'.format(self.qualitycodecv)
29202932
if self.annotationtext:
29212933
s += '\"{0} \",'.format(self.annotationtext)

templatesAndSettings/templates/LocationDataInfo.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171

7272

7373
<tr ><th scope="col" class="section">Result Series</td>
74-
<th scope="col" class="sortable column-resultid">id</th>
7574
<th scope="col" class="sortable column-resultid">Variable</th>
7675
<th scope="col" class="sortable column-resultid">Units</th>
7776
<th scope="col" class="sortable column-resultid">Graph Data</th>
@@ -81,7 +80,6 @@
8180
{% assign donut 1 %}
8281
{% assign done 1 %}
8382
<tr class="row1">
84-
<td>{{ Result.feature_action }} </td>
8583
<td >{{Result.resultid}}</td>
8684
<td >{{Result.variableid.variablecode}}</td>
8785
<td >{{Result.unitsid}}</td>

0 commit comments

Comments
 (0)