Re: Reverse Foriegnkey filtering

2016-01-30 Thread Peter of the Norse
> On Jan 27, 2016, at 5:15 AM, Michal Petrucha > wrote: > > On Wed, Jan 27, 2016 at 11:58:23AM +, Jonty Needham wrote: >> I've found a need to do this and I'm struggling. Some info seems to >> indicate that django doesn't support this. How is it meant to be done? >> >> Basically to be clear

Re: Reverse Foriegnkey filtering

2016-01-27 Thread Michal Petrucha
On Wed, Jan 27, 2016 at 11:58:23AM +, Jonty Needham wrote: > I've found a need to do this and I'm struggling. Some info seems to > indicate that django doesn't support this. How is it meant to be done? > > Basically to be clear, I need to filter one queryset on a reverse > foriegnkey relation

Re: Reverse Foriegnkey filtering

2016-01-27 Thread Rafael E. Ferrero
why not filter model2 with select_related ?? (you already try to put a related_name in the foreignkey of model2?) cheers! Rafael E. Ferrero 2016-01-27 8:58 GMT-03:00 Jonty Needham : > I've found a need to do this and I'm struggling. Some info seems to > indicate that django doesn't support this

Reverse Foriegnkey filtering

2016-01-27 Thread Jonty Needham
I've found a need to do this and I'm struggling. Some info seems to indicate that django doesn't support this. How is it meant to be done? Basically to be clear, I need to filter one queryset on a reverse foriegnkey relation to another set of objects defined by a particualr filter. model1(Models.