diff --git a/instances/migrations/0003_instance_created.py b/instances/migrations/0003_instance_created.py new file mode 100644 index 0000000..32d4ac9 --- /dev/null +++ b/instances/migrations/0003_instance_created.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import datetime + + +class Migration(migrations.Migration): + + dependencies = [ + ('instances', '0002_instance_is_template'), + ] + + operations = [ + migrations.AddField( + model_name='instance', + name='created', + field=models.DateField(default=datetime.datetime(2017, 10, 26, 8, 5, 55, 797326), auto_now_add=True), + preserve_default=False, + ), + ] diff --git a/instances/models.py b/instances/models.py index bf2a1c4..fa1ed40 100644 --- a/instances/models.py +++ b/instances/models.py @@ -7,6 +7,7 @@ class Instance(models.Model): name = models.CharField(max_length=20) uuid = models.CharField(max_length=36) is_template = models.BooleanField(default=False) + created = models.DateField(auto_now_add=True) def __unicode__(self): return self.name