mirror of
https://github.com/not-kennethreitz/morepython.org.git
synced 2026-06-05 15:00:18 +00:00
migration
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
# Generated by Django 2.1.7 on 2019-03-11 10:41
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.utils.timezone
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0002_auto_20190310_1337'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='post',
|
||||
name='id',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='post',
|
||||
name='published',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='post',
|
||||
name='uri',
|
||||
field=models.URLField(default=django.utils.timezone.now),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='post',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False),
|
||||
),
|
||||
]
|
||||
+7
-1
@@ -1,14 +1,20 @@
|
||||
import uuid
|
||||
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from django.core.validators import URLValidator
|
||||
from taggit.managers import TaggableManager
|
||||
|
||||
|
||||
# Create your models here.
|
||||
class Post(models.Model):
|
||||
"""A Post, posted on the site."""
|
||||
title = models.TextField()
|
||||
text = models.TextField()
|
||||
timestamp = models.DateTimeField(default=timezone.now)
|
||||
tags = TaggableManager()
|
||||
uri = models.URLField()
|
||||
uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
published = models.BooleanField(editable=True, default=False)
|
||||
|
||||
def __unicode__(self):
|
||||
return self.title
|
||||
|
||||
Reference in New Issue
Block a user