diff options
author | luxagraf <sng@luxagraf.net> | 2023-06-05 09:06:52 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2023-06-05 09:06:52 -0500 |
commit | 4fdb134219a9259ae69b00cd22e043048c71f249 (patch) | |
tree | 71a9975f0c9f277f43a78ff76b9789280bc75e3c | |
parent | ef3a30ebee3f43adc3d0c49e4e89e3c42eedf3ca (diff) |
loc: added Travels to locations
-rw-r--r-- | app/locations/models.py | 1 | ||||
-rw-r--r-- | app/locations/urls.py | 9 | ||||
-rw-r--r-- | app/locations/views.py | 14 |
3 files changed, 21 insertions, 3 deletions
diff --git a/app/locations/models.py b/app/locations/models.py index 5c5636a..07732fb 100644 --- a/app/locations/models.py +++ b/app/locations/models.py @@ -524,4 +524,3 @@ class Track(models.Model): except Location.DoesNotExist: raise forms.ValidationError("There is no location associated with that point, add it: %sadmin/locations/location/add/" % (settings.BASE_URL)) super(Track, self).save(*args, **kwargs) - diff --git a/app/locations/urls.py b/app/locations/urls.py index b949b15..ff2693b 100644 --- a/app/locations/urls.py +++ b/app/locations/urls.py @@ -21,9 +21,14 @@ urlpatterns = [ name="mapdata" ), #re_path(r'data/(?P<id>\d+)/$', views.data_json), + #path( + # r'', + # views.MapList.as_view(), + # name="maplist" + #), path( r'', - views.MapList.as_view(), - name="maplist" + views.TravelsList.as_view(), + name="travels-list" ), ] diff --git a/app/locations/views.py b/app/locations/views.py index 666e9a3..3dca6c7 100644 --- a/app/locations/views.py +++ b/app/locations/views.py @@ -42,6 +42,20 @@ class MapList(ListView): return context +class TravelsList(ListView): + """ + Return list of Entries by trip + """ + context_object_name = 'object_list' + queryset = Post.objects.filter(status__exact=1) + template_name = 'travels.html' + + def get_context_data(self, **kwargs): + # Call the base implementation first to get a context + context = super(TravelsList, self).get_context_data(**kwargs) + return context + + class MapDataList(ListView): """ Build data file for Entries on map |