I need to find model instances whose FileFields point to a particular set of files. This is probably obvious and documented somewhere but I can't seem to find it: what's the syntax for using FieldField.name in a django filter query? Something like:
models.MyModel.objects.filter(image__name='myfile.jpg')
Nevermind - it's just
models.MyModel.objects.filter(image='myfile.jpg')
a separate issue was causing me to think this wasn't working, but in fact it is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With