我使用的是这种代码形式的简单模型(没有任何关系)。但我对两个模型Gallery
和GalleryImage
https://github.com/Chive/django-multiupload
class Gallery(models.Model):
title = models.CharField(max_length=200)
date = models.DateField(auto_now_add=True)
author = models.ForeignKey(User, blank=True)
class GalleryImage(models.Model):
gallery = models.ForeignKey(Gallery, on_delete=models.CASCADE, related_name='image_in_gallery')
image = models.ImageField(upload_to='gallery/%Y/%m/%d')
title = models.CharField(max_length=200)
在这种情况下forms.py
应该是什么?