﻿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
13492	get_or_create(field__iexact=value) fails to set value.	Chris Dukes <pakraticus@…>	nobody	"I'm not sure if this is a documentation bug, or a code bug, or operator headspace error.

I have a model where a column needs to be unique in a case insensitive fashion, but should be stored in a case sensitive fashion.
I have applied custom SQL for that constraint.

As I am bulk loading the table, I am making use of get_or_create(field0!__iexact=value0, field1=value1).
When I use this invocation, field0 ends up being set as null.

If I invoke it as get_or_create(field0!__iexact=value0, field0=value0, ...)
I eventually have a constraint error.

I would expect a FieldError if field0!__iexact were not permitted, and I would expect the fieldname to be calculated from field0!__iexact if it were permitted.

I am currently avoiding the problem by catching an exception on psycopg2.IntegrityError, but that does not seem to be the right solution.

Thanks,
Chris Dukes


"		closed	Uncategorized	1.1		invalid			Unreviewed	0	0	0	0	0	0
