>
> It's not a particularly bad idea; having an object carry with it
> standardized information which tells you what template to use to
> display it would be pretty easy (assuming, of course, that you have
> the ability to lay out the model classes to support that).
>
Fortunately my models make t
On 12/18/06, Crispin Bennett <[EMAIL PROTECTED]> wrote:
> I was primarily wondering whether there's a 'natural' Django idiom or
> pattern for doing this kind of thing. My first crude attempt is to
> have a method in the model that provides a predictable template name
> for the object. Then in my m
On 12/18/06, Alan Trick <[EMAIL PROTECTED]> wrote:
> Actually every class instance has a __str__ method. If it's not
> over-ridden, it gets the one inherited from object (which is probably
> not what you want, but it's still there).
Yeah, what I wanted to get at was that the representation it pro
On 12/19/06, James Bennett <[EMAIL PROTECTED]> wrote:
>
> Even if the types aren't known in advance, it's possible to make some
> educated guesses; most classes will, for example, have a __str__
> method which will allow them to intelligently print themselves as
> strings.
>
> If you know what typ
On Mon, 2006-12-18 at 19:57 -0600, James Bennett wrote:
> Even if the types aren't known in advance, it's possible to make some
> educated guesses; most classes will, for example, have a __str__
> method which will allow them to intelligently print themselves as
> strings.
Actually every class in
On 12/18/06, Crispin Bennett <[EMAIL PROTECTED]> wrote:
> Is there a natural way in Django to write a template that can display
> the details of objects of various types, where the types aren't
> necessarily known in advance?
Even if the types aren't known in advance, it's possible to make some
e
On 12/19/06, Crispin Bennett <[EMAIL PROTECTED]> wrote:
>
> Is there a natural way in Django to write a template that can display
> the details of objects of various types, where the types aren't
> necessarily known in advance?
>
if the objects can be convert to string, or it has __str__ method, I
7 matches
Mail list logo