Migrated articles app.
parent
0a3ef1070f
commit
6aec5a5659
|
|
@ -0,0 +1,72 @@
|
|||
# Generated by Django 5.1.6 on 2025-02-16 23:10
|
||||
|
||||
import django.db.models.deletion
|
||||
import markdownx.models
|
||||
import tagulous.models.fields
|
||||
import tagulous.models.models
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Category',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=40, unique=True)),
|
||||
('slug', models.SlugField(max_length=40, unique=True)),
|
||||
('introduction', models.TextField(blank=True)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['title'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Tagulous_Article_tags',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255, unique=True)),
|
||||
('slug', models.SlugField()),
|
||||
('count',
|
||||
models.IntegerField(default=0, help_text='Internal counter of how many times this tag is in use')),
|
||||
('protected',
|
||||
models.BooleanField(default=False, help_text='Will not be deleted when the count reaches 0')),
|
||||
],
|
||||
options={
|
||||
'ordering': ('name',),
|
||||
'abstract': False,
|
||||
'unique_together': {('slug',)},
|
||||
},
|
||||
bases=(tagulous.models.models.BaseTagModel, models.Model),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Article',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=200)),
|
||||
('subtitle', models.CharField(blank=True, max_length=200, null=True)),
|
||||
('slug', models.SlugField(max_length=200, unique=True)),
|
||||
('introduction', models.TextField(blank=True)),
|
||||
('body', markdownx.models.MarkdownxField()),
|
||||
('summary', markdownx.models.MarkdownxField(blank=True)),
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('updated', models.DateTimeField(auto_now_add=True)),
|
||||
('is_published', models.BooleanField(default=False)),
|
||||
('is_updated', models.BooleanField(default=False)),
|
||||
('is_featured', models.BooleanField(default=False)),
|
||||
('category', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='articles',
|
||||
to='articles.category')),
|
||||
('tags', tagulous.models.fields.TagField(_set_tag_meta=True, force_lowercase=True,
|
||||
help_text='Enter a comma-separated tag string',
|
||||
to='articles.tagulous_article_tags')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-created'],
|
||||
},
|
||||
),
|
||||
]
|
||||
|
|
@ -39,7 +39,8 @@ INSTALLED_APPS = [
|
|||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'articles.apps.ArticlesConfig'
|
||||
'articles.apps.ArticlesConfig',
|
||||
'markdownx',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
|
|
|||
Loading…
Reference in New Issue