use GeoManager on models to allow spatial queries
This commit is contained in:
parent
53037c064f
commit
ccface0748
|
@ -53,7 +53,7 @@ RUNTIMES = (
|
|||
(20, 24)
|
||||
)
|
||||
|
||||
class TrigramSearchManager(models.Manager):
|
||||
class TrigramSearchManager(models.GeoManager):
|
||||
def __init__(self, trigram_columns=[]):
|
||||
super(TrigramSearchManager, self).__init__()
|
||||
self.trigram_columns = trigram_columns
|
||||
|
@ -229,6 +229,7 @@ class Route(models.Model):
|
|||
distance = models.DecimalField(max_digits=3, decimal_places=1)
|
||||
stages = models.IntegerField()
|
||||
|
||||
|
||||
class Meta:
|
||||
ordering = ['code']
|
||||
|
||||
|
|
|
@ -20,14 +20,26 @@ a:hover {
|
|||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div id="stopListWrapper" class="listColumn">
|
||||
<ul id="stopList">
|
||||
{% for s in stops %}
|
||||
{% for stop in stops %}
|
||||
<li>
|
||||
<a href="{{ s.get_absolute_url }}" class="{% if s.point %} has_point {% else %} no_point {% endif %}">{{ s.name }}</a>
|
||||
<a href="{{ stop.get_absolute_url }}">{{ s.name }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<div id="routeListWrapper" class="listColumn">
|
||||
<input class="listFilterInput" placeholder="Filter..." />
|
||||
<ul id="routeList">
|
||||
{% for route in routes %}
|
||||
<li>
|
||||
<a href="{{ route.get_absolute_url }}">{{ route.alias }}</a>
|
||||
</li>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div id="map"></div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue
Block a user