Re: [Zope] Design Question
Tim Cook wrote: > > Anyway I pickled the dictionary and it's just over 1.3MB so I > thought I'd use an external method to read the pickled object, > pass it the paragraph and test for the correct code(s), then > return a list. Is this the most effective way to use Python/Zope > for this situation? > Adding to my own post: I did play around with shelving but did not see that there was much of an increase in speed. The real estate requirement went up to 8MB+. Thinking outloud again... I think I'll take the original comma delimited file. Get all words and remove the common ones (the, of, and, etc) Find every line where each particular word appears. Store those codes in a dictionary with the word as the key. (Basically, I'm turning the file around backwards I guess?) Then for every keyword hit from the paragraph I'll have a list of codes that I can count the nmber of positive hits on each code. Hmm, sounds like a search engine to me. Anybody got one written in Python . That's faster than a Zope Catalog? -- Tim Cook -- Cook Information Systems | Office: (901) 884-4126 8am-5pm CDT * Specializing in Open Source Business Systems * FreePM Project Coordinator http://www.freepm.org OSHCA Founding Supporter http://www.oshca.org ___ 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] PTK/LoginManager/Membership - configuring User Sources
I am currently (one of many probably) inching along towards getting PTK/LoginManager/Membership working and wondered if somebody could point me in the right direction to get the pieces working together. I have installed the PTK, made a portal. I then replaced the acl_users in the portal directory with a loginmanager. Then I added a Portal Membership System, which seemed to replace a bunch of methods and added a bunch of new ones. Looking at my portal [http://entity.ummu.umich.edu:8080/portal] I now get the nice login dialog when I login but it doesn't work. I figure I most likely need to install a usersource. >From this howto [http://www.zope.org/Members/jok/SQL_based_LoginManager] I stole some methods that seem to be the sort of thing I would need to link the login process to a database (in my case a MySQL user table). I put them, as listed below, into my persistant user source. But I am not sure how to link these new methods in my usersource back to my login form. Here is the list of contents from my usersource : MySQL_database_connection (Z MySQL Database Connection) SQL_change_password SQL_check_user SQL_get_password SQL_get_roles userAuthenticate userExists userRoles I have no idea whether these are the correct method names that the loginmanager is looking for to authenticate. Does anyone have any pointers on this ? Also I now have 2 login forms - one in the root of the portal folder and the other in the acl_users folder. Which is the one that I need to edit ? I say edit because I see this line in both of them : 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] Design Question
>From a performance standpoint I'd like to know how to best implement this. Speed is important: I have a comma delimited file that I imported into a (Python) dictionary. This may not be the best way to do this though. Maybe just nested lists would be better? The comma delimited file will only need to be updated annually. So it's pretty static. Original line from file: 1234, This list describes this code My decidely backwards dictionary: {1234: ['This','list', 'describes', 'this', 'code']} I have a set of codes 2 - 6 characters long. A string of varying lengths (usually 3 - 10 words) describe the code. I will need to take a paragraph of text and determine the most appropriate code based on key words from the paragraph that match up to code descriptions. I was going to do this in DTML but 15,000+ codes (even using a BTree folder) is painfully slow. Anyway I pickled the dictionary and it's just over 1.3MB so I thought I'd use an external method to read the pickled object, pass it the paragraph and test for the correct code(s), then return a list. Is this the most effective way to use Python/Zope for this situation? Thanks, -- Tim Cook -- Cook Information Systems | Office: (901) 884-4126 8am-5pm CDT * Specializing in Open Source Business Systems * FreePM Project Coordinator http://www.freepm.org OSHCA Founding Supporter http://www.oshca.org ___ 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] Bizarre bug - "floating" ZClasses
Lalo Martins wrote: > On top of that, I tried to install the Product and it gives me > a "Duplicate Class Ids" error... I don't know if this is the same issue I experienced. But, look in the Products directory and see if they were actaully deleted. I had some that were not. I had to manually delete them. > It's been a while since I've been so puzzled and impressed by a > bug :-) Impressive. Isn't it? -- Tim Cook -- Cook Information Systems | Office: (901) 884-4126 8am-5pm CDT * Specializing in Open Source Business Systems * FreePM Project Coordinator http://www.freepm.org OSHCA Founding Supporter http://www.oshca.org ___ 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] Dynamically render DTML?
Kapil Thangavelu wrote: > > "Mark N. Gibson" wrote: > > > > Is it possible to return dtml from python, and have it rendered correctly > > on the page? > > > > for example, the python might look like this... > > > > def get_header(somevar=1): > > if somevar==1: > >return '' > > else: > >return '' > > > > The dtml document in the zodb might look like this... > > > > > >Body text > > > > > > When this gets rendered, it's as if the dtml document had > > in place of the get_header call. > > > if you want to achieve this result from python you can evaluate/call the > standard_html_header in python and return the resultant string. see the > arguements for DTMLMethod in the /lib/python/OFS folder for exact > syntax. to clarify on the python solutions, the options that i see are either 1. calling the dtml method. if you have a reference to the method than you call it directly. something like return standard_html_header() refer to lib/python/OFS/DTMLMethod.py for calling syntax & args 2. evalutate an arbitrary dtml string ala '', something like return HTML('')() refer to lib/python/OFS/DocumentTemplate/ for exact syntax && args. ___ 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] Bizarre bug - "floating" ZClasses
I finally went to upgrade our production machine (the one which runs cosmetica.com.br and hackandroll.org) to Zope 2.2. When I did (and after upgrading SiteAccess and updating its objects with the provided script), BannerFolders and BannerAds stopped working. So, I went to the Control Panel and deleted the product, to install the newer version. Before that, Zope was restarted, and suddenly the Banner objects started functioning normally - with their Product missing! On top of that, I tried to install the Product and it gives me a "Duplicate Class Ids" error... It's been a while since I've been so puzzled and impressed by a bug :-) []s, |alo + -- Hack and Roll ( http://www.hackandroll.org ) News for, uh, whatever it is that we are. http://zope.gf.com.br/lalo mailto:[EMAIL PROTECTED] pgp key: http://zope.gf.com.br/lalo/pessoal/pgp Brazil of Darkness (RPG)--- http://zope.gf.com.br/BroDar ___ 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] test
ignore this -- - Matthew Burleigh - Systems Administrator, Digital Creations - publishers of Zope. - (888)344-4332 -- http://www.digicool.com - http://www.zope.org ___ 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] string to list?
Hello, I have a Z SQL method which returns me a string like {{"a"},{"b"},{"c"}} Is there anyway I can write a dtml-in loop to pick out each element from the string? I want to be able to do something like: , and that should give me "a,b,c". Is this possible? Or do I need to write an external python method to return a list["a", "b", "c"] given the string above? Thanks! nitesh ___ 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] looking for developers on a project !
hi , our company is looking to customize the current zope software into a particular e-commerce solution. if you would like to participate in this project please let us know. you can respond to this email or call 412-401-9510 thanks! jake sacks ___ 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] Dynamically render DTML?
"Mark N. Gibson" wrote: > > Is it possible to return dtml from python, and have it rendered correctly > on the page? > > for example, the python might look like this... > > def get_header(somevar=1): > if somevar==1: >return '' > else: >return '' > > The dtml document in the zodb might look like this... > > >Body text > > > When this gets rendered, it's as if the dtml document had > in place of the get_header call. > to have your example work would require multiple or nested passes of the dtml-evalutation machinery. so no you can't return a string containing dtml and expect it to be evalutated. the machinery expects you to return a string or value (for dtml-var) to which it will apply formatting rules. on the web the evalutation machinery automatically calls (possibly nested) dtml tags, so this is not a concern, but again it only performs the evaluation once. if you want to achieve this result from python you can evaluate/call the standard_html_header in python and return the resultant string. see the arguements for DTMLMethod in the /lib/python/OFS folder for exact syntax. doing it from a dtml method would be easier assuming it fits the usage. Cheers Kapil > I understand how to call external methods from dtml, etc. I just want > to know if it's possible to get the string returned rendered as dtml. > > Mark > > --- > Mark Gibson > Kaivo, Inc. > www.kaivo.com > > ___ > 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] Python Methods 0.1.7 under Zope 2.2.1
Working with Zope 2.2.1 (in two distinct servers), I noticed the following behaviour with (0.1.7) Python methods (created under Manager role): 1. Apparently anyone (non-authenticated users) can successfully run the methods even if these include operations (folder/file/user creation, etc.) for which the invoking user has no permission. 2. Although I am able to give Python methods the proxy role of Manager, I can not give them other proxy roles, roles which I also have and am able to give to DTML methods, for instance (anyway, problem 1 makes privileged proxy roles superfluous... :) ). Has anyone fixed this (while we wait for the new shiny Python methods)? Best regards & thanks in advance J Esteves -- jmce: +351 919838775 ~ http://artenumerica.com/ ~ http://artenumerica.org/ ___ 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] ODP / Zope / Zexp / Python ++
Hi there.. Trying to import the ODP browser thingie from the Oedipus project ( http://oedipus.sourceforge.net/ ) .. but are having some problems.. the error is pasted beneath! Zope Error Zope has encountered an error while publishing this resource. Error Type: SystemError Error Value: Failed to import class _ZClass_for_ODPDA from module Products.ODPDA . . . Traceback (innermost last): File /www1/zope/-Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /www1/zope/-Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, line 179, in publish File /www1/zope/-Zope-2.1.6-linux2-x86/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: ApplicationDefaultPermissions) File /www1/zope/-Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, line 165, in publish File /www1/zope/-Zope-2.1.6-linux2-x86/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_importObject) File /www1/zope/-Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: manage_importObject) File /www1/zope/-Zope-2.1.6-linux2-x86/lib/python/OFS/ObjectManager.py, line 484, in manage_importObject (Object: ApplicationDefaultPermissions) File /www1/zope/-Zope-2.1.6-linux2-x86/lib/python/ZODB/ExportImport.py, line 284, in importFile SystemError: (see above) Have anyone else tried this with success .. and could give me som hints as to how I can get this to work. I really would like to look into this.. Have a real nice day! kindest, Jørgen Skogstad ___ 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 )