[Zope-PTK] Simple loginmanager questions

Phillip J. Eby pje@telecommunity.com
Tue, 25 Apr 2000 07:06:22 -0500


At 01:19 PM 4/25/00 +0200, Alexander Limi wrote:
>Zopistas,
>
>A few quick questions about the loginmanager:
>
>1. How usable is release 0.8.1? 

Its authors are using it.  :)


>I've downloaded it, but there was no
>HOWTO, and I couldn't intuitively get it to do what I wanted (I am also on
>vacation at the moment, and therefore a bit lazy :) What I want to do is
>to create a standard user with a propertysheet attached. Would anyone care
>to supply me with a minimal HOWTO, to get me started?

You can't easily attach propertysheets with version 0.8.1.  It has a
framework for doing so, but you have to write the code yourself, from
scratch, without any real examples to go by.  Mike Pelletier did it, so I
know it's possible.  0.9.0, on the other hand, will support simple
persistent propertysheets for users from any data source (ZODB or
otherwise), without so much as lifting a finger.  0.9.0 should be out
either this week or next week; it's waiting on ZPatterns 0.3.0 which adds
the necessary persistence support to Racks (the class UserSources are based
on).  Ty Sarna is going to be on vacation part of this week and part of
next, so even if I get the ZPatterns stuff done this week we may not be
able to get LoginManager out until next week.  The bulk of the 0.3.0 coding
is done, but there is a fair bit of cleanup, docs, permissions setup and
other tedious items left that always seem to delay our releases.  :)


>2. My alternative is to make a temporary solution, where I give each user
>his own folder, thereby providing him with a propertysheet too. This will
>be my own (proprietary :) code, but I would like to be able to migrate
>those users to a loginmanager/PTK-compliant version later on. Are there
>any obvious problems with this? Anything I should watch out for?

Remember that even 0.8.1 lets you select a ZClass to be used for your
LoginManager's User objects.  So one (relatively) easy way to do what you
want might be to implement a GenericUserSource that retrieves user objects
by looking them up in a "Members"-type folder, and using a ZClass derived
from Folder as your User object class.  But if you don't need a full
folder, just make a ZClass with the propertysheets you want, and still
store the users in a folder.  You just have to write the necessary
GenericUserSource methods to look up the users from the folder.

In either case, however, if you can wait the week or two for persistent
propertysheet support, you might be better off in terms of time spent.


>3. Are there any resources where I can learn how to use the loginmanager,
>or is the source my best bet?
>

The source is currently your best bet.  I have put a fair amount of effort
into docstrings and comments tailored towards someone who's trying to
extend/adapt/interface with the system.  Probably most of the work between
0.9.0 and 1.0.0 is going to be documentation and bug fixes, but right now
we are keeping our doc efforts focused on the source because things have
been changing too rapidly to keep external docs properly in sync.