Skip to content

Commit ec27d71

Browse files
authored
Merge pull request #14 from farooq13/work
improved
2 parents 8a7914f + 423da9f commit ec27d71

File tree

5 files changed

+19
-0
lines changed

5 files changed

+19
-0
lines changed
115 Bytes
Binary file not shown.

base/migrations/0004_post_image.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 5.1.1 on 2024-11-20 16:42
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('base', '0003_notification_date'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='post',
15+
name='image',
16+
field=models.ImageField(blank=True, null=True, upload_to='uploads/post_photos'),
17+
),
18+
]
Binary file not shown.

base/models.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
class Post(models.Model):
1010
body = models.TextField()
11+
image = models.ImageField(upload_to='uploads/post_photos', null=True, blank=True)
1112
author = models.ForeignKey(User, on_delete=models.CASCADE)
1213
likes = models.ManyToManyField(User, related_name='likes', blank=True)
1314
dislikes = models.ManyToManyField(User, related_name='dislikes', blank=True)

db.sqlite3

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)