Re: Can I allow html tags in admin interface input?

2009-09-29 Thread EricR86
Yes, absolutely. Use the builtin template filter: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#safe All output by default from Django is auto escaped to avoid possibly malicious html/javascript injection. An example would be by starting a comment with a , and not closing the tag.

Ordering by sum of fields?

2009-09-29 Thread EricR86
Hello, I've been looking into trying to order a relation based on some arithmetic on each model's fields. This would ideally be at a database level, and not a brute force python way. A simple example which I can't seem to get to work is a sum of two fields. For example, I want to sum a total amo

Removing line breaks in a template

2009-09-10 Thread EricR86
Hello, I was wondering if it was at all possible to remove line breaks from a text passed in from a template variable. Ideally I'd like to do something like: {{ text|cut:"\r\n" }} , but that doesn't seem to work. I've tried googling and searching on the mailing list with no results. Thanks for y

Re: Callable objects inside a context

2009-06-09 Thread EricR86
y as I would like it to. Thanks again, - Eric On Jun 9, 4:35 am, Daniel Roseman wrote: > On Jun 9, 5:23 am, EricR86 wrote: > > > > > Hello, > > > I have a small issue in terms callable objects inside of contexts. I'm > > having trouble figuring out how to

Re: Callable objects inside a context

2009-06-09 Thread EricR86
y as I would like it to. Thanks again, - Eric On Jun 9, 4:35 am, Daniel Roseman wrote: > On Jun 9, 5:23 am, EricR86 wrote: > > > > > Hello, > > > I have a small issue in terms callable objects inside of contexts. I'm > > having trouble figuring out how to

Re: Callable objects inside a context

2009-06-09 Thread EricR86
y as I would like it to. Thanks again, - Eric On Jun 9, 4:35 am, Daniel Roseman wrote: > On Jun 9, 5:23 am, EricR86 wrote: > > > > > Hello, > > > I have a small issue in terms callable objects inside of contexts. I'm > > having trouble figuring out how to

Callable objects inside a context

2009-06-08 Thread EricR86
Hello, I have a small issue in terms callable objects inside of contexts. I'm having trouble figuring out how to have the call evaluated everytime the context is used/rendered. An example: some_context = { 'random': random(), } def some_view(request): return render_to_response('some_tem