Re: [#20291] Add method to reload `AppCache`

2013-04-25 Thread Russell Keith-Magee
On Thu, Apr 25, 2013 at 8:50 PM, wrote: > Hi, > > Speaking of: > https://code.djangoproject.com/ticket/20291 > > I don't see how is this ticket related to #3591 (which BTW says "add > support for custom app_label and verbose_name"). This one is a little > atomic piece of work and a handy addition

Re: Changing deferred model attribute behavior

2013-04-25 Thread Alex Gaynor
Sorry, I misunderstood the original request. Yes, you're right Anssi and Adrian, finding them on demand is reasonable. Alex On Thu, Apr 25, 2013 at 4:59 PM, Anssi Kääriäinen wrote: > On 25 huhti, 20:08, Alex Gaynor wrote: > > This sounds like a reasonable request, I don't yet have an opinion o

Re: Changing deferred model attribute behavior

2013-04-25 Thread Anssi Kääriäinen
On 25 huhti, 20:08, Alex Gaynor wrote: > This sounds like a reasonable request, I don't yet have an opinion on API > or anything. One tiny thing I'd like to note though, "change DeferredAttribute > to find all *other* DeferredAttributes". I don't think `finding` is the > right way to think about i

Re: Changing deferred model attribute behavior

2013-04-25 Thread Anssi Kääriäinen
On 25 huhti, 23:44, Alex Ogier wrote: > On Thu, Apr 25, 2013 at 2:10 PM, Florian Apolloner > wrote: > > > On Thursday, April 25, 2013 7:06:06 PM UTC+2, Adrian Holovaty wrote: > > >> Also, I should mention that this should be *optional* behavior, as the > >> current behavior is reasonable for the

Re: Changing deferred model attribute behavior

2013-04-25 Thread Alex Ogier
On Thu, Apr 25, 2013 at 2:10 PM, Florian Apolloner wrote: > On Thursday, April 25, 2013 7:06:06 PM UTC+2, Adrian Holovaty wrote: >> >> Also, I should mention that this should be *optional* behavior, as the >> current behavior is reasonable for the common case. The API for specifying >> this "load

Re: Should saving a model with foreign keys referencing unsaved models raise an error?

2013-04-25 Thread Aymeric Augustin
On 25 avr. 2013, at 04:22, Yo-Yo Ma wrote: > The following example can throw a wrench in things, if you don't catch it > right away, since it fails silently. > > >>> instance.some_fk_field = unsaved_instance > >>> instance.save() > > The following example bit somebody I worked with a couple ye

Re: Changing deferred model attribute behavior

2013-04-25 Thread Florian Apolloner
On Thursday, April 25, 2013 7:06:06 PM UTC+2, Adrian Holovaty wrote: > > Also, I should mention that this should be *optional* behavior, as the > current behavior is reasonable for the common case. The API for specifying > this "load everything" behavior is a separate discussion. Perhaps a keywor

Re: Changing deferred model attribute behavior

2013-04-25 Thread Alex Gaynor
This sounds like a reasonable request, I don't yet have an opinion on API or anything. One tiny thing I'd like to note though, "change DeferredAttribute to find all *other* DeferredAttributes". I don't think `finding` is the right way to think about it, a `DeferredAttribute` with loadall semantics

Changing deferred model attribute behavior

2013-04-25 Thread Adrian Holovaty
At the moment, if you call defer() or only() on a QuerySet, then access the deferred fields individually, *each* access of a deferred field will result in a separate query. For example, assuming a User model with username/bio/location fields, this is what currently happens: """ >>> u = User.objec

[#20291] Add method to reload `AppCache`

2013-04-25 Thread thinkingpotato
Hi, Speaking of: https://code.djangoproject.com/ticket/20291 I don't see how is this ticket related to #3591 (which BTW says "add support for custom app_label and verbose_name"). This one is a little atomic piece of work and a handy addition that I need as well, and waiting for a ticket that i