Hey there,
I have problem with dajaxice. I am trying to save vertex from google
route to my db.
Call of JS function:
Dajaxice.maps.sendRoute('sendRoute_callBack',{'data':array});
function sendRoute_callBack(data){
if(data!='DAJAXICE_EXCEPTION'){
alert(data.message);
}
else{
alert('Error');
}
}
Problem is that I always get Error.
Admin.py:
from django.utils import simplejson
from django.contrib.gis.geos import Point,Multipoint
from maps.models import Route
def sendRoute(request, data, name):
mp=MultiPoint()
counter = 0
for coord in data:
if counter == 0:
lng=coord
elif counter == 1:
lat=coord
p = Point(lng,lat)
mp.append(p)
counter=0
route = Route()
route.name=name
route.coordinates=mp;
route.save()
return simplejson.dumps({'message':'Data stored' })
I don't know what to do.. Can anyone help me...
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.