On Sep 14, 12:46 pm, "Jonathan Buchanan" <[EMAIL PROTECTED]>
wrote:
> I'd have to take a look at how that tag was implemented, but I'd
> likely start out with something horrific, like the attached patch :D
Tsk, tsk. Bending the rules of the game a bit now, aren't we? :-)
Again, yes, you could do
On 9/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> On Sep 14, 11:29 am, "Jonathan Buchanan" <[EMAIL PROTECTED]>
> wrote:
> > Pesky kids these days, with your music and your anticipation...
>
> :-)
>
> > I agree that what you propose here would be useful in the scenario
> > you've describe
On Sep 14, 11:29 am, "Jonathan Buchanan" <[EMAIL PROTECTED]>
wrote:
> Pesky kids these days, with your music and your anticipation...
:-)
> I agree that what you propose here would be useful in the scenario
> you've described. *Personally*, if I wanted something like that, I'd
> just write a fun
> Thanks for the response. But to be fair to you I must disclose that I
> anticipated that someone would present this as an answer. I would have
> added this discussion into the original but it was already a bit
> long... :-)
Pesky kids these days, with your music and your anticipation...
> Now
On Sep 14, 9:31 am, "Jonathan Buchanan" <[EMAIL PROTECTED]>
wrote:
>
> Template tags really are the best place to put display-specific logic
> like this. The original problem specified (a custom button and
> associated JavaScript for an object with the object's name in the
> button's id) could be
> However, simply dodging the question doesn't address the original point:
> why does Django adhere to such a nannyish philosophy, and how do you
> solve the problem I presented *within Django* in a reasonable way?
>
> Thanks and regards,
> -scott anderson
Template tags really are the best place
Yes, that's always the fall back, isn't it?
I'll look at Jinja, as I didn't realize there was such a fork.
Apparently I'm not the only one who thinks this way.
I'm concerned with how well a solution like this tracks the Django
release.
However, simply dodging the question doesn't address the or
Thank you, but that's exactly what I said I *didn't* want to do, because
it's silly. :-)
Why should my *data model* know *anything* about the presentation? And
what happens when I want a parrot row ID, or a parrot foo ID, or a
parrot cheese ID? Suddenly I have a proliferation of things in my data
no, Scott, you should just do *this*:
In your Parrot model, you could add a property that displays your DOM
id.
class Parrot(models.Model):
# fields
def _domid(self):
return ''parrotButton-%s" % self.id
domid = property(_domid)
and use parrot.domid in your templates.
On 14
On 9/13/07, Scott Anderson <[EMAIL PROTECTED]> wrote:
> What I'm hoping, however, is that this missive was moot, because you'll
> say, "no, Scott, you should just do *this*:", followed by an elegant and
> reasonable solution that I, as a relative newcomer to Django, have not
> yet considered. Here
On Thu, 2007-08-23 at 21:59 +0800, Russell Keith-Magee wrote:
[...]
> Generally speaking - you don't.
>
> This is by design. Django tries very hard to prevent you from putting
> logic into a template. Logic and calculations belong in the view; the
> template shouldn't have any need for calculatio
On 8/23/07, *San* <[EMAIL PROTECTED]> wrote:
>
> So now, I passed in as dictionary data = { a: a_stuff, b:
> b_stuff, ... }
> where a_stuff and b_stuff is also a dictionary, a_stuff {a_max:9,
> a_min:0, .. etc}
>
> when i use
> {% for key,value in data.items %}
> {{key}}, {{value}}
> {%endfor%
So now, I passed in as dictionary data = { a: a_stuff, b:
b_stuff, ... }
where a_stuff and b_stuff is also a dictionary, a_stuff {a_max:9,
a_min:0, .. etc}
when i use
{% for key,value in data.items %}
{{key}}, {{value}}
{%endfor%}
it doesn't print anything, but when i do
{% for key in data.i
On 8/23/07, *San* <[EMAIL PROTECTED]> wrote:
>
> How to add suffix/prefix in a template? So if i passed in a list name-
> [a,b,c,d] and a_max, b_max, etc from views.py. and I do something like
>
> {% for i in name %}
> {{ i_max}}
> {% endfor %}
>
> so I actually wants to print the value of a_m
hardcode the code instead of using for
loop?
On Aug 23, 11:01 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> > I know my question could be a bit silly but... I dont know how to do
> > it. Do anybody know how to do arithmetic operations in a templete?
>
> > {{elem}}
>
>
On 8/23/07, altahay <[EMAIL PROTECTED]> wrote:
>
> Hello to all,
>
> I know my question could be a bit silly but... I dont know how to do
> it. Do anybody know how to do arithmetic operations in a templete?
Generally speaking - you don't.
This is by design. Django trie
> I know my question could be a bit silly but... I dont know how to do
> it. Do anybody know how to do arithmetic operations in a templete?
>
> {{elem}}
>
> what I want to do is something like {{ elem }} + 100
There's an "add" filter...
http://www.djangopr
Sorry I wrote "templete" instead of "template" ...
On 23 ago, 12:31, altahay <[EMAIL PROTECTED]> wrote:
> Hello to all,
>
> I know my question could be a bit silly but... I dont know how to do
> it. Do anybody know how to do arithmetic operations in a templ
Hello to all,
I know my question could be a bit silly but... I dont know how to do
it. Do anybody know how to do arithmetic operations in a templete?
{{elem}}
what I want to do is something like {{ elem }} + 100
thank you in advance
19 matches
Mail list logo