0

我升级了很多

created = django.db.models.DateTimeField

created = django_extensions.db.fields.CreationDateTimeField

但是,当我跑步时

./manage.py schemamigration app --auto

然后

./manage.py migrate app

我明白了

RuntimeWarning: DateTimeField received a naive datetime (2013-05-13 11:09:45.149280) while time zone support is active.

我需要做些什么特别的事情来告诉南关于 django-extensions 字段的信息吗?

这是实际的迁移代码:

def forwards(self, orm):
    # Changing field 'Advertiser.updated'
    db.alter_column('advertiser', 'updated', self.gf('django.db.models.fields.DateTimeField')())
    # Changing field 'Advertiser.created'
    db.alter_column('advertiser', 'created', self.gf('django.db.models.fields.DateTimeField')())
    # Adding field 'Campaign.created'
    db.add_column('advertiser_campaign', 'created',
                  self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now, blank=True),
                  keep_default=False)

    # Adding field 'Campaign.updated'
    db.add_column('advertiser_campaign', 'updated',
                  self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now, blank=True),
                  keep_default=False)
4

0 回答 0