Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2013-10-01 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
-+-
 Reporter:  mrts |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  efficient-admin  |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by Anssi Kääriäinen ):

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


Comment:

 In [changeset:"8d4b1629d4434b8b30078d064e74689ca8906f37"]:
 {{{
 #!CommitTicketReference repository=""
 revision="8d4b1629d4434b8b30078d064e74689ca8906f37"
 Fixed #10733 -- select_related().only() failure

 The bug was reported pre 1.1, and somewhere along the way it has been
 fixed. So, this is tests only addition.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.87fa53ae87dfce3ecc190c3ed86d5879%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2011-04-06 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
-+-
   Reporter:  mrts   |Owner:  nobody
   Type:  Bug|   Status:  reopened
  Milestone:  1.3|Component:  Database layer
Version:  SVN|  (models, ORM)
 Resolution: | Severity:  Normal
   Triage Stage:  Accepted   | Keywords:  efficient-admin
Needs documentation:  0  |Has patch:  1
Patch needs improvement:  1  |  Needs tests:  0
-+-
Changes (by SmileyChris):

 * type:   => Bug
 * severity:   => Normal


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2010-09-02 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody 

Status:  reopened  | Milestone:  1.3

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  1 |  
---+
Changes (by wdoekes):

 * cc: walter+dja...@wjd.nu (added)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2010-03-10 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody 

Status:  reopened  | Milestone:  1.3

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  1 |  
---+
Changes (by russellm):

  * milestone:  1.2 => 1.3

Comment:

 Not critical for 1.2

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2010-02-15 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody 

Status:  reopened  | Milestone:  1.2

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  1 |  
---+
Changes (by ruosteinen):

 * cc: ruosteinen (added)

Comment:

 So, what is the status here? Are we going to see this in 1.2?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2010-02-12 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody 

Status:  reopened  | Milestone:  1.2

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  1 |  
---+
Changes (by carljm):

 * cc: carljm (added)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-11-03 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody 

Status:  reopened  | Milestone:  1.2

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  1 |  
---+
Comment (by drdaeman):

 Shouldn't at least a simple patch, correctly passing `only_load` in
 `db/models/query.py:get_cached_row()` be included into trunk?

 This won't solve all problems, but will allow simple cases to work
 properly which is certainly better than nothing.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-07-06 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody 

Status:  reopened  | Milestone:  1.2

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  1 |  
---+
Comment (by anonymous):

 Replying to [comment:18 mrts]:
 > Replying to [comment:17 ccahoon]:
 >
 > As Russell said, this is not fixed. Reopening.

 mrts -- Sorry about that, I had a major committing SNAFU in June and
 didn't see that the post-commit track script had messed this ticket up.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-07-03 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody 

Status:  reopened  | Milestone:  1.2

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  1 |  
---+
Changes (by mrts):

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

Comment:

 Replying to [comment:17 ccahoon]:

 As Russell said, this is not fixed. Reopening.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-06-10 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody 

Status:  reopened  | Milestone:  1.2

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  1 |  
---+
Comment (by mrts):

 Right you are, `select_related('a', 'b').query.as_sql()` looks correct:
 {{{
 >>> C.objects.all().only('name', 'a', 'b', 'a__name',
 'b__name').select_related('a', 'b').query.as_sql()
 ('SELECT "only_breakage_c"."id", "only_breakage_c"."name",
 "only_breakage_c"."a_id", "only_breakage_c"."b_id",
 "only_breakage_a"."id", "only_breakage_a"."name",
 "only_breakage_b"."id", "only_breakage_b"."name"
 FROM "only_breakage_c"
 LEFT OUTER JOIN "only_breakage_a" ON ("only_breakage_c"."a_id" =
 "only_breakage_a"."id")
 INNER JOIN "only_breakage_b" ON ("only_breakage_c"."b_id" =
 "only_breakage_b"."id")',
  ())
 }}}

 Doesn't affect the behaviour though, problems 1-3 remain.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-06-07 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody 

Status:  reopened  | Milestone:  1.2

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  1 |  
---+
Changes (by russellm):

  * milestone:  1.1 => 1.2

Comment:

 Ok - there are actually three problems here:
  1. C.objects.all().select_related() does one join, not two.
  2. The a__name clause in only() doesn't roll out to the right field
 inclusion list in the queryset
  3. The internal only_load data structure can't differentiate between
 a__name and b__name.

 Point 1 should probably be it's own ticket (it strikes me that it probably
 already is, but a quick search didn't reveal an obvious candidate). The
 workaround is to explicitly specify select_related('a','b').

 Points 2 and 3 are closely related, but they aren't simple fixes.

 I'm going to punt this for v1.1. None of these problems cause data loss or
 incorrect answers, and I can't see any reason that these problems can't be
 fixed while preserving backwards compatibility in the only() interface. I
 will grant that these problems are inconvenient and lead to
 inefficiencies, but if we're sticking to a time-based release schedule,
 we're going to have to live with the fact that releases are going to have
 some bugs.

 That said, if someone is particularly affected by this problem and is able
 to work up a patch before v1.1 I'm happy to look at getting it into trunk.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-06-06 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody 

Status:  reopened  | Milestone:  1.1

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  1 |  
---+
Changes (by mrts):

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

Comment:

 Alas, given the above models, the following happens:

 {{{
 >>> from only_breakage.models import C
 >>> from django.db import connection
 >>> import copy
 }}}

 == Expected ==

 All three tables joined:
 {{{
 >>> C.objects.all().only('name', 'a', 'b', 'a__name',
 'b__name').select_related().query.as_sql()
 ('SELECT "only_breakage_c"."id", "only_breakage_c"."name",
 "only_breakage_c"."a_id", "only_breakage_c"."b_id",
 "only_breakage_a"."id", "only_breakage_a"."name",
 "only_breakage_b"."id", "only_breakage_b"."name"
 FROM "only_breakage_c"
 INNER JOIN "only_breakage_a" ON ("only_breakage_c"."a_id" =
 "only_breakage_a"."id")
 INNER JOIN "only_breakage_b" ON ("only_breakage_c"."b_id" =
 "only_breakage_b"."id")', ())
 }}}

 A single query fetches all what's needed:
 {{{
 >>> results = C.objects.all().only('name', 'a', 'b', 'a__name',
 'b__name').select_related()
 >>> connection.queries
 []
 >>> results[0].a.name
 u'a2'
 >>> connection.queries
 [{'sql': u'SELECT "only_breakage_c"."id", "only_breakage_c"."name",
 "only_breakage_c"."a_id", "only_breakage_c"."b_id",
 "only_breakage_a"."id", "only_breakage_a"."name",
 "only_breakage_b"."id", "only_breakage_b"."name"
 FROM "only_breakage_c"
 INNER JOIN "only_breakage_a" ON ("only_breakage_c"."a_id" =
 "only_breakage_a"."id")
 INNER JOIN "only_breakage_b" ON ("only_breakage_c"."b_id" =
 "only_breakage_b"."id")
 LIMIT 1',
   'time': '0.002'},
 >>> queries = copy.deepcopy(connection.queries)
 >>> results[0].b.name
 u'b1'
 >>> assert connection.queries == queries
 }}}

 == Actually got ==

 Only two tables joined (the `A` table is discarded):
 {{{
 >>> C.objects.all().only('name', 'a', 'b', 'a__name',
 'b__name').select_related().query.as_sql()
 ('SELECT "only_breakage_c"."id", "only_breakage_c"."name",
 "only_breakage_c"."a_id", "only_breakage_c"."b_id",
 "only_breakage_b"."id", "only_breakage_b"."name"
 FROM "only_breakage_c"
 INNER JOIN "only_breakage_b" ON ("only_breakage_c"."b_id" =
 "only_breakage_b"."id")', ())
 }}}

 Three queries happen:
 {{{
 >>> results = C.objects.all().only('name', 'a', 'b', 'a__name',
 'b__name').select_related()
 >>> connection.queries
 []
 >>> results[0].a.name
 u'a2'
 >>> connection.queries
 [{'sql': u'SELECT "only_breakage_c"."id", "only_breakage_c"."name",
 "only_breakage_c"."a_id", "only_breakage_c"."b_id",
 "only_breakage_b"."id", "only_breakage_b"."name"
 FROM "only_breakage_c" INNER JOIN "only_breakage_b" ON
 ("only_breakage_c"."b_id" = "only_breakage_b"."id") LIMIT 1',
   'time': '0.002'},
  {'sql': u'SELECT "only_breakage_a"."id", "only_breakage_a"."name",
 "only_breakage_a"."lots_of_text", "only_breakage_a"."a_field" FROM
 "only_breakage_a" WHERE "only_breakage_a"."id" = 2 ',
   'time': '0.000'}]
 >>> results[0].b.name
 u'b1'
 >>> connection.queries
 [{'sql': u'SELECT "only_breakage_c"."id", "only_breakage_c"."name",
 "only_breakage_c"."a_id", "only_breakage_c"."b_id",
 "only_breakage_b"."id", "only_breakage_b"."name"
 FROM "only_breakage_c" INNER JOIN "only_breakage_b" ON
 ("only_breakage_c"."b_id" = "only_breakage_b"."id") LIMIT 1',
   'time': '0.002'},
  {'sql': u'SELECT "only_breakage_a"."id", "only_breakage_a"."name",
 "only_breakage_a"."lots_of_text", "only_breakage_a"."a_field" FROM
 "only_breakage_a" WHERE "only_breakage_a"."id" = 2 ',
   'time': '0.000'},
  {'sql': u'SELECT "only_breakage_c"."id", "only_breakage_c"."name",
 "only_breakage_c"."a_id", "only_breakage_c"."b_id",
 "only_breakage_b"."id", "only_breakage_b"."name"
 FROM "only_breakage_c" INNER JOIN "only_breakage_b" ON
 ("only_breakage_c"."b_id" = "only_breakage_b"."id") LIMIT 1',
   'time': '0.000'}]
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups

Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-06-06 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody 

Status:  closed| Milestone:  1.1

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:  fixed |  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  1 |  
---+
Comment (by mrts):

 Indeed, this has been corrected by [10926]. Thanks!

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-06-06 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody 

Status:  closed| Milestone:  1.1

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:  fixed |  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  1 |  
---+
Comment (by russellm):

 I suspect this may have been corrected as a result of the fixes for #10572
 in [10926]. I've added a regression test case to make sure, but if I'm
 missing something here, please reopen.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-05-07 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody 

Status:  new   | Milestone:  1.1

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  1 |  
---+
Changes (by adurdin):

  * owner:  adurdin => nobody
  * status:  assigned => new

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-05-07 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  adurdin

Status:  assigned  | Milestone:  1.1

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  1 |  
---+
Changes (by adurdin):

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

Comment:

 The fault is in `django/models/query.py:get_cached_row()`:  when it
 recurses it was not passing the `only_load` dict down the stack. The
 attached patch fixes this.

 However I noticed that the recursion is not passing anything for the
 `offset` parameter, which is to do with aggregation queries.  I can't say
 for sure at the moment, but it looks to me like an additional bug relating
 to aggregated queries with related models could be hiding in here as well.
 Or is the `offset` parameter '''only''' relevant to the top-level model?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-05-07 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  adurdin

Status:  assigned  | Milestone:  1.1

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  0  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  0 |  
---+
Comment (by adurdin):

 I've looked into this a little; the problem is not in the sql generation,
 as the expected columns and joins are all present.

 I've tracked the problem down to somewhere in QuerySet.iterator().  In the
 test case, the model instantiation when selecting the single result is:
 {{{
 DeferredRelatedC_Deferred_is_published_lots_of_text(a_id=1, b_id=2, id=3,
 name=u'c3')
 DeferredRelatedA(1, u'a1', 2, u'b2')
 DeferredRelatedB()
 }}}

 That is, the kwargs are not being set properly when instantiating the two
 related models.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-05-07 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  adurdin

Status:  assigned  | Milestone:  1.1

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  0  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  0 |  
---+
Changes (by adurdin):

  * owner:  nobody => adurdin
  * status:  new => assigned

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-04-22 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody 

Status:  new   | Milestone:  1.1

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  
efficient-admin
 Stage:  Accepted  | Has_patch:  0  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  0 |  
---+
Changes (by jacob):

  * stage:  Unreviewed => Accepted

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-04-05 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody 

Status:  new   | Milestone:  1.1

 Component:  Database layer (models, ORM)  |   Version:  SVN

Resolution:|  Keywords:  
efficient-admin
 Stage:  Unreviewed| Has_patch:  0  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  0 |  
---+
Changes (by mrts):

  * keywords:  => efficient-admin

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-04-04 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody
Status:  new   | Milestone:  1.1   
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by Alex):

 I looked at this for a while and didn't make any huge progress, but I
 think I found 2 issues(maybe :/):

 1. The SQL for {{{ Leaf.objects.only('child__name',
 'second_child__name').select_related() }}} is only doing 1 join, and I
 think it needs to be doing 2.

 2. It seems that neither of those child models is actually a deferred
 model there.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-04-04 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody
Status:  new   | Milestone:  1.1   
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by mrts):

  * milestone:  => 1.1

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-04-04 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
---+
  Reporter:  mrts  | Owner:  nobody
Status:  new   | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by mrts):

  * component:  Uncategorized => Database layer (models, ORM)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10733: Invalid results when deferring fields in more than one related model with only()

2009-04-04 Thread Django
#10733: Invalid results when deferring fields in more than one related model 
with
only()
+---
  Reporter:  mrts   | Owner:  nobody
Status:  new| Milestone:
 Component:  Uncategorized  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by mrts):

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

Comment:

 Looks like `b.id` is actually `None` in that case:
 {{{
 >>> results = C.objects.all().only('name', 'a', 'b', 'a__name',
 'b__name').select_related()
 >>> results[0].b.id is None
 True
 }}}

 Another odd side-effect -- when accessing the deferred fields, bogus
 values are returned (as in #10710, notice how `lots_of_text` returns the
 `id` value):
 {{{
 >>> results = C.objects.all().only('name', 'a', 'b', 'a__name',
 'b__name').select_related()
 >>> results[0].a.lots_of_text
 2
 >>> results[0].a.id
 2
 >>> results[0].a.name
 u'a2'
 }}}

 Running on
 {{{
 >>> django.get_version()
 u'1.1 beta 1 SVN-10395'
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---