Ok . I am getting this error
Exception Type:GEOSIndexError

I will show you the code .
This is my maps.html


<html>
  <head>
    {{ form.media }}
  </head>
  <body>
    <form method="post" action=".">
      {% csrf_token %}
      {{ form.as_p }}
{% block content %}
{% for entry in data %}
    <h2>{{ data }}</h2>

{% endfor %}

{% endblock %}
      <p><input type="submit" value="Submit"></p>
    </form>
  </body>
</html>


This is my views.py

def map_page(request):
     lcount = Open_Layers.objects.all().count()

     if request.method == 'POST':
        form = GeoForm(request.POST)
        if form.is_valid():
data = form.cleaned_data
                val=form.cleaned_data['AddLayer']
                        val1=val[0]
                        val2=val[2]
                        val3=val[3]
a=Open_Layers()
a.geom_poly=GeometryCollection(val[0],val[1],val[3])
 LName = form.cleaned_data['LayerName']
    LDes = form.cleaned_data['LayerDescription']
a.Layer_name=LName
                        a.Layer_desc=LDes
a.save()


return HttpResponseRedirect('/map_view/')

 return render_to_response('maps.html', {'data':val3})
else:
form = GeoForm()
     else:
form = GeoForm()
return render_to_response('maps.html', {'form':form})
def map_view(request):
return render_to_response('mapsaved.html',{})


And this my urls.py
url(r'^openmaps/','openmaps.views.map_page',name='maps'),
    url(r'^openmaps/','openmaps.views.map_view',name='mapsaved'),

Where have I gone wrong ?

Thank you for all the help till now


On Thu, Jun 16, 2011 at 3:21 AM, Shawn Milochik <sh...@milochik.com> wrote:

> On 06/15/2011 05:48 PM, Satyajit Sarangi wrote:
>
>> Can you show it in an html tag ? As in in a template , on click of the url
>>
>> Thanks for the help
>>
>
> Sure.
>
> Example from docs:
>    {% url arch-summary 1945 %}
>
> In an HTML tag:
>
> <a href="{% url arch-summary 1945 %}">Summary for 1945</a>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
*Satyajit Sarangi*

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to