From 92ed978d3328f24ec5c3973f9d44fc19f3f7f817 Mon Sep 17 00:00:00 2001 From: Drew Larson Date: Sun, 1 Jan 2017 17:30:30 -0600 Subject: [PATCH] Allow to be overridden. --- .../migrations/0002_auto_20170101_2054.py | 21 +++++++++++++++++++ bikeshop_project/core/models.py | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 bikeshop_project/core/migrations/0002_auto_20170101_2054.py 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):