Commit d4bc38c4 authored by fred's avatar fred

add creation timestamp to tracks

parent f6fd9f5d
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('nonstop', '0006_auto_20171002_2231'),
]
operations = [
migrations.AlterModelOptions(
name='track',
options={'ordering': ['creation_timestamp']},
),
migrations.AddField(
model_name='track',
name='creation_timestamp',
field=models.DateTimeField(auto_now_add=True, null=True),
),
]
...@@ -44,6 +44,11 @@ class Track(models.Model): ...@@ -44,6 +44,11 @@ class Track(models.Model):
cfwb = models.BooleanField('CFWB', default=False) cfwb = models.BooleanField('CFWB', default=False)
nonstop_zones = models.ManyToManyField('emissions.Nonstop', blank=True) nonstop_zones = models.ManyToManyField('emissions.Nonstop', blank=True)
creation_timestamp = models.DateTimeField(auto_now_add=True, null=True)
class Meta:
ordering = ['creation_timestamp']
def get_absolute_url(self): def get_absolute_url(self):
return reverse('track-view', kwargs={'pk': self.id}) return reverse('track-view', kwargs={'pk': self.id})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment