Reputation: 227
I have two models, Picture and SubmittedPicture as follows:
class Picture(models.Model):
user = models.ForeignKey(User)
pic = ImageField(upload_to='userpics/%Y/%m/%d/%H')
class SubmittedPicture(models.Model):
picture = models.ForeignKey(Picture, unique=True)
description = models.TextField()
submitted_time = models.DateTimeField(auto_now_add=True)
Now, I need to query for all Pictures which do not have a corresponding SubmittedPicture. I tried several options, but none of them was functional.
I read through the Django-doc, but couldn't find something useful.
Thanks in advance!
Upvotes: 1
Views: 71