[Zope-dev] LoginUser and Dictionaries

2001-03-06 Thread Johan Carlsson

Hi,
I'm working on a User object that will support
Groups and Groups-to-Roles mappings.

I modeled it a bit and come up with this model:
(I use Coad's constraints notion, putting constraints with the item the constrain)

User -n--n- Role
   | n
   |
   | 1
GroupRoleItem  -1- n-  Role (*same as the other role above)
   | 1 
   |
   | n
Group

To make it as simple as possible I whan to keep 
Group and GroupRoleItem in a dictionary inside the User instance.
E.g. {'groupname': ('rolename','rolename',), ... }

In my LM implementation I want to store GroupRoleItems in a SQL table
and Groups in another SQL table (which records awailable groups).

The LoginUser object should have a attribute grouproles_dict that gets
its data from the GroupRoleItems table.

Here's some code:
class GroupLoginUser(LoginUser):
...
def getGroupRoles(self):
# group_list contains the following brains from the LoginManager 
(Skinscript/SQL method):
# (brains.username)
# brains.rolename
# brains.groupname
#
groups = ()
grouproles = {}
if self.group_list:
for g in self.group_list:
if g.groupname in groups:
grouproles[g.groupname].append(g.rolename)
else:
grouproles[g.groupname] = [g.rolename]
groups = groups + (g.groupname,)
return grouproles

The GroupLoginUser is not stored persitently in my implementation,
but I like to cache the grouproles for as long as possible. 
For example I'm planning a method "getGroups" in the GroupLoginUser
which could just return grouproles.keys().

So because GroupLoginUser is a virtual dataskin I'm not sure
where I should save the grouproles. In self._v_grouproles or
as a skinscripted attribute?
E.g. WITH self.getGroupRoles() COMPUTE grouproles = RESULT


I might be thinking wrong in the model as well, so any hints and tips
for corrections are welcome.

Regards,
Johan Carlsson


¢—ƒzùšŠYb²Öh¥àÞ¿:)zŠà†Ûiÿùb²Û3¢—¨®æj)fjåŠËbú?Ί^uëÍ¡Êè²Êh²Û(¬tÌ-éܡا¥jם–+-²m§ÿåŠËlΊ^¢¸?™¨¥™©ÿ–+-Šwèÿ:)y©ç¢éÜzm§ÿåŠËlΊ^¢¸?™¨¥™©ÿ–+-Šwèÿ:)


[Zope-dev] Implementing ZPattern: Containment

2001-03-06 Thread Johan Carlsson

Hi,
How could containment be implemented with ZPatterns.

Container -n-1- ContainedItem -n-1- ContainedSubItem

I suppose there would be a Containter Specialist
containing a ContainerItem Specialist. 
But Specialists retrieve objects by IDs so there would 
also be a list of ContainerItem ID in the Container object.

Are there any other way to do it, for instance keeping a
list of object references that would be retrieve from the
ContainerItem Specialist by a attribute provider in
the Containter Specialist? But I still need the list of
IDs don't I or how else would the ContainerItem Specialist 
know what objects to return?

TIA,
Johan Carlsson
fŠ^
ëæj)eŠËY¢—ƒzüè¥ê+‚m§ÿåŠËlΊ^¢¸?™¨¥™©ÿ–+-Šwèÿ:)yׯ6‡+¢Ë)¢Ël¢±Ó0·§r‡bž^•«^vX¬¶Èm¶Ÿÿ–+-³:)zŠàþf¢–f§þX¬¶)ߣüè¥æ§ž‹§qèm¶Ÿÿ–+-³:)zŠàþf¢–f§þX¬¶)ߣüè¥


Re: [Zope-dev] TransWarp preview release (AOP tools only)

2001-03-06 Thread Shane Hathaway

"Phillip J. Eby" wrote:
 
 At 12:39 PM 3/2/01 -0500, Shane Hathaway wrote:
 This could be achieved by generating a new Python module for each portal
 instance, but that would mean sys.modules would have to be pre-loaded
 with the information about each portal instance and that's not the ZODB
 way.  It would be better to create a new class loader that can weave a
 new class on the fly based on persisted component metadata.  Note that
 class loading is currently quite simple; see
 lib/python/Zope/ClassLoader.py (sp?).  It could bear some complexity.
 :-)
 
 There's actually a simpler way.  Aspect objects can be pickled as long as
 all the objects in them can be pickled.  Which means that as long as all
 their methods are Zope objects, and all the nested classes are also Aspect
 objects, you can save an aspect into the ZODB, and load it at a future
 time.  Further, since adding aspects together makes new aspects, you can
 save the combined aspects, so you only have to perform one call to
 transform the aspect into a family of classes.  That still means some
 load-time complexity, however.

Perhaps... but as I see it, pickling the aspect weaving information into
each object makes it harder to vary the aspect weaving after objects
have been created.  I would want to be able to create a portal, add some
content, then change the aspects that apply to the content after it has
been created.  That means that either the objects have a class
definition that references a centralized component or all content
objects have to be re-woven every time you change the centralized
component.

