diff --git a/mayan/apps/bootstrap/migrations/0004_auto__chg_field_bootstrapsetup_created.py b/mayan/apps/bootstrap/migrations/0004_auto__chg_field_bootstrapsetup_created.py new file mode 100644 index 0000000000..991ff3e090 --- /dev/null +++ b/mayan/apps/bootstrap/migrations/0004_auto__chg_field_bootstrapsetup_created.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +from south.utils import datetime_utils as datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Changing field 'BootstrapSetup.created' + db.alter_column(u'bootstrap_bootstrapsetup', 'created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True)) + + def backwards(self, orm): + + # Changing field 'BootstrapSetup.created' + db.alter_column(u'bootstrap_bootstrapsetup', 'created', self.gf('django.db.models.fields.DateTimeField')()) + + models = { + u'bootstrap.bootstrapsetup': { + 'Meta': {'ordering': "['name']", 'object_name': 'BootstrapSetup'}, + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'fixture': ('django.db.models.fields.TextField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'blank': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '16'}) + } + } + + complete_apps = ['bootstrap'] \ No newline at end of file diff --git a/mayan/apps/bootstrap/models.py b/mayan/apps/bootstrap/models.py index 2fea94a7bc..ebb82adb5b 100644 --- a/mayan/apps/bootstrap/models.py +++ b/mayan/apps/bootstrap/models.py @@ -14,7 +14,6 @@ except ImportError: from django.core import management from django.core.files.uploadedfile import SimpleUploadedFile from django.db import models -from django.utils.timezone import now from django.utils.translation import ugettext_lazy as _ from .classes import BootstrapModel, FixtureMetadata @@ -32,7 +31,7 @@ class BootstrapSetup(models.Model): description = models.TextField(verbose_name=_(u'Description'), blank=True) fixture = models.TextField(verbose_name=_(u'Fixture'), help_text=_(u'These are the actual database structure creation instructions.')) type = models.CharField(max_length=16, verbose_name=_(u'Type'), choices=FIXTURE_TYPES_CHOICES) - created = models.DateTimeField(verbose_name=_('Creation date and time'), default=lambda: now(), editable=False) + created = models.DateTimeField(verbose_name=_('Creation date and time'), auto_now_add=True) objects = BootstrapSetupManager()