Hello! I hope someone can help me.

I've got a model with a required location field (a Geodjango Point)
and some other information.

I created a model form from it and use a simple textbox widget for the
location field, so the user writes coordinates of the form:

19.33332, -97.13333

¿How can I make this work with form validation? When I try to call:

form = PlaceForm(request.POST)
form.save()

The form doesn't validate (obviously). What should I do to the
"19.33332, -97.13333" string to make it validate properly? I tried
manipulating it to look like "POINT(19.33332 -97.13333)" to no avail.

It also ocurred to me to make the field not required, calling
form.save(commit=False), manipulating the location field of the
resulting object and then saving it, but I would really like to keep
the field marked as required in the database.

Thanks in advance!

-- 
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