﻿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
9719	Strings which look like numbers are not quoted, MySQL	anonymous	nobody	"Create a simple model with a CharField.[[BR]]
Create a ModelForm for that model.

The model can be created successfully and saved to the database using CharField data which looks like a number (e.g. IP address), but updating that model using the same ModelForm fails if the data already existing in the database looks like a number.


{{{
        form = Config(request.POST, instance=mymodel) # A form bound to the POST data
        if form.is_valid(): # All validation rules pass
            try:
                form.save()  # Throws blank exception
}}}


The SQL query that fails (from db.connection.queries) is:


{{{
SELECT .... FROM `service_config` WHERE (`service_config`.`customer_id` = 1  AND `service_config`.`hostname` = 192.168.1.20
}}}

The last item should be in quotes. MySQL will fail on this statement, and the Exception returned from ModelFormInstance.save() is blank (printing the exception results in a null string).

Change the data to 'X192.168.1.20' and it works as expected.

This occurs in at least 1.0.1 and 1.0.2.

"		closed	Database layer (models, ORM)	1.0		invalid			Unreviewed	0	0	0	0	0	0
