PageRenderTime 40ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/django/contrib/gis/db/models/manager.py

https://code.google.com/p/mango-py/
Python | 103 lines | 67 code | 33 blank | 3 comment | 0 complexity | 3801932bac0d4cc16cdd53a21a2fb4a4 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. from django.db.models.manager import Manager
  2. from django.contrib.gis.db.models.query import GeoQuerySet
  3. class GeoManager(Manager):
  4. "Overrides Manager to return Geographic QuerySets."
  5. # This manager should be used for queries on related fields
  6. # so that geometry columns on Oracle and MySQL are selected
  7. # properly.
  8. use_for_related_fields = True
  9. def get_query_set(self):
  10. return GeoQuerySet(self.model, using=self._db)
  11. def area(self, *args, **kwargs):
  12. return self.get_query_set().area(*args, **kwargs)
  13. def centroid(self, *args, **kwargs):
  14. return self.get_query_set().centroid(*args, **kwargs)
  15. def collect(self, *args, **kwargs):
  16. return self.get_query_set().collect(*args, **kwargs)
  17. def difference(self, *args, **kwargs):
  18. return self.get_query_set().difference(*args, **kwargs)
  19. def distance(self, *args, **kwargs):
  20. return self.get_query_set().distance(*args, **kwargs)
  21. def envelope(self, *args, **kwargs):
  22. return self.get_query_set().envelope(*args, **kwargs)
  23. def extent(self, *args, **kwargs):
  24. return self.get_query_set().extent(*args, **kwargs)
  25. def extent3d(self, *args, **kwargs):
  26. return self.get_query_set().extent3d(*args, **kwargs)
  27. def force_rhr(self, *args, **kwargs):
  28. return self.get_query_set().force_rhr(*args, **kwargs)
  29. def geohash(self, *args, **kwargs):
  30. return self.get_query_set().geohash(*args, **kwargs)
  31. def geojson(self, *args, **kwargs):
  32. return self.get_query_set().geojson(*args, **kwargs)
  33. def gml(self, *args, **kwargs):
  34. return self.get_query_set().gml(*args, **kwargs)
  35. def intersection(self, *args, **kwargs):
  36. return self.get_query_set().intersection(*args, **kwargs)
  37. def kml(self, *args, **kwargs):
  38. return self.get_query_set().kml(*args, **kwargs)
  39. def length(self, *args, **kwargs):
  40. return self.get_query_set().length(*args, **kwargs)
  41. def make_line(self, *args, **kwargs):
  42. return self.get_query_set().make_line(*args, **kwargs)
  43. def mem_size(self, *args, **kwargs):
  44. return self.get_query_set().mem_size(*args, **kwargs)
  45. def num_geom(self, *args, **kwargs):
  46. return self.get_query_set().num_geom(*args, **kwargs)
  47. def num_points(self, *args, **kwargs):
  48. return self.get_query_set().num_points(*args, **kwargs)
  49. def perimeter(self, *args, **kwargs):
  50. return self.get_query_set().perimeter(*args, **kwargs)
  51. def point_on_surface(self, *args, **kwargs):
  52. return self.get_query_set().point_on_surface(*args, **kwargs)
  53. def reverse_geom(self, *args, **kwargs):
  54. return self.get_query_set().reverse_geom(*args, **kwargs)
  55. def scale(self, *args, **kwargs):
  56. return self.get_query_set().scale(*args, **kwargs)
  57. def snap_to_grid(self, *args, **kwargs):
  58. return self.get_query_set().snap_to_grid(*args, **kwargs)
  59. def svg(self, *args, **kwargs):
  60. return self.get_query_set().svg(*args, **kwargs)
  61. def sym_difference(self, *args, **kwargs):
  62. return self.get_query_set().sym_difference(*args, **kwargs)
  63. def transform(self, *args, **kwargs):
  64. return self.get_query_set().transform(*args, **kwargs)
  65. def translate(self, *args, **kwargs):
  66. return self.get_query_set().translate(*args, **kwargs)
  67. def union(self, *args, **kwargs):
  68. return self.get_query_set().union(*args, **kwargs)
  69. def unionagg(self, *args, **kwargs):
  70. return self.get_query_set().unionagg(*args, **kwargs)