guys, i need some help, i wanted to create a api where user can upload multiple images.
Here is my db
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.translation import gettext_lazy as _
# Defining a custom user model so we can making any changes in the future to this model
# without causing any conflicts with database.
class CustomUserModel(AbstractUser):
email = models.EmailField(_("Email"), unique=True, blank=False, null=False)
class Project(models.Model):
"""Project database to store projects name with images relative table"""
name = models.CharField(max_length=120)
created_on = models.DateTimeField('Project Created', auto_now_add=True)
def __str__(self):
return self.name
class Image(models.Model):
project = models.ForeignKey(Project, on_delete=models.CASCADE, related_name='images')
image = models.ImageField(upload_to="images")