﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
15271	django.contrib.gis.forms.fields.GeometryField should call to_python before cleaning	Daniel Barreto	nobody	"GeometryField overrides the default clean method for Field class and doesn't take in account the call to `to_python` before cleaning of the value.
This is important because when using GeometryFields in a form you could want to render it with a MultiWidget, for example:

Let's say we create a PointField (which inherits from GeometryField) with a MultiWidget that renders to FloatFields (one for each coordinate). This widget will return a list with both float values as its value, and that's what will be passed to the clean method. On every other field, we know that this list will be passed to to_python before calling clean, but with GeometryField that's not the case.

Following that example, you could redefine the to_python method in our new PointField class to check if the value is instance of a tuple/list (like it's done in a DateTimeField), and transform it to a string representing the Point WKT formed with the two values of that list, but you will also have to redefine clean method to call `to_python` first and then do the cleaning.

I'm submitting a simple patch to fix this."	Bug	closed	GIS	dev	Normal	fixed	gis, field, clean, to_python		Accepted	1	0	1	0	0	0
