Re: "Best" way of using templates

2007-02-19 Thread Jonathan Ballet
On 18 fév, 02:34, Lachlan Cannon <[EMAIL PROTECTED]> wrote: > Jonathan Ballet wrote: > > I think, we might use the __str__() method, since it seems the > > simplest and cleanest way of doing this (a title is a sort of > > presentation in fact). Or maybe, we will stick with the get_title() > > meth

Re: "Best" way of using templates

2007-02-17 Thread Lachlan Cannon
Jonathan Ballet wrote: > I think, we might use the __str__() method, since it seems the > simplest and cleanest way of doing this (a title is a sort of > presentation in fact). Or maybe, we will stick with the get_title() > method (or something like that ...) Don't forget, either, that you can us

Re: "Best" way of using templates

2007-02-16 Thread Jonathan Ballet
Thanks for all your answers ! I knew there was no One True Way of doing this, but I have more point of views now. I think, we might use the __str__() method, since it seems the simplest and cleanest way of doing this (a title is a sort of presentation in fact). Or maybe, we will stick with the g

Re: "Best" way of using templates

2007-02-14 Thread Don Arbow
On Feb 14, 2007, at 2:46 PM, James Tauber wrote: > If the formatting could be applied to different classes, I'd use a > filter. If the formatting only makes sense for Houses, I'd make it a > method on House. And you might even want to make it a __str__() method, I do that for some of my models

Re: "Best" way of using templates

2007-02-14 Thread James Tauber
If the formatting could be applied to different classes, I'd use a filter. If the formatting only makes sense for Houses, I'd make it a method on House. James On 14/02/2007, at 9:51 PM, Jonathan Ballet wrote: > > Hello everybody, > > some days ago, my co-worker did some things which keep b

Re: "Best" way of using templates

2007-02-14 Thread Malcolm Tredinnick
On Wed, 2007-02-14 at 13:51 -0800, Jonathan Ballet wrote: [...] > The title is a mix of some fields of a house object : for ex., if the > number of rooms is not available, it is not displayed, etc. > (currently, it's a 30 lines function). > He ends up with a title which looks like this : "House fo

"Best" way of using templates

2007-02-14 Thread Jonathan Ballet
Hello everybody, some days ago, my co-worker did some things which keep bothering me. He has a simple model, which represents, as it's name point out, err ... houses : class House(models.Model): price = models.FloatField(max_digits=10, decimal_places=2) to_buy = models.BooleanField(defa