Re: Rendering models using their own templates

2009-05-19 Thread Roberto Cea
HI Eric, thanks for the reply. I sort of found a solution, by poking through the contrib.syndication app, I added this function to my model: from django.template import loader def render(self): html_tmp = loader.get_template(self.html_template_name) html = loader.render_to_stri

Re: Rendering models using their own templates

2009-05-19 Thread Eric Abrahamsen
On May 20, 2009, at 10:53 AM, Roberto Cea wrote: > > I have a large amount of optional components (with a model for each > one) that will be freely inserted by my users, and it would be > impractical to render each one in a single large template. > I want to give each component a ".render()" met

Rendering models using their own templates

2009-05-19 Thread Roberto Cea
I have a large amount of optional components (with a model for each one) that will be freely inserted by my users, and it would be impractical to render each one in a single large template. I want to give each component a ".render()" method, so I can just call that from the template. However, I do