Re: mark_safe for a html field

2008-03-31 Thread Malcolm Tredinnick
On Mon, 2008-03-31 at 06:50 -0500, James Bennett wrote: > On Mon, Mar 31, 2008 at 6:46 AM, James Bennett <[EMAIL PROTECTED]> wrote: > > Since subclassing Field to create your own custom model fields is easy > > and documented, why not write an "HTMLField" class which calls > > mark_safe()

Re: mark_safe for a html field

2008-03-31 Thread James Bennett
On Mon, Mar 31, 2008 at 6:46 AM, James Bennett <[EMAIL PROTECTED]> wrote: > Since subclassing Field to create your own custom model fields is easy > and documented, why not write an "HTMLField" class which calls > mark_safe() before returning a value? And though I may be wrong, I think it'd

Re: mark_safe for a html field

2008-03-31 Thread Malcolm Tredinnick
On Mon, 2008-03-31 at 04:40 -0700, Marc Garcia wrote: > I was thinking in giving a option on field definition, to make it safe > on all templates at same time. Anyway using safe filter as you > proposed is clearer than my initial solution. The slight problem you're running up against here is

Re: mark_safe for a html field

2008-03-31 Thread James Bennett
On Mon, Mar 31, 2008 at 6:40 AM, Marc Garcia <[EMAIL PROTECTED]> wrote: > I was thinking in giving a option on field definition, to make it safe > on all templates at same time. Anyway using safe filter as you > proposed is clearer than my initial solution. Since subclassing Field to create

Re: mark_safe for a html field

2008-03-31 Thread Marc Garcia
I was thinking in giving a option on field definition, to make it safe on all templates at same time. Anyway using safe filter as you proposed is clearer than my initial solution. Thanks Kenneth On Mar 31, 4:01 am, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On 31-Mar-08, at 7:20 AM, Marc

Re: mark_safe for a html field

2008-03-30 Thread Kenneth Gonsalves
On 31-Mar-08, at 7:20 AM, Marc Garcia wrote: > does anybody know a simple way to mark a model field as safe html (and > tell django not to escape this field content)? http://www.djangoproject.com/documentation/templates/#automatic-html- escaping -- regards kg http://lawgon.livejournal.com

mark_safe for a html field

2008-03-30 Thread Marc Garcia
Hi, does anybody know a simple way to mark a model field as safe html (and tell django not to escape this field content)? I can create a method in the model that outputs the return of mark_safe applied to field content, and it should work. But may be there is something more simple that I'm