Re: Auto-escaping patch, missed one widget

2007-11-20 Thread Alberto Piai
On Nov 20, 12:42 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2007-11-19 at 10:29 -0800, Alberto Piai wrote: > > Hello Malcolm, > > > SelectDateWidget from newform extras stopped working after > > autoescaping was introduced in r6671. Here is the tiny patch to fix > > it. > > Pleas

Re: Auto-escaping patch, missed one widget

2007-11-19 Thread Malcolm Tredinnick
On Mon, 2007-11-19 at 10:29 -0800, Alberto Piai wrote: > Hello Malcolm, > > SelectDateWidget from newform extras stopped working after > autoescaping was introduced in r6671. Here is the tiny patch to fix > it. Please file any patches in Trac so that they don't get forgotten. The patch looks fi

Auto-escaping patch, missed one widget

2007-11-19 Thread Alberto Piai
Hello Malcolm, SelectDateWidget from newform extras stopped working after autoescaping was introduced in r6671. Here is the tiny patch to fix it. Regards, and thanks for the great work. Alberto Index: django/newforms/extras/widgets.py ===

Re: Auto-escaping patch

2007-02-07 Thread Malcolm Tredinnick
[This is very off-topic, so I'll make this my last post on this topic. Email me directly if you want more info.] On Wed, 2007-02-07 at 04:01 -0800, Nicola Larosa (tekNico) wrote: > Malcolm Tredinnick wrote: > > But it's all "git" under the covers. I wrote up a brief description when > > I started

Re: Auto-escaping patch

2007-02-07 Thread Nicola Larosa (tekNico)
Malcolm Tredinnick wrote: > But it's all "git" under the covers. I wrote up a brief description when > I started using this a few months ago: > http://www.pointy-stick.com/blog/topics/software/version%20control/ . (I know, I should have directly commented on that page, and I would have, if there

Re: Auto-escaping patch

2007-02-07 Thread Michael Radziej
Malcolm Tredinnick: > I didn't change django.utils.html.escape() though, since I was trying to > avoid breaking existing code and that function can be called from > outside the templating system (in that sense, the naming is logical; > away from the templating system, escape() escapes always). The

Re: Auto-escaping patch

2007-02-07 Thread Malcolm Tredinnick
On Wed, 2007-02-07 at 10:17 +0100, Michael Radziej wrote: > Malcolm Tredinnick: > > I just got back today from overseas, so after I've worked out which way > > is up I'll have a look at your fixes and fill in the missing bits > > (newforms + admin). > > Hey, nice to hear you're back and safe! >

Re: Auto-escaping patch

2007-02-07 Thread Michael Radziej
Malcolm Tredinnick: > I just got back today from overseas, so after I've worked out which way > is up I'll have a look at your fixes and fill in the missing bits > (newforms + admin). Hey, nice to hear you're back and safe! It would certainly be good if you could look into the new patches, there

Re: Auto-escaping patch

2007-02-07 Thread Malcolm Tredinnick
Hey Michael, On Wed, 2007-02-07 at 09:11 +0100, Michael Radziej wrote: > Hi, > > I'd like to revive the discussion about autoescape (note that it is > *not* on by default). I have brought the patches up to date (see the > notes in the ticket, #2359), and I'm starting to use this now in my > own

Re: Auto-escaping patch

2007-02-07 Thread Michael Radziej
f ;-) --> http://code.djangoproject.com/ticket/2359 Cheers, Michael Malcolm Tredinnick: > I have put an initial version of the auto-escaping patch I mentioned > yesterday into ticket #2359. I'll briefly describe what it does below. > The patch includes changes to the core

Re: Auto-escaping patch (terminology)

2006-07-20 Thread Michael Radziej
Am 20.07.2006 um 04:25 schrieb Todd O'Bryan: > > Is xml_escaped just too verbose? Seems very descriptive and > unambiguous. Do you mean mark_xml_escaped for mark_safe, XmlEscapedString for SafeString, is_xml_escaped for is_safe (as function attribute)? In the (long) discussion, this has alr

Re: Auto-escaping patch (terminology)

