How to parse text before being loaded into Django's admin for editing
The more simple solution is to have two fields, the original and the generated HTML.
Use the original as you are using it now and save the generated HTML to the other field.
Use the other field for your templates.
I am creating a dynamic blog. I use Django's admin to add posts, and I have created some simple tags that python then substitutes for the actual html and css that are needed by the browser. This makes each blog easier to create and easier to read while creating.
Before Django saves the new blog, I've coded my model to send the text to a python script, which parses the code and creates the finished html.
This all works great, but I would also like to be able to parse the code before Django loads it, that way I can remove the html/css programatically, changing it back to the easier to read tags, making it easier to edit an already created blog.
Is there a way to capture control of Django admin BEFORE it loads model data into the form for editing?