Fix displaying game name on session list

This commit is contained in:
Lukáš Kucharczyk 2022-12-31 14:32:02 +01:00
parent 6ae46c5d34
commit cc4807c626
4 changed files with 32 additions and 4 deletions

Binary file not shown.

View File

@ -0,0 +1,28 @@
# Generated by Django 4.1.4 on 2022-12-31 13:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("tracker", "0005_alter_purchase_date_refunded"),
]
operations = [
migrations.AlterField(
model_name="session",
name="duration_calculated",
field=models.DurationField(blank=True, null=True),
),
migrations.AlterField(
model_name="session",
name="duration_manual",
field=models.DurationField(blank=True, null=True),
),
migrations.AlterField(
model_name="session",
name="note",
field=models.TextField(blank=True, null=True),
),
]

View File

@ -31,9 +31,9 @@ class Session(models.Model):
purchase = models.ForeignKey("Purchase", on_delete=models.CASCADE) purchase = models.ForeignKey("Purchase", on_delete=models.CASCADE)
timestamp_start = models.DateTimeField() timestamp_start = models.DateTimeField()
timestamp_end = models.DateTimeField() timestamp_end = models.DateTimeField()
duration_manual = models.DurationField() duration_manual = models.DurationField(blank=True, null=True)
duration_calculated = models.DurationField() duration_calculated = models.DurationField(blank=True, null=True)
note = models.TextField() note = models.TextField(blank=True, null=True)
def __str__(self): def __str__(self):
return self.purchase return self.purchase

View File

@ -9,7 +9,7 @@
<div class="dark:border-white dark:text-slate-300 text-lg">End</div> <div class="dark:border-white dark:text-slate-300 text-lg">End</div>
<div class="dark:border-white dark:text-slate-300 text-lg">Duration</div> <div class="dark:border-white dark:text-slate-300 text-lg">Duration</div>
{% for data in dataset %} {% for data in dataset %}
<div class="dark:text-slate-400">{{ data.name }}</div> <div class="dark:text-slate-400">{{ data.purchase }}</div>
<div class="dark:text-slate-400">{{ data.timestamp_start }}</div> <div class="dark:text-slate-400">{{ data.timestamp_start }}</div>
<div class="dark:text-slate-400">{{ data.timestamp_end }}</div> <div class="dark:text-slate-400">{{ data.timestamp_end }}</div>
<div class="dark:text-slate-400">{{ data.time_delta }}</div> <div class="dark:text-slate-400">{{ data.time_delta }}</div>