From cac6c2a7be420c4c530674ee684e9d48b1524974 Mon Sep 17 00:00:00 2001 From: Ziggy Date: Wed, 29 May 2024 21:18:45 +0200 Subject: [PATCH] renamed private_rebuttals -> private_posts --- ...osts_answercount_alter_posts_commentcount_and_more.py | 6 +++--- backend/core/models.py | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/backend/core/migrations/0002_alter_posts_answercount_alter_posts_commentcount_and_more.py b/backend/core/migrations/0002_alter_posts_answercount_alter_posts_commentcount_and_more.py index f721ce2..2527d51 100644 --- a/backend/core/migrations/0002_alter_posts_answercount_alter_posts_commentcount_and_more.py +++ b/backend/core/migrations/0002_alter_posts_answercount_alter_posts_commentcount_and_more.py @@ -1,4 +1,4 @@ -# Generated by Django 5.0.4 on 2024-05-28 23:21 +# Generated by Django 5.0.4 on 2024-05-29 19:14 import django.db.models.deletion from django.conf import settings @@ -85,9 +85,9 @@ class Migration(migrations.Migration): models.ManyToManyField(related_name="posts", to="core.posts"), ), ( - "privateRebuttals", + "private_post", models.ManyToManyField( - related_name="private_rebuttals", to="core.posts" + related_name="private_post", to="core.posts" ), ), ( diff --git a/backend/core/models.py b/backend/core/models.py index e2b944c..a6bdbc5 100644 --- a/backend/core/models.py +++ b/backend/core/models.py @@ -49,8 +49,9 @@ class Posts(models.Model): class UserProfile(models.Model): # Public - user = None # type: ignore - user = models.OneToOneField(User, on_delete=models.CASCADE, null=True) + user: models.OneToOneField = models.OneToOneField( + User, on_delete=models.CASCADE, null=True + ) username: models.CharField = models.CharField( max_length=USERNAME_MAX_LEN, null=True ) @@ -67,6 +68,6 @@ class UserProfile(models.Model): savedPosts: models.ManyToManyField = models.ManyToManyField( Posts, related_name="saved_posts" ) - privateRebuttals: models.ManyToManyField = models.ManyToManyField( - Posts, related_name="private_rebuttals" + private_post: models.ManyToManyField = models.ManyToManyField( + Posts, related_name="private_post" )