On Sun, 2007-08-19 at 15:21 -0400, Austin Govella wrote:
> I want templates to be accessible and editable via my admin interface
> (not *the* admin).
> 
> My question is about the best way to achieve this? Should templates be
> stored in the database? Or should they be stored in a templates
> directory and sucked into a textarea for editing?
> 
> This is for a multi-user app (so every user could have totally
> different templates).
> 
> User interaction for both would be the same. Go to the area of the
> admin where you edit templates, select the template you want to edit,
> and the template appears in a textarea for you to edit. Saving stores
> the template, and your changes are immediately visible.

If you store the templates as a text field in the database, editing it
through the admin interface will work without you having to do any work.
You'll need to use a template loader that knows how to load
database-stored templates. There are a couple of those around. Earlier
today, on this list, somebody point to this one, for example:

   http://code.google.com/p/django-databasetemplateloader/

If you want file-backed storage, then you'll need to write a special
model field that knows how to take the name or templated identifier and
return the data from disk and also display the right widget in the admin
interface. Whilst not impossible to do with current admin, that will be
easier with newforms-admin (and some field-subclassing helpers and
documentation that hasn't landed on trunk yet because I've been busy on
other things).

Regards,
Malcolm

-- 
For every action there is an equal and opposite criticism. 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to