Re: Last call: #11863 (Model.objects.raw)

2009-12-16 Thread Alex Gaynor
On Wed, Dec 16, 2009 at 12:08 PM, Jacob Kaplan-Moss wrote: > On Wed, Dec 16, 2009 at 10:13 AM, Jeremy Dunck wrote: >> This won't work, because deferred fields are descriptors, and >> accessing foo.field would run the query. >> >> Something you could do is

Re: Last call: #11863 (Model.objects.raw)

2009-12-16 Thread Jacob Kaplan-Moss
On Wed, Dec 16, 2009 at 10:13 AM, Jeremy Dunck wrote: > This won't work, because deferred fields are descriptors, and > accessing foo.field would run the query. > > Something you could do is foo.deferred_fields.field_name -> Boolean, > but that seems pretty clunky to me. You

Re: Last call: #11863 (Model.objects.raw)

2009-12-16 Thread Jeremy Dunck
On Wed, Dec 16, 2009 at 10:02 AM, Anssi Kaariainen wrote: ... > I am not suggesting this. What I would like to have is something like > foo.field.is_deferred(). I don't think there is any easy way to test > this currently. This could come handy in a template for example. You >

Re: Last call: #11863 (Model.objects.raw)

2009-12-16 Thread Anssi Kaariainen
On Dec 16, 4:34 pm, "Sean O'Connor" wrote: > Nice work Russ!  Got to love when something goes from "nice to have" to > "done". > > Anssi, I don't think I understand your use case.  Even if an unmanaged model > doesn't have a literal table behind it, it needs something

Re: Last call: #11863 (Model.objects.raw)

2009-12-16 Thread Jacob Kaplan-Moss
On Wed, Dec 16, 2009 at 6:51 AM, Russell Keith-Magee wrote: > No need for workaround docs - I've just uploaded an RC3 patch that > implements deferred fields. Sweet! I love it when other people do my work for me... > The one gotcha on this patch is that it now requires

Re: Last call: #11863 (Model.objects.raw)

2009-12-16 Thread Sean O'Connor
Nice work Russ! Got to love when something goes from "nice to have" to "done". Anssi, I don't think I understand your use case. Even if an unmanaged model doesn't have a literal table behind it, it needs something which at least resembles a table (i.e. a view) to query against. Otherwise the

Re: Last call: #11863 (Model.objects.raw)

2009-12-16 Thread Jeremy Dunck
On Wed, Dec 16, 2009 at 8:19 AM, Anssi Kaariainen wrote: ... > A nice way to test which fields the model > were populated and marking the non-populated fields as deferred would > be optimal in my opinion. One use case where you don't necessary know > which fields are

Re: Last call: #11863 (Model.objects.raw)

2009-12-16 Thread Anssi Kaariainen
On Dec 16, 2:51 pm, Russell Keith-Magee wrote: > On Wed, Dec 16, 2009 at 7:56 PM, Jeremy Dunck wrote: > > On Dec 15, 2009, at 11:16 PM, "Sean O'Connor" > > wrote: > > >> In regard to the deferred fields option, I'll let Jacob

Re: Last call: #11863 (Model.objects.raw)

2009-12-16 Thread Russell Keith-Magee
On Wed, Dec 16, 2009 at 7:56 PM, Jeremy Dunck wrote: > On Dec 15, 2009, at 11:16 PM, "Sean O'Connor" > wrote: > >> In regard to the deferred fields option, I'll let Jacob speak for >> his view but I've approached such functionality as "nice to have" >>

Re: Last call: #11863 (Model.objects.raw)

2009-12-16 Thread Jeremy Dunck
On Dec 15, 2009, at 11:16 PM, "Sean O'Connor" wrote: > In regard to the deferred fields option, I'll let Jacob speak for > his view but I've approached such functionality as "nice to have" > for the patch since its not critical to the patch being useful. >

Re: Last call: #11863 (Model.objects.raw)

2009-12-15 Thread Sean O'Connor
Big thanks Jacob for picking up my slack and putting the finishing touches on the patch and writing the docs. Work got crazy and I dropped the ball. Definitely happy that the work will get completed and put into trunk regardless. In regard to the deferred fields option, I'll let Jacob speak for

Re: Last call: #11863 (Model.objects.raw)

2009-12-15 Thread Russell Keith-Magee
On Wed, Dec 16, 2009 at 6:15 AM, Jacob Kaplan-Moss wrote: > Hey folks -- > > Forgot to mention it during the sprint this weekend, but I've pushed a > RC patch to #11863, Model.objects.raw(). If anyone's got any feedback, > let it fly. Otherwise, I'll be checking this in in a

Re: Last call: #11863 (Model.objects.raw)

2009-12-15 Thread Jacob Kaplan-Moss
Thanks for the review, Jeremy. On Tue, Dec 15, 2009 at 5:31 PM, Jeremy Dunck wrote: > This bit doesn't seem to be true; It seems that missing fields will > raise InsuficientFields instead.  Am I reading it wrong? Ah, good catch. I'd intended to remove this behavior as it's

Re: Last call: #11863 (Model.objects.raw)

2009-12-15 Thread Ian Kelly
On Tue, Dec 15, 2009 at 4:31 PM, Jeremy Dunck wrote: > RawQuery.validate_sql excludes anything but selects, but Oracle uses > comments to do query hinting.  Can an Oracle person confirm that those > hints can't start the query SQL?  (Not worth holding up landing, of > course.)

Re: Last call: #11863 (Model.objects.raw)

2009-12-15 Thread Jeremy Dunck
On Tue, Dec 15, 2009 at 4:15 PM, Jacob Kaplan-Moss wrote: > Hey folks -- > > Forgot to mention it during the sprint this weekend, but I've pushed a > RC patch to #11863, Model.objects.raw(). If anyone's got any feedback, > let it fly. Otherwise, I'll be checking this in in a

Last call: #11863 (Model.objects.raw)

2009-12-15 Thread Jacob Kaplan-Moss
Hey folks -- Forgot to mention it during the sprint this weekend, but I've pushed a RC patch to #11863, Model.objects.raw(). If anyone's got any feedback, let it fly. Otherwise, I'll be checking this in in a couple-three days or so. Jacob -- You received this message because you are subscribed