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
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
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
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
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
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
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
7 matches
Mail list logo