﻿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
28381	QuerySet.get/update_or_create() field validation prevents certain kinds of descriptor use	Kevin Christopher Henry	Simon Charette	"My code stopped working after upgrading to Django 1.11.2. The cause lies in [https://github.com/django/django/commit/b9abdd92ab21a796943e8047e778eebc671c8c00 b9abdd92], the fix for #28222.

The root of the issue is that the validation code checks the model to see which attributes are properties. To do that it loops over all the attribute names and calls `getattr()` on them, which triggers any descriptors you've defined on the model. So if you have a descriptor that is calling a Manager method that does this validation, you will end up in an infinite loop (`maximum recursion depth exceeded`). I personally use such descriptors to create lazy model attributes that access the database, and find them quite useful.

I'm not sure offhand of a simple way to maintain the validation behavior without triggering all the descriptors. You could check the Model's `__dict__` rather than calling `getattr()` but of course that won't work with inheritance. This might just be a `wontfix` but I wanted to at least document the change in behavior."	Bug	closed	Database layer (models, ORM)	1.11	Normal	duplicate		Simon Charette Adam Johnson	Accepted	0	0	0	0	0	0
