diff options
| author | Bobby <[email protected]> | 2022-10-02 12:18:08 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-10-02 12:18:08 -0400 |
| commit | 194c248b20c4f1e4d02c7ffd05b4a348db68ef5b (patch) | |
| tree | 090cfbcf6015d7cc4b9b6009bc001fc39ca08aa8 /announcements | |
| parent | 1e624f30c11e22699e6f6933b18a7a257a2ab73b (diff) | |
| download | thatcomputerscientist-194c248b20c4f1e4d02c7ffd05b4a348db68ef5b.tar.xz thatcomputerscientist-194c248b20c4f1e4d02c7ffd05b4a348db68ef5b.zip | |
updates section
Diffstat (limited to 'announcements')
| -rw-r--r-- | announcements/migrations/0003_rename_body_announcement_content_and_more.py | 22 | ||||
| -rw-r--r-- | announcements/models.py | 5 |
2 files changed, 24 insertions, 3 deletions
diff --git a/announcements/migrations/0003_rename_body_announcement_content_and_more.py b/announcements/migrations/0003_rename_body_announcement_content_and_more.py new file mode 100644 index 00000000..78ceb002 --- /dev/null +++ b/announcements/migrations/0003_rename_body_announcement_content_and_more.py @@ -0,0 +1,22 @@ +# Generated by Django 4.0.6 on 2022-10-02 16:06 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('announcements', '0002_rename_date_announcement_created_at'), + ] + + operations = [ + migrations.RenameField( + model_name='announcement', + old_name='body', + new_name='content', + ), + migrations.RemoveField( + model_name='announcement', + name='title', + ), + ] diff --git a/announcements/models.py b/announcements/models.py index 06dea701..c836fe5d 100644 --- a/announcements/models.py +++ b/announcements/models.py @@ -3,8 +3,7 @@ from django.conf import settings # Create your models here. class Announcement(models.Model): - title = models.CharField(max_length=100) - body = models.TextField() + content = models.TextField() created_at = models.DateTimeField(auto_now_add=True) author = models.ForeignKey( settings.AUTH_USER_MODEL, @@ -14,5 +13,5 @@ class Announcement(models.Model): is_new = models.BooleanField(default=True) def __str__(self): - return self.title + return self.content |
