diff --git a/bikeshop_project/core/migrations/0002_auto_20170101_2054.py b/bikeshop_project/core/migrations/0002_auto_20170101_2054.py new file mode 100644 index 0000000..c7e3430 --- /dev/null +++ b/bikeshop_project/core/migrations/0002_auto_20170101_2054.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2017-01-01 20:54 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='visit', + name='created_at', + field=models.DateTimeField(default=django.utils.timezone.now), + ), + ] diff --git a/bikeshop_project/core/models.py b/bikeshop_project/core/models.py index 75e3cb9..79d14d5 100644 --- a/bikeshop_project/core/models.py +++ b/bikeshop_project/core/models.py @@ -67,7 +67,7 @@ class Visit(models.Model): 'registration.Member', on_delete=models.CASCADE ) - created_at = models.DateTimeField(auto_now_add=True) + created_at = models.DateTimeField(default=timezone.now) purpose = models.CharField(max_length=50, choices=visit_choices) def __str__(self):