Re: Revisiting multiline tags

2012-02-25 Thread Yo-Yo Ma
After Ned's message, I'm -0, because while I'm not fond of multi-line tags, I cannot offer a good alternative when it comes to multi-line "with" tags. On Feb 25, 6:48 pm, Ned Batchelder wrote: > On 2/24/2012 11:55 PM, Yo-Yo Ma wrote:> I'm -1 on this for s specific reason;

Re: Revisiting multiline tags

2012-02-25 Thread Joe & Anne Tennies
While this would be a valid argument if Django templates only rendered HTML, that is not the only thing it can be used to render. The original poster gave a very good example of a text-based email. I could list lots of other formats in which white space must be followed to even be useful (like

Re: Revisiting multiline tags

2012-02-25 Thread Ned Batchelder
On 2/24/2012 11:55 PM, Yo-Yo Ma wrote: I'm -1 on this for s specific reason; If you need multiple lines for a tag, you're doing it wrong. import this This would be far more helpful feedback if you would take the examples of too-long tags presented in this thread, and show the "right" way to

Re: Newline stripping in templates: the dnl way

2012-02-25 Thread Jonathan French
Let me make sure I've got this right --- The situation being discussed is not where whitespace is insignificant and can be stripped, but where whitespace is important and you want to control the exact amount of it, e.g. plain text emails. In this case, just using stripwhitespace is not enough.

Re: Newline stripping in templates: the dnl way

2012-02-25 Thread mjl Martin J. Laubach
> > foo bar {# >> #}baz >> >> >> You just made a strong argument against multiline tags: I wouldn't want > to see them abused this way! > Ah, I fully expected to be shot down on "aesthetic" reasons. I still think it's better to have some (maybe slightly ugly) way to do things than no way

Re: Newline stripping in templates: the dnl way

2012-02-25 Thread Tai Lee
I think this discussion is focusing on template tags, not template variables. Maybe even a subset of template tags (e.g. block level tagsif, for, block, filter, etc). Template variables and inline tags (e.g. now) shouldn't have white space stripped. In 100% of cases I can think of I either

Re: Newline stripping in templates: the dnl way

2012-02-25 Thread Anssi Kääriäinen
On Feb 25, 12:04 pm, Florian Apolloner wrote: > Hi, > > On Saturday, February 25, 2012 10:04:21 AM UTC+1, Anssi Kääriäinen wrote: > > > In most situations white space matters: > > {{ user.lastname }} {{ user.firstname }} > > Right, but > """ > {{ user.lastname }} > {{

Re: Newline stripping in templates: the dnl way

2012-02-25 Thread Florian Apolloner
Hi, On Saturday, February 25, 2012 10:04:21 AM UTC+1, Anssi Kääriäinen wrote: > > In most situations white space matters: > {{ user.lastname }} {{ user.firstname }} > Right, but """ {{ user.lastname }} {{ user.firstname }} """ would have produced exactly the same output in HTML, hence my

Re: Revisiting multiline tags

2012-02-25 Thread Stan
*Not* +1 on this. Using extensively Django since the beginning and had never felt the need to break a tag on several lines. HTML does not meant to be written like any programming language (80 cols and so on) and the philosophy of the Django template language has never been to expose a

Re: Newline stripping in templates: the dnl way

2012-02-25 Thread Anssi Kääriäinen
On Feb 25, 10:52 am, Florian Apolloner wrote: > Hi, > > On Saturday, February 25, 2012 5:27:43 AM UTC+1, Tai Lee wrote: > > > Adding more symbols to existing tags (e.g. {^ for x in y ^} or {% for > > x in y -%}), multi-line comment tags that don't actually include a > >

Re: Testing multidb without inconsistency

2012-02-25 Thread Anssi Kääriäinen
On Feb 25, 10:31 am, Jeremy Dunck wrote: > On Sat, Feb 25, 2012 at 2:13 AM, Anssi Kääriäinen > > wrote: > > I think you really should use a transactional test case. The reason is > > that before you do a commit, your writes really should not be visible.

Re: Newline stripping in templates: the dnl way

2012-02-25 Thread Florian Apolloner
Hi, On Saturday, February 25, 2012 5:27:43 AM UTC+1, Tai Lee wrote: > > Adding more symbols to existing tags (e.g. {^ for x in y ^} or {% for > x in y -%}), multi-line comment tags that don't actually include a > comment, and half baked comment tags (where the closing tag is > assumed) are all

Re: Testing multidb without inconsistency

2012-02-25 Thread Jeremy Dunck
On Sat, Feb 25, 2012 at 2:13 AM, Anssi Kääriäinen wrote: > On Feb 25, 9:24 am, Jeremy Dunck wrote: >> I have a master and a replica.  In test, the TEST_MIRROR on the >> replica points to master.  I make writes to master, then read from >> replica, then

Re: Testing multidb without inconsistency

2012-02-25 Thread Anssi Kääriäinen
On Feb 25, 9:24 am, Jeremy Dunck wrote: > I have a master and a replica.  In test, the TEST_MIRROR on the > replica points to master.  I make writes to master, then read from > replica, then assert some numbers. > > def test_stuff(self): >