[Zope-PTK] SQLMembers Based Portal Q

Mike Pelletier mike@digicool.com
Thu, 16 Mar 2000 10:45:10 -0500 (EST)


On Wed, 15 Mar 2000, Bill Anderson wrote:

> Err ... it has been a while. I would say about 5-6 weeks. As far as code
> use, well, in the case I would be concerned over, pretty much nothing
> other than a few added  PTK Content thingums (Event Announcememnt,
> Product Review, etc).

    In your version, is there a PTKBase/register.py module?  If not, there
will be a little work to get your objects working after you update.  The
just-mentioned module now handles the registration of new PortalContent
thingums.  It has a descriptive doc string, and additional documentation
in interfaces.

> I saw reference to this. Fortunately, I haven't yet done much with
> members-specific stuff that is not handled by the portal. On that note,
> I have had a question I have been digging into on that. Let us say a
> member has a property 'MemberSince' on PropertySheet 'MemberData'.
> What is the proper way of referencing that item (in python and dtml if
> you can)?

    Python:


def memberLifeTime(self, member):
	return DataTime() - \
               member.getPropterySheet('MemberData').MemberSince


    DTML:


<dtml-with "AUTHENTICATED_USER.getPropertySheet('MemberData')">
 <p>You've been a member since &dtml-MemberSince;</p>
</dtml-with>


> Secondly, is this 'feature' a PTK thing? I ask this one because I am
> looking for a way to better abstract property placement for my
> Advertising ToolKit (for lack of a better name!). If so, where would I
> find this code. I've kinda got lost in the maze of imports so far :(

    Nope, these property sheets are a ZClass feature.  It will eventually
be a feature of some component of LoginManager (I forget the name) but I'm
faking it with ZClasses for now.  That is why you can't just go though
'self.propertysheets' as you normally would for a ZClass.  (That would cut
LoginManager out of the loop for ZClass member objects, and simply not
work for other member objects.)

> OK, got it.
> SO LoginMehtods would be where I would implement say, an login via
> Cookie, BasicAuth, DigestAuth(when supported), etc., correct?

    Bingo.  That is so.

Mike.

-- 
Mike Pelletier                          email: mike@digicool.com
Mild mannered software developer          icq: 7127228
by day, super villain by night.         phone: 519-884-2434