#3 is a bit strange - you see, Kid does parse the XML source template
into a compiled python module.  This process involves replacement
(using py:match statements) but those are only run over true XML
information - strings returned from XML() and ${varname} are not parsed
as XML - just escaped or not.  I'm now using the following helper
function to have Kid parse the "content" of my page SQLObjects and
apply py:match statements - it's pretty simple, actually:

>       def _xml(self, text):
>               header = u'''<?xml version='1.0' ?><!DOCTYPE html PUBLIC 
> "-//W3C//DTD XHTML 1.0 Transitional//EN" 
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";><html 
> xmlns="http://www.w3.org/1999/xhtml";>'''
>               footer = u'''</html>'''
>               return kid.XML(header + text + footer)

And now it works.  ;)

The directory structure is rather simple for any given "module" (type
of content), and stays true to MVC, which Python/TG people seem rabid
about :^D

        ContentName/
                static/         Static content goes here.
                                Icons, images, CSS, and JS.
                templates/      Kid template "views".
                                Common "views" are view and modify.
                model.py        SQLObject model definition.
                controllers.py

Each model is inherited from either the Atom base class
(InheritableSQLObject) or another module, i.e. News is descendant from
Page with the addition of a release date.

All "data" about an instance of a content object is stored in an SQLite
database due to performance concerns (SQLite is clocked at much faster
read speeds than MySQL or Postgres) with only static content (imges,
templates, etc.) being stored directly on disk.

Security-wise, I'll be extending Identity to use my model - I eagerly
await the md5/sha hashing patch as plaintext passwords don't cut it
around here - and see your security requirements as being able to be
fulfilled that way.  module=group, access=role, and you're away.  The
only item remaining is cost, but that can be easily implemented as a
count against a user's account.

I haven't even looked at continuations yet - heard they were wonderful
things - best thing since sliced bread, even - but I only recently
learned to program in Python.  I'm still pleasantly amazed that I can
treat a class definition as a variable, or even whole modules as
variables.  ;^)

Reply via email to