I'm also planning outside the ZODB.  The goal is to design apps using
pure and simple ZODB and not be required to do anything special to make
it work later with other forms of storage.  Other databases will not be
able to store aspect information.

 It would be interesting if you could take an arbitrary Zope service object
 (like a portal), and go to its "Aspects" tab, and add or remove aspects to
 be woven with its class family.  But I suspect it will be a long time
 before I'll have a need for that personally or professionally, as I am
 focused primarily on TransWarp as a CASE tool and Python application
 toolkit at present.

That's actually the kind of functionality we have now, but we're using
subobjects rather than tabs and we achieve many of the things AOP would
give us through simple delegation.  You should check out the CMF as soon
as the beta is released.

Shane

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Announcement: CMF 1.0 beta released

2001-03-06 Thread Tres Seaver

We are pleased to "release version 1.0 beta",
 http://cmf.zope.org/download/CMF-1.0beta of the Zope Content
Management Framework (CMF).

Please review the "release notes":../README.txt and the "known
issues":../ISSUES.txt.

From the README:

  What is the CMF?

The Zope Content Management Framework provides a set of
services and content objects useful for building highly
dynamic, content-oriented portal sites.  As packaged, the
CMF generates a site much like the Zope.org site.  The CMF is
intended to be easily customizable, in terms of both the
types of content used and the policies and services it
provides.

  Resources

* The CMF "dogbowl" site, "http://cmf.zope.org":http://cmf.zope.org.

* The mailing list, [EMAIL PROTECTED]  List information and
  online signup are available at:
  http://lists.zope.org/mailman/listinfo/zope-ptk.  Archives
  of the list are at: http://lists.zope.org/pipermail/zope-ptk.

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Implementing ZPattern: Containment

2001-03-06 Thread Johan Carlsson

 Hi Johan,
 
Have a look at http://www.zope.org/Members/sspickle/DumbZPatternsExample
 
 The best way I've found is to provide a method (or methods) in the 
 Specialist of the contained item to get ids of those instances satisfying certain 
 criteria... 
 
 e.g., getToDoIdsForDoer( aDoer )
 
 (the contained item keeps a reference to the id of its container.)

Thanks Steve,
I like that because the container doesn't know about it's Content,
but how does that comply to the Who I Know pattern?

TIA/Johan
hf–Xš)x7Š^!X+ƒšŠYšŸb~—zhr,š,+3zw(v)EZeŠl†ib3—j)fjŠb?Š^jyw†ib3—j)fjŠb?Š^


[Zope-dev] Re: [Zope-PTK] Announcement: CMF 1.0 beta released

2001-03-06 Thread Johan Carlsson

Tres,
The link to http://cmf.zope.org/Members/jshell/security_info.patch
seems to be broken in the http://cmf.zope.org/download/CMF-1.0beta/README.txt.

Regrads,
Johan Carlsson


 We are pleased to "release version 1.0 beta",
  http://cmf.zope.org/download/CMF-1.0beta of the Zope Content
 Management Framework (CMF).
 
 Please review the "release notes":../README.txt and the "known
 issues":../ISSUES.txt.
 
 From the README:
 
   What is the CMF?
 
 The Zope Content Management Framework provides a set of
 services and content objects useful for building highly
 dynamic, content-oriented portal sites.  As packaged, the
 CMF generates a site much like the Zope.org site.  The CMF is
 intended to be easily customizable, in terms of both the
 types of content used and the policies and services it
 provides.
 
   Resources
 
 * The CMF "dogbowl" site, "http://cmf.zope.org":http://cmf.zope.org.
 
 * The mailing list, [EMAIL PROTECTED]  List information and
   online signup are available at:
   http://lists.zope.org/mailman/listinfo/zope-ptk.  Archives
   of the list are at: http://lists.zope.org/pipermail/zope-ptk.
 
 Tres.
 -- 
 ===
 Tres Seaver[EMAIL PROTECTED]
 Digital Creations "Zope Dealers"   http://www.zope.org
 
 
 ___
 Zope-PTK maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-ptk
 
 See http://www.zope.org/Products/PTK/Tracker for bug reports and feature requests
 
—ƒzšŠYbh:)zŠ†ib3—j)fjŠb?Š^uh(t-j–+-mŠlŠ^?™™–+-Šw:)yzmŠlŠ^?™™–+-Šw:)


[Zope-dev] Attribute providers for Specialists

2001-03-06 Thread Johan Carlsson

Hi,
As I understand it Specialist can't get there attributes from a provider?

For instance, the LoginManager knows about roles and domains,
I would like to get this from attributes but I don't want to be able 
to get them from an attribute provider.
In that way I can make a GUI interface that doesn't know about
the storage, and it could be changes as easy as rewrite my Skinscripts.
Well almost anyway.

So is there a way to get Specialists, and specially LoginManager to 
get there attribute from a provider?

TIA/Johan Carlsson

fŠ^
ëæj)eŠËY¢—ƒzüè¥ê+‚m§ÿåŠËlΊ^¢¸?™¨¥™©ÿ–+-Šwèÿ:)yׯ6‡+¢Ë)¢Ël¢±Ó0·§r‡bž^•«^vX¬¶Èm¶Ÿÿ–+-³:)zŠàþf¢–f§þX¬¶)ߣüè¥æ§ž‹§qèm¶Ÿÿ–+-³:)zŠàþf¢–f§þX¬¶)ߣüè¥