Updating model with date_created
This commit is contained in:
parent
a40164da9a
commit
69f564a26f
2 changed files with 37 additions and 25 deletions
|
@ -33,6 +33,7 @@ class Result(db.Model):
|
||||||
log = db.Column(db.Text)
|
log = db.Column(db.Text)
|
||||||
score = db.Column(db.Integer, index=True)
|
score = db.Column(db.Integer, index=True)
|
||||||
ip = db.Column(sqlalchemy_utils.IPAddressType)
|
ip = db.Column(sqlalchemy_utils.IPAddressType)
|
||||||
|
created = db.Column(db.DateTime(timezone=True), server_default=db.func.now()) # Update time created server time.
|
||||||
|
|
||||||
def __init__(self, name="Anonymous", gpu=None, cpu=None, log=None, ip=None, score=1):
|
def __init__(self, name="Anonymous", gpu=None, cpu=None, log=None, ip=None, score=1):
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
|
@ -2,14 +2,16 @@
|
||||||
{% block title %}FOTB - Result #{{ name.id }} {% endblock %}
|
{% block title %}FOTB - Result #{{ name.id }} {% endblock %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
|
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1>{{ name.name | capitalize }}'s result <small>Yeeeah!</small></h1>
|
<h1>{{ name.name | capitalize }}'s result
|
||||||
</div>
|
<small>Yeeeah!</small>
|
||||||
<div class="panel panel-default">
|
</h1>
|
||||||
|
</div>
|
||||||
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h3 class="panel-title">Detailed View</h3>
|
<h3 class="panel-title">Detailed View <small class="pull-right">({{ name.created }})</small></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
|
@ -19,14 +21,23 @@
|
||||||
<span class="sr-only">{{ progress_bar['value'] }}% Complete </span>
|
<span class="sr-only">{{ progress_bar['value'] }}% Complete </span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h2><small><i class="glyphicon glyphicon-plus"></i></small> Score: {{ name.score }}</h2>
|
<h2>
|
||||||
<h3><small><i class="glyphicon glyphicon-leaf"></i></small> GPU: {{ name.gpu | safe}}</h3>
|
<small><i class="glyphicon glyphicon-plus"></i></small>
|
||||||
<h3><small><i class="glyphicon glyphicon-hdd"></i></small> CPU: {{ name.cpu | safe}}</h3>
|
Score: {{ name.score }}</h2>
|
||||||
<h3><small><i class="glyphicon glyphicon-list-alt"></i></small> Logfile</h3>
|
<h3>
|
||||||
|
<small><i class="glyphicon glyphicon-leaf"></i></small>
|
||||||
|
GPU: {{ name.gpu | safe }}</h3>
|
||||||
|
<h3>
|
||||||
|
<small><i class="glyphicon glyphicon-hdd"></i></small>
|
||||||
|
CPU: {{ name.cpu | safe }}</h3>
|
||||||
|
<h3>
|
||||||
|
<small><i class="glyphicon glyphicon-list-alt"></i></small>
|
||||||
|
Logfile
|
||||||
|
</h3>
|
||||||
<div class="well">
|
<div class="well">
|
||||||
{{ name.log | safe }}
|
{{ name.log | safe }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue