I am trying to achieve this:
I have 2 tables:
Location can have multiple rates. Now what I want is, look up in the database and take the rate if no duplicate
foreignkey, but if duplicate, then take the latest rate.
Say, I search for rate 3, my look up goes into db and sees that one location is having only rate 3, it takes it. But another location is having two different rates, 3 and 5. then evaluate the last one, the 5 and don't take it since
locations = Location.objects.filter(???)???? <----- help
How can I write this in query?