Skip to content

Commit

Permalink
Simple take on #72
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Kraft committed Mar 26, 2021
1 parent 1dea506 commit f1f0e33
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions odmf/db/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@ def iterrecords(self, witherrors=False):
f'{self}(type={self.type}) - data set has no records to iterate. Is the type correct?'
)

@property
def path(self):
from ..tools import Path as OPath
if self.filename:
p = OPath(self.filename)
if p.exists():
return p
return None


def removedataset(*args):
"""Removes a dataset and its records entirely from the database
Expand Down
12 changes: 12 additions & 0 deletions odmf/static/templates/dataset-edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ <h4 class="col-lg-4">Sorry, ${user()}</h4>
<td class="bold">Name:</td>
<td>${ds_act.name}</td>
</tr>
<tr py:if="ds_act.filename" >
<td class="bold">File</td>
<td>
<a py:if="ds_act.path" href="${ds_act.path.href}" py:content="ds_act.path.basename"/>
<div py:if="not ds_act.path" py:content="ds_act.filename"/>

</td>
</tr>
<tr py:if="ds_act.valuetype">
<td class="bold">Data:</td>
<td><a href="${conf.root_url}/valuetype/${ds_act.valuetype.id}" class="tooltip">
Expand Down Expand Up @@ -534,6 +542,10 @@ <h4 class="card-title">Some help for the Python and latex expressions</h4>
</div>

</div>
<div class="form-row">
<label for="filename">filename</label>
<input id="filename" name="filename" class="form-control" type="text" value="${ds_act.filename}"/>
</div>

<div class="form-row">
<label for="comment">Comments:</label>
Expand Down

0 comments on commit f1f0e33

Please sign in to comment.