tags:

views:

41

answers:

1

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')
A: 

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.

Parand