[Zope-dev] Zope 2.4: Unicode, Berkeley Storage?
I was just reading the Zope 2.4.0 plan on dev.zope.org, and I have two questions: 1. Will Unicode be supported (UTF-8 encoding) for results, posted data, marshaled arguments, etc? 2. Will the BDB storage be standard with 2.4? Transactional Undo sounds _very_ nice. Thanks, -Randy ___ 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] ZEO on SMP
If I understand your scenario, you are trying to run two instances of Zope on a single machine, talking to a ZEO server? That won't work :) Neither Unix nor Windows knows what to do with two processes trying to open the same port for listen. I'm surprised the second Zope instance even starts. If you want to try it, start each instance of Zope on different ports, then use some kind of ipforwarding/load balancer on the box to route connections to port 80 to either of your Zope servers (say 8081 and 8082). -Randy -Original Message- From: Dyon Balding [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 23, 2001 12:08 PM To: Tino Wildenhain Cc: [EMAIL PROTECTED] Subject: Re: [Zope-dev] ZEO on SMP Tino, Thanks for your reply. When you say it works fine on a dual processor machine, are you saying that a single ZEO client fully utilises both processors? or that you are running two ZEO clients successfully? Unfortunately I'm currently stuck with Windows due to both political reasons, and because we are interfacing to a large SQLServer database. -d On Wed, May 23, 2001 at 08:44:59PM +0200, Tino Wildenhain wrote: Hi Dyon, ZEO on a dual processor machine runs fine for me. I'm using redhat-linux for the server (ZEO and Clients on same machine) If you dont need strange things I would not recommend Win2k as server platform. Best regards Tino Wildenhain --On Mittwoch, 23. Mai 2001 11:35 -0700 Dyon Balding [EMAIL PROTECTED] wrote: Hi, We are setting up a cluster of ZEO clients on dual processor machines. From some experiments and from searching through the mailing lists, it appears that a single Zope process will not take full advantage of the two processors. The solution would appear to be to run two ZEO clients on each server. This, however, is causing problems. I can successfully run two Zope (non-ZEO) processes on a single machine, but two ZEO clients don't seem to coexist nicely on the Windows 2000 machine. The second client to start will accept connections, but never responds with anything. Zope: 2.3.2, ZEO: 1.0b3, Windows 2k for clients, Linux and Windows 2k for storage server. Is there a better solution? If not, has anyone come across this problem? Any pointers appreciated -d ___ 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 ) -- Dyon Balding [EMAIL PROTECTED] ___ 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 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] CoreSessionTracking
_.SecurityGetUser() -Randy ___ 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] CoreSessionTracking
The documentation is in lib/python/AccessControl/DTML.py :) From: Chris Withers [mailto:[EMAIL PROTECTED]] dtml-var _.SecurityGetUser().getUserName() as for simplifying _.SecurityGetUser().getUserName(), BasicUser defines __str__ to return getUserName(), so dtml-var SecurityGetUser should result in the same output as dtml-var expr=_.SecurityGetUser().getUserName() -Randy ___ 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] External transaction integration bug?
I may just be missing something obvious here, but it seems like there is a hole in ZODB.Transaction.Transaction.commit and Shared.DC.ZRDB.TM.TM, that can cause external transactions (those that use the TM mixin class, like psycopg) to be abandoned (never get committed or rolled back). Let's say somewhere around line 300 in Transaction.py (the call to j.commit(o, self)) we get an exception. Furthermore, let's say the TM derived database object has already been committed (the only effect of which is to move the DB into the jars mapping, since TM.tpc_begin() and TM.commit() both do nothing). The exception dumps us down to about line 353, where we call _p_jar.abort() on all the uncommitted objects (note: it's important that the database connection isn't in this list, because TM.abort() will rollback the transaction. the way we keep the db out of this list is by having it appear in objects _before_ the object that failed the commit). Next we reach line ~366, where we should "unwind TPC for the jars that began it". What this means is calling tpc_abort() on each jar from the objects that were already committed (which includes the database). However, TM.tpc_abort() does nothing, leaving the external database transaction open. Does this make sense? If this makes sense (i.e. seems bad :), does catching tpc_abort() in TM and calling TM.abort() seem like a valid fix? Thanks, -Randy ___ 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] Custom dtml tag ... parameters not evaluated
Try adding something like this in your render method (haven't tried this, but from a poking around the code in the DocumentTemplate directory in the past this seems about right): import VSEval expr = VSEval.Eval(variable_you_want_to_evaluate) value = expr.eval(md) -Randy -Original Message- From: Romain Slootmaekers [mailto:[EMAIL PROTECTED]] I'm trying to create a custom dtml tag, and after the How-to on this (http://www.zope.org/Members/z113/1) that in itself posed no problem: easy as pie. The problem I'm having with the tag is that parameters are not evaluated. for instance (my tag's name is 'aa') ___ 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] Objects, Roles and Permissions
I haven't worked with this code closely in a few months, but as I recall permissions that are acquired are stored as a list, and those that aren't are stored as a tuple. if type(self._View_Permission) == type(()): # done, this permission isn't acquired above this point Furthermore, I may be missing the point of this thread, but if you are trying to get the list of all roles assigned to a permission (from a python product), you could use this: from AccessControl.PermissionRole import rolesFromPermissionOn roles = rolesFromPermissionOn('View', ob) -Randy -Original Message- From: Danny William Adair [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 7:49 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [Zope-dev] Objects, Roles and Permissions Thank you very much, Richard! Cool! Still... ... Feel free to expand the method to other roles and the full suite of permissions. ... Other *roles*? Roles are what's coming back, isn't it? def viewPermissions(self, acquired=0): ''' walk up the acquisition path to find a _View_Permission attribute... possibly _only_ the acquired permissions. ''' chain = self.aq_chain if acquired: chain = chain[1:] for self in chain: if hasattr(self.aq_base, '_View_Permission'): return self._View_Permission return ['Manager'] "possibly _only_ the acquired permissions" - oops! Your snippet worked fine _if_ the view permission was acquired by that object. As soon as I turned off acquisition for the view permission of the object, it would still give me the acquired roles (that in fact were'nt acquired). What does the "if" statement look like that would return the object's own roles for the View Permission if acquisition was turned off? Naive Danny who doesn't know s... tried to put if hasattr(self.aq_base, '_View_Permission'): return self._View_Permission at the beginning of your code, but no effect. :-( But now I see how to access specific permissions and read their content (do I? I'll experiment with it), thank you very much! I will put a string.replace on top and pass the Permission to examine by string parameter, and call that whole stuff "getAllowedRoles". A "getGrantedPermissions" for examining a role should work similarly, right? def ac_inherited_permissions(self, all=0): set all to 1 and then... iterate through the list (tuple or list? list of tuples?) and check every "_current_Permission" if it contains the role? Thx once again, Danny btw: Isn't return['Manager'] at the end of your code obsolete (but safe)? Or is there anything special going on at the root level (isTopLevelPrincipiaApplicationObject)? ___ 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 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] Transparent Folder bug?
I had that problem a while back but forgot to report it to Mr. Transparent Folders (sorry...) Anyway, this patch to TransparentFoldersPatch.py should fix you right up: def _getattr(self, name): # This is the new ObjectManager.__getattr__(). If an object by the # given ID is not found through the normal mechanisms, we # fall through to here and try to find the object in a # transparent folder. tpids = self._transparent_object_ids if tpids and not self._v_no_transparent and name[:3] != '_p_' and name != '_is_transparent': # The attribute may be accessible through # transparent folders. try: The important bit is adding the term "and name != '_is_transparent': to the if statement. -Randy -Original Message- From: Andy McKay [mailto:[EMAIL PROTECTED]] Sent: Friday, March 23, 2001 4:46 PM To: [EMAIL PROTECTED] Subject: Re: [Zope-dev] Transparent Folder bug? Saying that I can now only reproduce this wierdness under certain circumstances. Id ignore this until I can find a solid example... Sorry -- Andy McKay. - Original Message - From: "Andy McKay" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 23, 2001 4:27 PM Subject: [Zope-dev] Transparent Folder bug? Am I imagining it or do I have a transparent folders bug? It would seem that transparent folders adds an extra namespace to my objects and it searches through sub folders eg: Folder X: Document Foo. In the root with transparent folders i can happily call dtml-var Foo when I should not have this in my namespace. Without transparent folders I get a KeyError (which I should). With I get X/Foo rendered even though X is not transparent. My only caveat here is that every test with transparent folders is Zope 2.3, where as without im using 2.1.6. Cheers. -- Andy McKay. ___ 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 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 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] Zope 2.3.0 AccessControl/SecurityInfo.py
Sorry if these have already been fixed in 2.3.1, I haven't had time to upgrade yet. I fixed a small bug in SecurityInfo that made SecurityInfo.setPermissionDefault() impossible to use: 191c191 self.roles[permission_name] = rdict.keys() --- self.roles[permission_name] = rdict def setPermissionDefault(self, permission_name, roles): """Declare default roles for a permission""" rdict = {} for role in roles: rdict[role] = 1 if self.roles.get(permission_name, rdict) != rdict: LOG('SecurityInfo', WARNING, 'Conflicting default role' 'declarations for permission "%s"' % permission_name) self._warnings = 1 self.roles[permission_name] = rdict.keys() My other problem was that I wanted to setup some default permissions that are used programatically in my product (i.e. they aren't used to protect any specific methods, but the methods themselves check for the permission.) A small change to ClassSecurityInfo.apply() allows you to call SecurityInfo.setPermissionDefault() to create new permissions, even if they aren't attached to any methods: 239a240,242 for permission_name in self.roles.keys(): if not ac_permissions.has_key(permission_name): ac_permissions[permission_name] = () def apply(self, classobj): """Apply security information to the given class object.""" dict = classobj.__dict__ # Check the class for an existing __ac_permissions__ and # incorporate that if present to support older classes or # classes that haven't fully switched to using SecurityInfo. if dict.has_key('__ac_permissions__'): for item in dict['__ac_permissions__']: permission_name = item[0] self._setaccess(item[1], permission_name) if len(item) 2: self.setDefaultRoles(permission_name, item[2]) # Set __roles__ for attributes declared public or private. # Collect protected attribute names in ac_permissions. ac_permissions = {} for name, access in self.names.items(): if access in (ACCESS_PRIVATE, ACCESS_PUBLIC, ACCESS_NONE): dict['%s__roles__' % name] = access else: if not ac_permissions.has_key(access): ac_permissions[access] = [] ac_permissions[access].append(name) # Now transform our nested dict structure into the nested tuple # structure expected of __ac_permissions__ attributes and set # it on the class object. getRoles = self.roles.get __ac_permissions__ = [] for permission_name in self.roles.keys(): if not ac_permissions.has_key(permission_name): ac_permissions[permission_name] = () permissions = ac_permissions.items() permissions.sort() for permission_name, names in permissions: roles = getRoles(permission_name, ()) if len(roles): entry = (permission_name, tuple(names), tuple(roles)) else: entry = (permission_name, tuple(names)) __ac_permissions__.append(entry) dict['__ac_permissions__'] = tuple(__ac_permissions__) # Take care of default attribute access policy access = getattr(self, 'access', _marker) if access is not _marker: dict['__allow_access_to_unprotected_subobjects__'] = access if getattr(self, '_warnings', None): LOG('SecurityInfo', WARNING, 'Class "%s" had conflicting ' 'security declarations' % classobj.__name__) -Randy ___ 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] Calling Catalog from python script
What's wrong with AbstractCatalogBrain.getObject()? Doesn't that work? -Randy -Original Message- From: Casey Duncan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 14, 2001 3:45 PM To: R. David Murray; [EMAIL PROTECTED] Subject: Re: [Zope-dev] Calling Catalog from python script "R. David Murray" wrote: I'll probably figure this out as soon as I post like last time, but I've been staring at it and can't see my mistake. The following code returns a list of None's: objs = [] for catent in container.Catalog(context.REQUEST): objs.append(container.Catalog.getobject(catent.data_record_id_)) return objs I've checked, and catent is a mybrains instance and catent.data_record_id_ has an increasing number as its value. So why doesn't this work? Also, and this is a better reason for posting this to zope-dev than asking for help is grin: why can't I say catent.getobject() That would seem to be a lot more OOish. This is under Zope-2.3.0, by the way. --RDM That code looks pretty good to me. Did you try updating the Catalog? Also, what happens if just append catent. Do you get something other than None then? I would assume so, but it might help to see exactly what the meta data is to identify the objects it "should" return. I agree that getobject should be a method of the result item, although implementing it might be a bit tricky to do. I looked into that a while back. Perhaps I should take another look at that... -- | Casey Duncan | Kaivo, Inc. | [EMAIL PROTECTED] `-- ___ 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 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] Zope server dies with Netscape's FTP
Are you starting zope with ./start, or otherwise including -D when z2.py is executed? That will cause Zope to try to write to the terminal when an FTP connection is made. Since the terminal is gone, Zope dies. -Randy -Original Message- From: Pablo Bleyer Kocik [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 04, 2001 7:41 AM To: zope-dev Subject: Re: [Zope-dev] Zope server dies with Netscape's FTP Chris Withers wrote: Pablo Bleyer Kocik wrote: I am running Zope 2.3.0 under Linux in a remote machine. When I try to access Medusa through FTP (port 8021) using Netscape 4.5 under Windows, Zope dies silently. Is this a known issue? How can I trace what is happening to Zope's FTP server causing it to die? Stick it in the collector: classic.zope.org:8080/Collector (it's down at the moment :-( ) cheers, Chris Yep, I was going to do that. However I wanted to track the bug a little more. The problem is not with Netscape; through plain vanilla FTP utility I get the same situation. But now comes the nice part: If I login to the machine and restart Zope then, *without* leaving the shell prompt, the FTP access works fine. I get the access and success login notices in the screen. If I logout and I try to login with ftp again, Zope RIPs ;^/ Cheers! -- Pablo Bleyer Kocik | pbleyer|"Rintrah roars shakes his fires in the burdend air; @embedded.cl | Hungry clouds swag on the deep" - William Blake ___ 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 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] CoreSessionTracking and ConflictError
I've been porting my product from my own private session manager to use CoreSessionTracking 0.6, and am having a problem with lots of conflict errors. I've got a session_id_mgr in the root, configured as per defaults, and a session_data_mgr also in the root, using the RAM base container. Then I have a simple DTML method: dtml-let session="session_data_mgr.getSessionData()" dtml-let title=title dtml-call expr="session.set('title', title)" dtml-in expr="_.range(100)" dtml-in expr="_.range(100)" /dtml-in /dtml-in /dtml-let /dtml-let Test If I goto this URL in a browser, it works fine, displaying "Test", with no ConflictError in my debug listing. Then I quickly press Refresh twice in my browser. This results in the page "Test", and a ConflictError in my log (as I expected). After that, any request that uses the session data (even without a set) results in a ConflictError: dtml-let session="session_data_mgr.getSessionData()" Title: dtml-var expr="session.get('title')" /dtml-let Any ideas why this is happening? -Randy ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] ZMySQLDA problems after upgrade
You will get 0 rows if you use max_rows=0. -Randy -Original Message- From: Ron Bickers [mailto:[EMAIL PROTECTED]] Sent: Friday, January 26, 2001 10:05 AM To: Ron Bickers; Andy Dustman; Randall F. Kern Cc: [EMAIL PROTECTED] Subject: RE: [Zope] ZMySQLDA problems after upgrade -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Ron Bickers Sent: Friday, January 26, 2001 11:28 AM To: Andy Dustman; Randall F. Kern Cc: [EMAIL PROTECTED] Subject: RE: [Zope] ZMySQLDA problems after upgrade How about excluding the automatic LIMIT clause if max_rows is set to 0? Would that confuse people? Oh! It already does that. So if you want to make your own LIMIT clause, just set max_rows to 0. Correct me, Andy, if this is a bad thing. ___ Ron Bickers Logic Etc, Inc. [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] if-else using ZSQL resultset sendmail query
dtml-in ... dtml-if sequence-even bgcolor is white ... dtml-else bgcolor is grey ... /dtml-if /dtml-in If you really need the "resultset number", you can use sequence-number. As for dtml-sendmail and news, it only sends mail via SMTP, so it can't be used to post news. -Randy -Original Message- From: Lee [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 20, 2001 1:48 PM To: [EMAIL PROTECTED] Subject: [Zope] if-else using ZSQL resultset sendmail query Hi, I've got a few questions, which may be answered by saying, "Not possible"! Any feedback would be appreciated. get_testclass_details is a ZSQL method returning user data from a table. I display the data (strangely enough) in an HTML table and I want alternating rows to have different background colours. I figure that the best way to do this is to obtain the resultset number (i.e. is it the 1st, 2nd or 3rd result row) and do something like the following; dtml-in... if (the result set number % 2 == 0) bgcolour is white ... else bgcolour is grey ... /dtml-in... Is it possible to obtain the resultset number? Also, re: sendmail. I still haven't managed to figure out why it's not posting messages to newsgroups. Maybe some folks at digicool could let me know if this isn't supported? Previous message was: I have another question re: sendmail, which I'd be grateful if someone could answer. Am I correct in saying that sendmail does not support newsgroup postings? Adding the following to my message seems to work but it is not being posted on the newsgroup... To: [EMAIL PROTECTED] Groups: uk.local.glasgow *and* Newsroups: uk.local.glasgow It sends the mail to me; the group is listed in the header file under 'Newsgroups' when I view *my* received message but it is not getting to the newsgroup. Can anyone comment? Thanks very much for your time, - Best regards, Lee ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] renaming python input params in DTML
You can't use DTML tags inside an expr="" attribute; the value of expr is python code. To access the sequence-item variable from python, you need: _['sequence-item'] So, try something like this (untested): dtml-in expr="REQUEST.form.items()" dtml-in expr="testSQL(text=_['sequence-key'] + 'x' + _['sequence-item'])" dtml-var result /dtml-in/dtml-in -Randy -Original Message- From: Lee [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 14, 2001 1:23 PM To: [EMAIL PROTECTED] Subject: [Zope] renaming python input params in DTML Hi, I am having a problem passing in a variable to a Python method, which is obtained from the REQUEST object - I'd really appreciate someone's insight into how to correctly go about this. I have a form that submits a parameter named '9728430xp0xclasstest' with a value = 7 to a DTML method. I have a Python method expecting 'text' as a parameter so I want the DTML method to send 'text' onto this with a value = the value of the original parameter appended to name (i.e. 9728430xp0xclasstestx7). So text=9728430xp0xclasstestx7 Does that make sense? The Python method, testSQL, returns 'result'. As I recently found out, I have to make to make use of the REQUEST object to obtain these parameters. The following snippet produces the correct value (9728430xp0xclasstestx7)... dtml-in expr="REQUEST.form.items()"dtml-var sequence-keyxdtml-var sequence-item/dtml-in ... but how can I can pass this as 'text' to my Python method? Am I on the right track with the following: dtml-in expr="REQUEST.form.items()" dtml-in expr="testSQL(text='dtml-var sequence-keyxdtml-var sequence-item')" dtml-var result /dtml-in/dtml-in Thank very much for any help you can offer. - Best regards, PS: dtml-let text="'9728430xp0xclasstestx7'" dtml-var text /dtml-let ... may help but... dtml-var standard_html_header dtml-in expr="REQUEST.form.items()" dtml-let text="'dtml-var sequence-keyxdtml-var sequence-item'" dtml-var text /dtml-let /dtml-in ... gives me text = x ! Any help would really be appreciated? Thanks :) -- Lee Reilly mailto:[EMAIL PROTECTED] ```` HAVE SKILLS; WILL TRAVEL. I'm currently looking for an internship in the USA in the field of web development. Ideally, I'm looking for a placement for 3 to 18 months. Can you help? More details, my resume, etc. @ http://homepages.strath.ac.uk/~aeu97172/ /shameless plug ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] hasRole bug or feature in 2.2.?
From: Ron Bickers [mailto:[EMAIL PROTECTED]] If this is true, it explains clearly Zope's behavior. It's really a browser "feature" and not a Zope issue at all. Yes, that's the problem. My solution is to use a custom UserFolder, which sets a temporary cookie when a normal HTTP login is accepted. This cookie is then used for further validation. The class I use is rather complex, providing persistent login in addition to these features, and randomly re-creating the cookie so one can't easily spoof a user, but this simple class will get you going: class UserFolder(AccessControl.User.BasicUserFolder): def validate(self, request, auth='', roles=None): user = AccessControl.User.BasicUserFolder.validate(self, request, auth, roles) if user is AccessControl.User.nobody or user is None: if request.cookies.has_key('login'): user = self.getUser(request.cookies['login']) else: request.response.setCookie('login', user.getUserName(), path='/') return user -Randy ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Using a multiple_selection property in a product
Try this: _properties = ( {'id':'classdays', 'type':'multiple selection','mode':'w', 'select_variable': 'days'}, ...) days = ( 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday' ) -Randy -Original Message- From: Ronald L. Roeber [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 03, 2001 2:48 PM To: [EMAIL PROTECTED] Subject: [Zope] Using a multiple_selection property in a product I am attempting to build a product that will contain some unique information and access control for services in support of college classes. Many, many things are going well...better than expected. However I am having problems getting the product to correctly recognize a multiple selection property. The property is the days of the week that the course is offered. ( Monday-Wednesday-Friday or Tuesday-Thursday, or any combination thereof) The DTML for the product creation form contains the following: --- th align="LEFT" valign="TOP"emDays Course Offered/em/th td align="LEFT" valign="TOP" select name="classdays:multiple_selection" size=5 multiple option value="Monday"Monday/option option value="Tuesday"Tuesday/option option value="Wednesday"Wednesday/option option value="Thursday"Thursday/option option value="Friday"Friday/option /select in the product class I have tried two tactics (actually more but I'll confess to only these two) _properties( {'id':'classdays', 'type':'multiple_selection','mode':'w'}, ... RESULT: product installs, but classdays in an "unknown property type" so I try this: _properties( {'id':'classdays', 'type':'multiple selection','mode':'w'}, ... RESULT: product installs, however the Properties are unavailable, furthermore trying to view the properties by clicking on the Properties tab generates the following Zope error: Error Type: NameError Error Value: select_variable [somewhat helpful troubleshooting suggestions] Traceback (innermost last): File /home/Zope-2.3.0a1-src/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /home/Zope-2.3.0a1-src/lib/python/ZPublisher/Publish.py, line 187, in publish File /home/Zope-2.3.0a1-src/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /home/Zope-2.3.0a1-src/lib/python/ZPublisher/Publish.py, line 171, in publish File /home/Zope-2.3.0a1-src/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_propertiesForm) File /home/Zope-2.3.0a1-src/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: manage_propertiesForm) File /home/Zope-2.3.0a1-src/lib/python/App/special_dtml.py, line 120, in __call__ (Object: manage_propertiesForm) (Info: /home/Zope-2.3.0a1-src/lib/python/OFS/properties.dtml) File /home/Zope-2.3.0a1-src/lib/python/DocumentTemplate/DT_String.py, line 528, in __call__ (Object: manage_propertiesForm) File /home/Zope-2.3.0a1-src/lib/python/DocumentTemplate/DT_In.py, line 691, in renderwob (Object: propertyMap) File /home/Zope-2.3.0a1-src/lib/python/DocumentTemplate/DT_Util.py, line 337, in eval (Object: hasProperty(select_variable)) (Info: hasProperty) File string, line 0, in ? NameError: (see above) - I've also tried to use :list with much less success. Any helpful suggestions would be appreciated. The solution is not obvious to me. TIA... Ron Roeber University of Nebraska ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] RE: New install - no management screen? (resolved)
I realize you've already worked around this problem, but I've seen this on some installations of IE. The solution I've found is to delete all cookies from the client. -Randy -Original Message- From: Glenn Gillis [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 31, 2000 8:57 AM To: [EMAIL PROTECTED] Subject: [Zope] RE: New install - no management screen? (resolved) Thanks for the suggestions. It turns out to have been an Internet Explorer thing. I pulled the site up in Netscape and everything works fine. I was on IE 5.01 SP1, upgrading to 5.5 SP1 seems to have resolved the problem. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] custom __of__
This is something that I still don't quite understand. I have a set of (python, Folder derived) objects, which are children of a Folder derived python class. Each of these in turn has another, related python object. / a ab1 ab2 ab3 b1 b2 b3 When I access /a/ab1, I want b1 inserted into the acquisition hierarchy between a and ab1. I've done this with __bobo_traverse__, but that doesn't help when you access ab1 as an attribute of a, such as when using objectValues(). So I thought I would try overriding __of__, like so in the ab class: def __of__(self, parent): wparent = self._b.__of__(parent) return Folder.Folder.__of__(self, wparent) But that doesn't work, I get this error on the return line: Error Type: TypeError Error Value: unbound C method must be called with Acquirer 1st argument Any ideas? I'm pretty confused. Thanks, -Randy ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )