In my application data about a entry is displayed detailing their information. You can navigate between the entries via a hyperlink.
So far the code:
<a href="/parks/{{ park.id }} ">{{park.name}}</a>
Has been suffient in dealing with this. The id is captured in the urls.py and onto views.py
The problem I now face is to deal with my ‘location’ entry. Examples of locations are ‘Europe, UK’, ‘USA, New York’.
I know that:
<a href="/parks/{{ park.location }} ">{{park.location}}</a>
with:
url(r'^location/(?P<park_location>\d+)$', Location_Main),
won’t work, due to the spaces and commas etc.
How would I resolve this?
I would also like the ‘location’ view and ‘location’ url to handle the location of a parent company say ()
Thanks in advance
Why not pass pass
park.idand then in view get the park object and then get its location:the url:
the template:
the view:
Alternatively send the location as
GETparameter:the url:
the template:
the view: