geodjango - Type Error: Cant convert GeoQueryset object to str implicilty in Django -
i following this tutorial. showing error in view function
type error: cant convert geoqueryset object str implicitly
my view function
def index(request): 'display map' waypoints = waypoint.objects.order_by('name') return render_to_response('waypoints/index.html', { 'title': 'waypoints tutorial', 'waypoints': waypoints, 'content': render_to_string('waypoints/waypoints.html', {'waypoints': waypoints}), })
it showing error in last line
content': render_to_string('waypoints/waypoints.html', {'waypoints': waypoints})
and waypoints.html
{% waypoint in waypoints %} <div id="{{waypoint.id}}" class="waypoint"> {{ waypoint.name }} ({{waypoint.geometry.y}} , {{waypoint.geometry.x }}) </div> {% endfor %}
traceback attached below
environment: request method: request url: http://127.0.0.1:8080/ django version: 1.8.3 python version: 3.3.5 installed applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.gis', 'waypoints') installed middleware: ('django.contrib.sessions.middleware.sessionmiddleware', 'django.middleware.common.commonmiddleware', 'django.contrib.auth.middleware.authenticationmiddleware', 'django.contrib.auth.middleware.sessionauthenticationmiddleware', 'django.contrib.messages.middleware.messagemiddleware', 'django.middleware.clickjacking.xframeoptionsmiddleware', 'django.middleware.security.securitymiddleware') traceback: file "c:\python33\lib\site-packages\django\core\handlers\base.py" in get_response 132. response = wrapped_callback(request, *callback_args, **callback_kwargs) file "e:\kcube\django\leafletmaps\waypoints\views.py" in index 17. 'content': render_to_string('waypoints/waypoints.html', {'waypoints': waypoints}), file "c:\python33\lib\site-packages\django\shortcuts.py" in render_to_response 39. content = loader.render_to_string(template_name, context, using=using) file "c:\python33\lib\site-packages\django\template\loader.py" in render_to_string 99. return template.render(context, request) file "c:\python33\lib\site-packages\django\template\backends\django.py" in render 74. return self.template.render(context) file "c:\python33\lib\site-packages\django\template\base.py" in render 209. return self._render(context) file "c:\python33\lib\site-packages\django\template\base.py" in _render 201. return self.nodelist.render(context) file "c:\python33\lib\site-packages\django\template\base.py" in render 903. bit = self.render_node(node, context) file "c:\python33\lib\site-packages\django\template\base.py" in render_node 917. return node.render(context) file "c:\python33\lib\site-packages\django\template\defaulttags.py" in render 499. url = reverse(project_name + '.' + view_name, exception type: typeerror @ / exception value: can't convert 'geoqueryset' object str implicitly
Comments
Post a Comment