Skip to content

Commit

Permalink
remove old ckeditor plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Ramsay <[email protected]>
  • Loading branch information
seapagan committed Oct 9, 2024
1 parent b49f448 commit 1c72471
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 216 deletions.
233 changes: 55 additions & 178 deletions blog/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,219 +1,96 @@
"""Database Migration."""
# Generated by Django 3.2.13 on 2022-06-29 13:03
# Generated by Django 5.1.2 on 2024-10-09 17:01

import ckeditor.fields
import ckeditor_uploader.fields
import blog.models
import django.db.models.deletion
import django.db.models.manager
import hitcount.mixins
from django.conf import settings
from django.db import migrations, models

import blog.models


class Migration(migrations.Migration):
"""Define the Initial database migration for the blog app."""

initial = True

dependencies = [
('preferences', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("preferences", "0001_initial"),
]

operations = [
migrations.CreateModel(
name="Blog",
name='Blog',
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("title", models.CharField(max_length=50)),
("desc", models.CharField(max_length=250)),
("created_at", models.DateTimeField(auto_now_add=True)),
("updated_at", models.DateTimeField(auto_now=True)),
("body", ckeditor_uploader.fields.RichTextUploadingField()),
("slug", models.SlugField(default="", unique=True)),
(
"image",
models.ImageField(
blank=True,
null=True,
storage=blog.models.OverwriteStorage(),
upload_to=blog.models.get_upload_path,
),
),
("draft", models.BooleanField(default=False)),
(
"image_attrib_name",
models.CharField(blank=True, default="", max_length=50),
),
(
"image_attrib_name_link",
models.CharField(blank=True, default="", max_length=100),
),
(
"image_attrib_site",
models.CharField(blank=True, default="", max_length=50),
),
(
"image_attrib_site_link",
models.URLField(blank=True, default=""),
),
(
"user",
models.ForeignKey(
default=1,
on_delete=django.db.models.deletion.CASCADE,
related_name="blog_posts",
to=settings.AUTH_USER_MODEL,
),
),
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=50)),
('desc', models.CharField(max_length=250)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('body', models.TextField()),
('slug', models.SlugField(default='', unique=True)),
('image', models.ImageField(blank=True, null=True, storage=blog.models.OverwriteStorage(), upload_to=blog.models.get_upload_path)),
('draft', models.BooleanField(default=False)),
('image_attrib_name', models.CharField(blank=True, default='', max_length=50)),
('image_attrib_name_link', models.CharField(blank=True, default='', max_length=100)),
('image_attrib_site', models.CharField(blank=True, default='', max_length=50)),
('image_attrib_site_link', models.URLField(blank=True, default='')),
('user', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='blog_posts', to=settings.AUTH_USER_MODEL)),
],
options={
"ordering": ["-created_at"],
'ordering': ['-created_at'],
},
bases=(models.Model, hitcount.mixins.HitCountModelMixin),
),
migrations.CreateModel(
name="Tag",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("tag_name", models.CharField(max_length=15)),
("slug", models.SlugField(default="", unique=True)),
("posts", models.ManyToManyField(blank=True, to="blog.Blog")),
(
"tag_creator",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="tags",
to=settings.AUTH_USER_MODEL,
),
),
],
),
migrations.CreateModel(
name="SitePreferences",
name='Comment',
fields=[
(
"preferences_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="preferences.preferences",
),
),
(
"sitename",
models.CharField(default="My Sexy Blog", max_length=50),
),
("title", models.CharField(default="My Blog", max_length=20)),
(
"heading",
models.CharField(
default="A blog of blogging blogosity.", max_length=200
),
),
("twitter_site", models.CharField(default="", max_length=50)),
(
"pinned_post",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
to="blog.blog",
),
),
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_by_guest', models.CharField(blank=True, max_length=50)),
('guest_email', models.EmailField(blank=True, max_length=254)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('body', models.TextField()),
('created_by_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='comments', to=settings.AUTH_USER_MODEL)),
('related_post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='blog.blog')),
],
options={
"verbose_name_plural": "Site Preferences",
'ordering': ['created_at'],
},
bases=("preferences.preferences",),
managers=[
("singleton", django.db.models.manager.Manager()),
],
),
migrations.CreateModel(
name="Redirect",
name='Redirect',
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("old_slug", models.SlugField(default="", unique=True)),
(
"old_post",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="blog.blog",
),
),
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('old_slug', models.SlugField(default='', unique=True)),
('old_post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.blog')),
],
),
migrations.CreateModel(
name="Comment",
name='SitePreferences',
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"created_by_guest",
models.CharField(blank=True, max_length=50),
),
("guest_email", models.EmailField(blank=True, max_length=254)),
("created_at", models.DateTimeField(auto_now_add=True)),
("updated_at", models.DateTimeField(auto_now=True)),
("body", ckeditor.fields.RichTextField(blank=True)),
(
"created_by_user",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="comments",
to=settings.AUTH_USER_MODEL,
),
),
(
"related_post",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="comments",
to="blog.blog",
),
),
('preferences_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='preferences.preferences')),
('sitename', models.CharField(default='My Sexy Blog', max_length=50)),
('title', models.CharField(default='My Blog', max_length=20)),
('heading', models.CharField(default='A blog of blogging blogosity.', max_length=200)),
('twitter_site', models.CharField(default='', max_length=50)),
('pinned_post', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='blog.blog')),
],
options={
"ordering": ["created_at"],
'verbose_name_plural': 'Site Preferences',
},
bases=('preferences.preferences',),
managers=[
('singleton', django.db.models.manager.Manager()),
],
),
migrations.CreateModel(
name='Tag',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('tag_name', models.CharField(max_length=15)),
('slug', models.SlugField(default='', unique=True)),
('posts', models.ManyToManyField(blank=True, to='blog.blog')),
('tag_creator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tags', to=settings.AUTH_USER_MODEL)),
],
),
]
8 changes: 4 additions & 4 deletions blog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from pathlib import Path
from typing import Any, Optional

from ckeditor.fields import RichTextField
from ckeditor_uploader.fields import RichTextUploadingField
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericRelation
from django.core.files.storage import FileSystemStorage
Expand Down Expand Up @@ -56,7 +54,8 @@ class Blog(models.Model, HitCountModelMixin):
desc = models.CharField(max_length=250)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
body = RichTextUploadingField(config_name="post")
# body = RichTextUploadingField(config_name="post")
body = models.TextField()
slug = models.SlugField(default="", unique=True)
image = models.ImageField(
upload_to=get_upload_path,
Expand Down Expand Up @@ -140,7 +139,8 @@ class Comment(models.Model):
)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
body = RichTextField(config_name="comment", blank=True)
# body = RichTextField(config_name="comment", blank=True)
body = models.TextField()

class Meta(TypedModelMeta):
"""Meta configuration for the Blog model."""
Expand Down
2 changes: 0 additions & 2 deletions pyblog/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
"compressor",
"django.forms",
"django_gravatar",
"ckeditor",
"ckeditor_uploader",
"dj_pagination",
"maintenance_mode",
"secretballot",
Expand Down
1 change: 0 additions & 1 deletion pyblog/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
user_views.EditProfileView.as_view(),
name="edit-profile",
),
path("ckeditor/", include("ckeditor_uploader.urls")),
path("likes/", include("likes.urls")),
path("maintenance-mode/", include("maintenance_mode.urls")),
path("", include("user_sessions.urls", "user_sessions")),
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ requires-python = ">=3.10"
dependencies = [
"dj-hitcount>=1.3.0",
"django>=5.1.2",
"django-ckeditor>=6.7.1",
"django-compressor>=4.5.1",
"django-gravatar2>=1.4.5",
"django-maintenance-mode>=0.21.1",
Expand Down Expand Up @@ -110,15 +109,14 @@ plugins.md036.enabled = false
plugins.md046.enabled = false

[tool.pytest.ini_options]
addopts = ["--cov", "--cov-report", "term-missing", "--cov-report", "html"]
# addopts = ["--cov", "--cov-report", "term-missing", "--cov-report", "html"]
filterwarnings = []
mock_use_standalone_module = true
pythonpath = ["blog", "pyBlog"]
DJANGO_SETTINGS_MODULE = "pyblog.settings"

[tool.coverage.run]
source = ["blog", "pyBlog"]
omit = ["*/tests/*"]
# source = ["blog", "pyBlog"]

[tool.ruff]
line-length = 80
Expand Down
Loading

0 comments on commit 1c72471

Please sign in to comment.