mirror of
https://github.com/not-kennethreitz/morepython.org.git
synced 2026-06-05 06:56:14 +00:00
migrations
This commit is contained in:
@@ -1 +1,2 @@
|
||||
.env
|
||||
db.sqlite3
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# Generated by Django 2.1.7 on 2019-03-10 17:11
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.utils.timezone
|
||||
import taggit.managers
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('taggit', '0002_auto_20150616_2121'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Post',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.TextField()),
|
||||
('text', models.TextField()),
|
||||
('created_date', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('published_date', models.DateTimeField(blank=True, null=True)),
|
||||
('tags', taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags')),
|
||||
],
|
||||
),
|
||||
]
|
||||
@@ -1,4 +1,15 @@
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from taggit.managers import TaggableManager
|
||||
|
||||
|
||||
# Create your models here.
|
||||
class Post(models.Model):
|
||||
title = models.TextField()
|
||||
text = models.TextField()
|
||||
created_date = models.DateTimeField(default=timezone.now)
|
||||
published_date = models.DateTimeField(blank=True, null=True)
|
||||
tags = TaggableManager()
|
||||
|
||||
def __unicode__(self):
|
||||
return self.title
|
||||
|
||||
@@ -37,7 +37,8 @@ INSTALLED_APPS = [
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'taggit'
|
||||
'taggit',
|
||||
'core'
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
||||
Reference in New Issue
Block a user