Re: Deferred fields problem.

2012-05-14 Thread Jani Tiainen
I'm still on 1.3.1 but planning to upgrade to 1.4 quite soon. On Mon, May 14, 2012 at 3:50 PM, akaariai wrote: > On May 14, 3:29 pm, Jani Tiainen wrote: > > 14.5.2012 14:50, akaariai kirjoitti: > > > > > > > > > > > > > > > > > > > > > > > > > On May 14, 2:37 pm, Jani Tiainen wrote: > > >> Hi,

Re: Deferred fields problem.

2012-05-14 Thread akaariai
On May 14, 3:29 pm, Jani Tiainen wrote: > 14.5.2012 14:50, akaariai kirjoitti: > > > > > > > > > > > > > On May 14, 2:37 pm, Jani Tiainen  wrote: > >> Hi, > > >> I have in my database quite a bunch of a models where I do have quite > >> large fields and I'm using .only('pk', 'identifier') to fetch

Re: Deferred fields problem.

2012-05-14 Thread Jani Tiainen
14.5.2012 14:50, akaariai kirjoitti: On May 14, 2:37 pm, Jani Tiainen wrote: Hi, I have in my database quite a bunch of a models where I do have quite large fields and I'm using .only('pk', 'identifier') to fetch only those two fields - mainly to make serverside natural sort for a data. Data

Re: Deferred fields problem.

2012-05-14 Thread akaariai
On May 14, 2:37 pm, Jani Tiainen wrote: > Hi, > > I have in my database quite a bunch of a models where I do have quite > large fields and I'm using .only('pk', 'identifier') to fetch only those > two fields - mainly to make serverside natural sort for a data. Database > is legacy one and it's b

Deferred fields problem.

2012-05-14 Thread Jani Tiainen
Hi, I have in my database quite a bunch of a models where I do have quite large fields and I'm using .only('pk', 'identifier') to fetch only those two fields - mainly to make serverside natural sort for a data. Database is legacy one and it's being used with other external programs as well so

Re: Deferred fields

2011-06-30 Thread Bill Freeman
Use a property in combination with an ordinary null=True field. Always access it (from python or template code) via the property. On Thu, Jun 30, 2011 at 4:13 PM, Ori wrote: > Hi, > > I'd like to defer calculating a value for a particular field until the > value is required. > > Suppose I have t

Deferred fields

2011-06-30 Thread Ori
Hi, I'd like to defer calculating a value for a particular field until the value is required. Suppose I have these models: class Fruit(models.Model): # various fields class FruitBasket(models.Model): fruit = models.ManyToManyField(Fruit) I'd like to add a "most_nutritious" field to Fru