2006-07-19 Thread Todd O'Bryan
Is xml_escaped just too verbose? Seems very descriptive and unambiguous. Todd On Jul 19, 2006, at 4:56 PM, SmileyChris wrote: > >> 'escape' and 'safe' have a different meaning for fireworkers, too ;-) > Or bank robbers :-P > > Back on topic, I like finalization too (even though I cringe having

Re: Auto-escaping patch (terminology)

2006-07-19 Thread Michael Radziej
Hi Chris, Am 19.07.2006 um 22:56 schrieb SmileyChris: > Back on topic, I like finalization too (even though I cringe having to > write the american Z version). Yeah, but default TZ is Chicago, so ... I chose zee. Be glad that you're not forced to spell 'aluminum' somwhere! The Old Britain Emp

Re: Auto-escaping patch (terminology)

2006-07-19 Thread SmileyChris
> 'escape' and 'safe' have a different meaning for fireworkers, too ;-) Or bank robbers :-P Back on topic, I like finalization too (even though I cringe having to write the american Z version). --~--~-~--~~~---~--~~ You received this message because you are subsc

Re: Auto-escaping patch (terminology)

2006-07-19 Thread Michael Radziej
jeremy bornstein wrote: > In some circles, "finalization" is what happens to an object immediately > before it is GC'd, so this choice may end up being confusing. This is > the case with respect to Java, for example. Doesn't keep me from liking it, and Java is not python. Probably each and eve

Re: Auto-escaping patch

2006-07-18 Thread Malcolm Tredinnick
On Wed, 2006-07-19 at 11:19 +1000, Malcolm Tredinnick wrote: > On Tue, 2006-07-18 at 18:03 -0700, SmileyChris wrote: > > > > Malcolm Tredinnick wrote: > > > On Mon, 2006-07-17 at 03:30 -0700, SmileyChris wrote: > > > > A couple of points: > > > > If a markup filter fails due to an import error, I

Re: Auto-escaping patch

2006-07-18 Thread Malcolm Tredinnick
On Tue, 2006-07-18 at 18:03 -0700, SmileyChris wrote: > > Malcolm Tredinnick wrote: > > On Mon, 2006-07-17 at 03:30 -0700, SmileyChris wrote: > > > A couple of points: > > > If a markup filter fails due to an import error, I don't think it > > > should be marked as safe. > > > > Why not? The retu

Re: Auto-escaping patch

2006-07-18 Thread SmileyChris
Malcolm Tredinnick wrote: > On Mon, 2006-07-17 at 03:30 -0700, SmileyChris wrote: > > A couple of points: > > If a markup filter fails due to an import error, I don't think it > > should be marked as safe. > > Why not? The returned result is the empty string in that case and > there's certainly n

Re: Auto-escaping patch (terminology)

2006-07-18 Thread jeremy bornstein
In some circles, "finalization" is what happens to an object immediately before it is GC'd, so this choice may end up being confusing. This is the case with respect to Java, for example. On Tue, 18 Jul 2006 2:21 pm, Michael Radziej wrote: > > Hi, > > I made up my mind and I think I have the so

Re: Auto-escaping patch (terminology)

2006-07-18 Thread Michael Radziej
Hi, I made up my mind and I think I have the solution (for the is_safe terminology, django world domination, and all the rest :-) * finalized * So it's : FinalizedString (replaced SafeString) mark_finalized() (replaces mark_safe) preserves_finalized (replaces is_safe as a function attrib

Re: Auto-escaping patch

2006-07-18 Thread Michael Radziej
Am 18.07.2006 um 18:06 schrieb Daniel Poelzleithner: > > Malcolm Tredinnick wrote: > >> Damn. Your phrasing tipped me off to a case we need this more: RSS >> feeds >> and Atom content elements with type="html". :-( >> >> We might need a "mark as unsafe" filter for these cases (so that >> {{

Re: Auto-escaping patch

2006-07-18 Thread Daniel Poelzleithner
Malcolm Tredinnick wrote: > Damn. Your phrasing tipped me off to a case we need this more: RSS feeds > and Atom content elements with type="html". :-( > > We might need a "mark as unsafe" filter for these cases (so that {{ var| > escape|unsafe|escape }}) works (or just make "escape" not mark the

Re: Auto-escaping patch

2006-07-17 Thread adurdin
Malcolm Tredinnick wrote: > When a variable is evaluated in a context in a template, it is > considered to be either "safe" or not (Simon used the term "escaped", > but that seemed less universally true than "safe"). As long as we're discussing terminology, might as well enumerate the situations

Re: Auto-escaping patch (terminology)

2006-07-17 Thread Michael Radziej
Malcolm Tredinnick wrote: > If you want to mark every "still needs cooking" string then you have to > mark *every* string that comes into the system (a la Perl's tainted > strings). Nonono ... I just was talking about terminology. We need a term for "safe" and "unsafe" strings. I take it as gra

Re: Auto-escaping patch

2006-07-17 Thread Malcolm Tredinnick
On Mon, 2006-07-17 at 12:00 +0200, Michael Radziej wrote: > Malcolm Tredinnick wrote: > > On Sun, 2006-07-16 at 21:30 +0200, Michael Radziej wrote: > >> I'm more for 'escaped' and 'raw', but not really violently. This is a > >> minor issue, and I wouldn't like to get the work delayed by it. >

Re: Auto-escaping patch

2006-07-17 Thread Malcolm Tredinnick
On Mon, 2006-07-17 at 03:30 -0700, SmileyChris wrote: > Great job on the patch, Malcom! > I posted this in the ticket, then felt guilty because you told me not > to. So I'll post here for discusion. > > A couple of points: > If a markup filter fails due to an import error, I don't think it > shou

Re: Auto-escaping patch

2006-07-17 Thread SmileyChris
Great job on the patch, Malcom! I posted this in the ticket, then felt guilty because you told me not to. So I'll post here for discusion. A couple of points: If a markup filter fails due to an import error, I don't think it should be marked as safe. >From a skim read of the patch, I'm missing th

Re: Auto-escaping patch

2006-07-17 Thread Michael Radziej
Malcolm Tredinnick wrote: > On Sun, 2006-07-16 at 21:30 +0200, Michael Radziej wrote: >> I'm more for 'escaped' and 'raw', but not really violently. This is a >> minor issue, and I wouldn't like to get the work delayed by it. >> Also ... I volunteer to rewrite the docs if these terms change. B

Re: Auto-escaping patch

2006-07-16 Thread James Bennett
On 7/16/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > What does this add? > --- > (1) An "autoescape" template tag that turns automatic escaping on or off > throughout its scope. OK. > (2) A "noescape" filter that marks its result as safe for use without > further escaping

Re: Auto-escaping patch

2006-07-16 Thread Malcolm Tredinnick
On Sun, 2006-07-16 at 21:30 +0200, Michael Radziej wrote: > Hi, > > I really appreciate your work, it goes all along my wishes--thanks a > *lot*, Malcolm! > > I'll try to find some time in the next few days to test how my > existing stuff would look using autoescape. > > I have looked in yo

Re: Auto-escaping patch

2006-07-16 Thread Michael Radziej
Hi, Am 16.07.2006 um 23:53 schrieb Martina Oefelein: > Hi Malcolm, > >> (3) Auto-escaping inherits down through template inclusions. That >> is, if >> you extend a template that has auto-escaping enabled, you get >> auto-escaping enabled (obviously the autoescape template tag can >> control >> t

Re: Auto-escaping patch

2006-07-16 Thread Todd O'Bryan
On Jul 16, 2006, at 5:53 PM, Martina Oefelein wrote: > >> (3) Auto-escaping inherits down through template inclusions. That >> is, if >> you extend a template that has auto-escaping enabled, you get >> auto-escaping enabled (obviously the autoescape template tag can >> control >> this). Anybody h

Re: Auto-escaping patch

2006-07-16 Thread Martina Oefelein
Hi Malcolm, > (3) Auto-escaping inherits down through template inclusions. That > is, if > you extend a template that has auto-escaping enabled, you get > auto-escaping enabled (obviously the autoescape template tag can > control > this). Anybody have a strong reason not to do this? >

Re: Auto-escaping patch

2006-07-16 Thread Michael Radziej
Hi, I really appreciate your work, it goes all along my wishes--thanks a *lot*, Malcolm! I'll try to find some time in the next few days to test how my existing stuff would look using autoescape. I have looked in your patch only cursory, so my comments refer to the general approach and no

Re: Auto-escaping patch

2006-07-16 Thread Tom Tobin
On 7/16/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > I have put an initial version of the auto-escaping patch I mentioned > yesterday into ticket #2359. I'll briefly describe what it does below. > The patch includes changes to the core and a test suite for the

Auto-escaping patch

2006-07-16 Thread Malcolm Tredinnick
I have put an initial version of the auto-escaping patch I mentioned yesterday into ticket #2359. I'll briefly describe what it does below. The patch includes changes to the core and a test suite for the auto-escaping changes (which is about half the patch). My reason for posting this first