announcement model.py 里面增加一个新的字段(最后更新时间)
This commit is contained in:
23
account/migrations/0004_auto_20150806_1251.py
Normal file
23
account/migrations/0004_auto_20150806_1251.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import models, migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('account', '0003_user_email'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='user',
|
||||||
|
name='admin_group',
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='user',
|
||||||
|
name='admin_type',
|
||||||
|
field=models.IntegerField(default=0),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -17,8 +17,9 @@ class Migration(migrations.Migration):
|
|||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||||
('title', models.CharField(max_length=50)),
|
('title', models.CharField(max_length=50)),
|
||||||
('description', models.TextField()),
|
('content', models.TextField()),
|
||||||
('create_time', models.DateTimeField(auto_now_add=True)),
|
('create_time', models.DateTimeField(auto_now_add=True)),
|
||||||
|
('last_update_time', models.DateTimeField(auto_now=True)),
|
||||||
('visible', models.BooleanField(default=True)),
|
('visible', models.BooleanField(default=True)),
|
||||||
('created_by', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
|
('created_by', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models, migrations
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('announcement', '0001_initial'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.RenameField(
|
|
||||||
model_name='announcement',
|
|
||||||
old_name='description',
|
|
||||||
new_name='content',
|
|
||||||
),
|
|
||||||
]
|
|
||||||
@@ -13,6 +13,8 @@ class Announcement(models.Model):
|
|||||||
create_time = models.DateTimeField(auto_now_add=True)
|
create_time = models.DateTimeField(auto_now_add=True)
|
||||||
# 这个公告是谁创建的
|
# 这个公告是谁创建的
|
||||||
created_by = models.ForeignKey(User)
|
created_by = models.ForeignKey(User)
|
||||||
|
# 最后更新时间
|
||||||
|
last_update_time = models.DateTimeField(auto_now=True)
|
||||||
# 是否可见 false的话相当于删除
|
# 是否可见 false的话相当于删除
|
||||||
visible = models.BooleanField(default=True)
|
visible = models.BooleanField(default=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user