From 0f0505f24d9930ba5c3e06a504a3e522f130b56c Mon Sep 17 00:00:00 2001 From: Scot Hacker Date: Mon, 15 Jun 2015 00:11:50 -0700 Subject: [PATCH] Fix field warnings for Django 1.8 (with migration) --- todo/migrations/0002_auto_20150614_2339.py | 24 ++++++++++++++++++++++ todo/models.py | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 todo/migrations/0002_auto_20150614_2339.py diff --git a/todo/migrations/0002_auto_20150614_2339.py b/todo/migrations/0002_auto_20150614_2339.py new file mode 100644 index 0000000..a346e88 --- /dev/null +++ b/todo/migrations/0002_auto_20150614_2339.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('todo', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='item', + name='created_date', + field=models.DateField(auto_now=True), + ), + migrations.AlterField( + model_name='item', + name='priority', + field=models.PositiveIntegerField(), + ), + ] diff --git a/todo/models.py b/todo/models.py index 65b16ef..fe29179 100644 --- a/todo/models.py +++ b/todo/models.py @@ -42,14 +42,14 @@ class List(models.Model): class Item(models.Model): title = models.CharField(max_length=140) list = models.ForeignKey(List) - created_date = models.DateField(auto_now=True, auto_now_add=True) + created_date = models.DateField(auto_now=True) due_date = models.DateField(blank=True, null=True, ) completed = models.BooleanField(default=None) completed_date = models.DateField(blank=True, null=True) created_by = models.ForeignKey(User, related_name='todo_created_by') assigned_to = models.ForeignKey(User, related_name='todo_assigned_to') note = models.TextField(blank=True, null=True) - priority = models.PositiveIntegerField(max_length=3) + priority = models.PositiveIntegerField() # Model method: Has due date for an instance of this object passed? def overdue_status(self):