On 25/11/05, Ismael Garrido <[EMAIL PROTECTED]> wrote:
> Ed Singleton wrote:
>
> >I want to create a small simple CMS for my website.  Users will be
> >able to add and edit basic pages.  Pages can have sub-pages (no need
> >for folders cause a folder and an index.html can be unified into one
> >concept).
> >
> >Users will also be able to create new types of pages, maybe a
> >PressReleasePage for example.  PressReleases would be based on a
> >normal page but might have extra attributes such as Author, Abstract
> >or DateToBeReleased.
> >
> >
> >
> Store the fields in a database, make a factory class that gets those
> fields and generates a page accordingly.
>
> I agree with Kent, what you're trying seems way too abstract.

Weirdly, I'd just realised that SQLObject does most of what I'm
thinking about.  It allows you to update a class and that will affect
all the objects already instantiated.  It has class persistence in
that it will rebuild the class on startup from the columns in your
table so your 'live' changes will be there after you restart the
server.  Though all that is only for the data in the class.

Each method could just contain a call to a function (as I mentioned
above) all the functions could be contained in a module, which would
make it easy to update them as it appears to be easy enough to reload
a module.

The only thing you wouldn't really be able to do is add or remove
methods, which I guess is fine for the moment.

The only thing I'm not sure of is whether SQLObject can store
properties (as in managed attributes) which I need to do for the
'inherit from parent' attribute that I mentioned is a previous thread:

class Page(object):

       def __init__(self, parent):
               self.__header = None
               self.parent = parent

       def getheader(self):
               if not self._header and self.parent:
                       return self.parent.header
               else:
                       return self.__header

       def setheader(self, header):
               self.__header = header

       header = property(getheader, setheader)
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to