[Zope-CMF] Re: How-To: Automatically Add Objects at CMF Member Creation Time

Grégoire Weber gregoire.weber@switzerland.org
Thu, 23 Aug 2001 22:28:43 +0200


Hi Josh,

> 	I would like this objects to be inside the ZODB as then I could give them
> ID's and work with them in other ways.  Also, then the manager user(admin)
> could also see them without having to go to the FS to see what was=
 available
> or to add to them.

I also.

> 	I need to look at skins a bit more but how would you go about making
> attributes on the users?  I can use skins to design the layout of the site
> but how do you modify it to have additional properties for the users? =
 These
> values would have to travel with the users.  So, if you moved the user you
> would always have the values.  That was why I thought to put them with the
> user.  Maybe there is another way but looking around I just found if I=
 added
> a new property to that user then I could access the value easier.

Where in the ZODB did you want to put them?

I think, the additonal properties problem exist independantly of where we
store the initial files.

> These new questions I haven't found an answer to.  I was given the code=
 snip
> from another user and looked into it and found that I need to plan a bit
> more.
> The thought being, I'm setting this up for someone else(who is not a
> programmer but designer) to use.  They would like to use a system that is
> easy to grab values and alter for his purpose of display.  I'm writing the
> python scripts and setting up the base so that it is as flexible as=
 possible
> for him(and me).

I agree.

> As for the afterAdd section I tried to place a small bit of code in there
> that I thought would throw an error but it didn't even do that.  Makes me
> think that maybe it didn't even compile. I'm looking into that.  I may=
 have
> to go with your solution which could solve my problem it makes it=
 difficult
> for the manager user to add and configure in the future.  I like things=
 that
> are easy to change.  

dito.

> Is it possible for you to access an object in the ZODB
> from your __init__.py file?  That is, instead of reading them in from the=
 FS
> you could read through all objects in a particular directory inside the=
 ZODB
> and use those names as the names to create the new defaults for the new
> user?

I don't think there is a structural problem. The __init__.py is called after
the ZODB is set up. The only but solvable problem is to find out the right
way.

> Again, thanks for the help and suggestions.  It has taken me a bit of time
> to read up on Zope and Python and find time away from my java web
> programming to resolve this.  I do want to move everything to Zope as a
> solution for the items I'm working on but having a configurable easy to
> admin solution is something I need as well.

About 'finding time away' it seems we sit in a same kind of boat, with the 
difference that I have to find time away from (brrrr! but generating money) 
assembler programming and customizing CMF for a portal prototype (own 
project == pleasure, but not yet (!) generating money).

:-)

I think the first thing we should do is search the CMF list about this topic.

Greg

_____________________________________
Grégoire Weber
mailto:gregoire.weber@switzerland.org