[Django] #23721: check_related_objects should not call __iter__

2 views
Skip to first unread message

Django

unread,
Oct 27, 2014, 9:36:18 PM10/27/14
to django-...@googlegroups.com
#23721: check_related_objects should not call __iter__
----------------------------------------------+--------------------
Reporter: collinanderson | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
I have a model with a file-like instance, and I can't have the related
query checker (#14334) calling its __iter__ method.

{{{

class FileModel(models.Model):
def __iter__(self):
# tries to open a file and iterate over its lines.

class MyModel(models.Model):
file = models.ForeignKey(FileModel):

filelike = FileModel.objects.first()
MyModel.objects.filter(file=filelike) # check_related_objects tries to
call __iter__

}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23721>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 27, 2014, 9:38:45 PM10/27/14
to django-...@googlegroups.com
#23721: check_related_objects should not call __iter__
-------------------------------------+-------------------------------------

Reporter: collinanderson | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by collinanderson):

* needs_better_patch: => 0
* has_patch: 0 => 1
* needs_tests: => 0
* needs_docs: => 0


Comment:

https://github.com/django/django/pull/3431

--
Ticket URL: <https://code.djangoproject.com/ticket/23721#comment:1>

Django

unread,
Oct 28, 2014, 4:05:39 AM10/28/14
to django-...@googlegroups.com
#23721: check_related_objects should not call __iter__
-------------------------------------+-------------------------------------
Reporter: collinanderson | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: master
(models, ORM) | Resolution: fixed

Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Anssi Kääriäinen <akaariai@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"ae7cb992bca5d211c9456487feb21b84387006eb"]:
{{{
#!CommitTicketReference repository=""
revision="ae7cb992bca5d211c9456487feb21b84387006eb"
Fixed #23721 -- check_related_objects without calling __iter__

Refs #14334
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23721#comment:2>

Reply all
Reply to author
Forward
0 new messages