I'm writing an application that makes heavy use of geodjango (on PostGis) and spatial lookups. Distance queries on database side work great, but now I have to calculate distance between two points on python side of application (these points come from models obtained using separate queries).
I can think of many ways that would calculate this distance, but I want to know do it in manner that is consistent with what the database will output.
Is there any magic python function that calculates distance between two points given in which SRID they are measured? If not what other approach could you propose.