[Zope] Re: how to accumulate data using ZPT
thanks that was creative and justified. BUT it didnt work. the total is still 0. here is what i did. div tal:define=unit_cost python:penalty[0].unit_cost; global sum python:0 tal:condition=not:penaltylen tal:content=unit_cost span tal:define=global sum python:sum+unit_cost/span /div trtd bTotal td b tal:replace=sum/b/td/tr please tip me where I'm going wrong On 5/20/05, Deepak [EMAIL PROTECTED] wrote: Hi Prabuddha, check this ... span tal:define=global sum python:0/ span tal:repeat=item python:here.somesql() span tal:condition=item/var tal:define=global sum python:sum+item.var/ /span span tal:content=sum/ thanks, Deepak prabuddha ray wrote: sorry for delay, but the options you gave are ruled out. actually not all the rows in the column have the values. further the total i'm looking for will result in a very complex query that i dont want to do onsidering the no. of rows are high. I just need something like a var in my ZPT which can just sum up the values if they are present. value's prsence i'm checking using tal:condition but how to add the value repeatedly in the sum var. kindly help. -- Share the vision of difference with ME ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: how to accumulate data using ZPT
sorry for the last mail. it was a simple tag order mistake . final version is : span tal:condition=not:penaltylen tal:content=python:penalty[0].unit_cost/ span tal:define=global sum python:sum+penalty[0].unit_cost/ trtdbTotal tdb tal:content=sum/b/td/tr plz be in touch it'll good for this newbie. thanks again On 5/20/05, prabuddha ray [EMAIL PROTECTED] wrote: thanks that was creative and justified. BUT it didnt work. the total is still 0. here is what i did. div tal:define=unit_cost python:penalty[0].unit_cost; global sum python:0 tal:condition=not:penaltylen tal:content=unit_cost span tal:define=global sum python:sum+unit_cost/span /div trtd bTotal td b tal:replace=sum/b/td/tr please tip me where I'm going wrong On 5/20/05, Deepak [EMAIL PROTECTED] wrote: Hi Prabuddha, check this ... span tal:define=global sum python:0/ span tal:repeat=item python:here.somesql() span tal:condition=item/var tal:define=global sum python:sum+item.var/ /span span tal:content=sum/ thanks, Deepak prabuddha ray wrote: sorry for delay, but the options you gave are ruled out. actually not all the rows in the column have the values. further the total i'm looking for will result in a very complex query that i dont want to do onsidering the no. of rows are high. I just need something like a var in my ZPT which can just sum up the values if they are present. value's prsence i'm checking using tal:condition but how to add the value repeatedly in the sum var. kindly help. -- Share the vision of difference with ME -- Share the vision of difference with ME ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Keyword index search
Dieter Maurer escribió: Garito wrote at 2005-5-20 12:41 +0200: ... I have a ZCatalog object with a keywordindex called keywords I would like to search some objects with keywords ['k1', 'k2', k3', 'k4'] for that I use: return context.catalog({'keywords': {'query': ['k1', 'k2', k3', 'k4'], 'operator': 'and'}}) but these query returns objects with keyword = ['k2', 'k3'] (for me incorrect, I would like to find objects with *all* keywords How can I make these kind of querys? A long standing bug in KeywordIndex... Maybe, you give my Managable KeywordIndex a try (part of ManagableIndex). I cannot promiss you that ManagableIndex is free of bugs but I definitely can promiss you that a bug resulting in wrong search results is fixed much much more quickly than in the Zope core :-) http://www.dieter.handshake.de/pyprojects/zope Hi Dieter! I can't understand the lack of concern you talk about unresolved bugs in Zope It seems Zope is not a serious tool. Imagine you want to buy a car but the seller says: in these model there are a bug on the brake system but I you put these extra no problem How can I convince my customers to use Zope with these kind of searchable information? I think the bigger problem of applications like SO, Application servers and so on are they only think to put more and more funcionality rather that make it's code better and simple Zope has a very good plug-in machinery. Why don't we use it instead of put more and more funcionality? Why I need, for example, five on 2.8 if I don't use it? I know that five is on 2.8 because you need to integrate it on zope to migrate to Z3 but I think its better for all us if zope still remain simple, quickly and bugs free instead of a very big application server with a lot of features and a lot of lines of code (that they can fail) Do you know basecamp? They build simple applications that work del.icio.us? The same rules Flirck? idem, and so on Less is more Thanks a lot PD: sorry but these mail is only an opinion. Zope development team could do what they want, logically -- Mis Cosas http://blogs.sistes.net/Garito/ ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Keyword index search
--On Samstag, 21. Mai 2005 13:29 Uhr +0200 Garito [EMAIL PROTECTED] wrote: A long standing bug in KeywordIndex... Hi Dieter! I can't understand the lack of concern you talk about unresolved bugs in Zope It seems Zope is not a serious tool. Imagine you want to buy a car but the seller says: in these model there are a bug on the brake system but I you put these extra no problem This bug is indeed a very old bug: collector.zope.org/Zope/889 So it is up to *someone* to fix it - this means writing additional tests for the fix. If you volunteer to write additional test then I volunteer to fix the bug. So bugs become fixed as needed. Maybe there was no need to fix this bug so far :-) -aj pgpLGWBLoFaHR.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] ANN: Zope activities at EuroPython 2005, Jun 27-29, Sweden
Hi all. We're planning some Zope activities at the EuroPython conference next month in Sweden: http://www.europython.org/ In short, we have: o The Zope track, with over twenty presentations covering CPS, Silva, Plone, Zope 3, and other Zope topics. o A keynote by Tres Seaver, creator of the CMF. o A closing panel on CMS like last year. o A dedicated Zope Lightning Talks session. o A Z3 ECM sprint just beforehand with hands-on workshops for specific topics. This year has more Zope packed into it than any previous EuroPython conference. Particularly with the recent activities in Z3 ECM, there's lots of don't-miss stuff this year. Please register soon and get involved! More details for each of the items on the agenda. Zope Track -- The Zope Track this year has a spotlight on each of the CMS projects for Zope. Particular focus is given to the work being done with Zope 3. The talk listing is now up-to-date with the accepted talks: http://www.python-in-business.org/ep2005/alisttrack.chtml?track=694 Zope Keynote - In keeping with the emphasis on content management for Zope, the keynote this year will be given by Tres Seaver. Tres is the creator of the CMF, upon which CPS and Plone are based. He will be talking about the impact of Zope 3 and the ongoing work to make a shared CMS layer in the Z3 ECM project: http://www.palladion.com/home/tseaver/obzervationz/europython_2005_invite Z3 ECM Panel - This part is a bit of vapor-talk, as the panelists don't even know about this yet. wink Last year the track ended with a panel discussion in which the leaders of major CMS products for Zope discussed the impact of Zope 3. In particular, could the projects collaborate in a way similar to the CMF? The audience participated quite a bit and Jim Fulton led a very useful discussion. This panel then led to the Z3 Castle Sprint in 2004 and the Paris Sprint several months ago. We now have a project setup for the Z3 ECM effort: http://www.z3lab.org/ This year's panel will be a place for the Z3 ECM team to inform the audience about the shape of the project and solicit feedback about goals and objectives. Tres will be the moderator this year. Zope Lightening Talks -- Following the Faassen Format for lightening talks, this session is meant to be fast, fun, and slightly raucous. Lightening talks allow topics to spring up during the conference and get ten minutes of fame. Z3 ECM Sprint - There are several sprints getting organized at EuroPython. The Z3 ECM team is planning a pretty serious effort to kickstart its activities. The Z3 ECM sprint starts at noon on Thursday, June 23 and goes through Sunday, June 26. Tres Seaver will be the overall sprint leader. Topics include: o Florent Guillaume ([EMAIL PROTECTED]) is leading a session for a Zemantic-based repository, with relations covering versioning, multilingual content, and more. o Julien Anguenot ([EMAIL PROTECTED]) will lead a team working on the the ECM workflow architecture and continue the existing prototype. Discussion about the WfMC standard and the 3 architecture layers (xpdcore/wfmc/ecmworkflow) plus the existing work on the Zope 3 trunk is planned. o Paul Everitt ([EMAIL PROTECTED]) will lead a hands-on workshop for Model-Driven Ajax. This will be a start-to-finish walkthrough of creating dynamic browser applications using XML, JS, and XSLT. Focus will be on a productive workflow for UI development. This workshop starts on Saturday. If you are interested in one of these topics, please contact the the people individually. If you are interested in leading a session, email Paul. --Paul ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Modifying __bases__
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dan Pozmanter wrote: Out of curiosity, I've noticed the word evil attached to patching of various and monkey kinds. Not bad, or unwise, but evil, implying a morality associated with the act. The phrase encodes a bunch of folklore and geek sentiments in a humourous (half in fun but full earnest) meme: - Monkey patching can invalidate documented APIs and behavior; in this sense, a monkey patch is taking out a loan which will be repaid later, either by the original perpetrator or by some other poor schmuck (Vinny's crowbar *hurts*.) - A monkey patch is often a pure expedience: Rather than redo *my* software to correct a problem *I* injected, I'll just bash the base software to work around it. In this mode, it is a sign of poor design or quality in the perpetrator's code. - Sometimes, a monkey patch is the only way to address a particular issue without updating the underlying software (most hotfixes for security issues involve monkey patching). In this mode, the patch is a sign that the underlying software has a bug, hard-wired some policy that it shouldn't have, or is otherwise defective. What is morally wrong with modifying live objects in a dynamic language to achieve desired functionality? The idea is I want to modify the zope core in a way that survives version to version, yet does not impose a specific use case on all zope users. In general, the use case is fine; we would prefer to address it by making the core software more flexible / configurable, such that it is not necessary to monkey patch. Tres. - -- === Tres Seaver [EMAIL PROTECTED] Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCj1B9+gerLs4ltQ4RAmWjAJ97Qvr2xnv5qsCRYC7it4UtHdxvewCg2Zu9 ADCK48Ly7ZMUWbV8E6wS6Q0= =3SS5 -END PGP SIGNATURE- ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] filter_content_type / allowed_content_types query
I am creating a CMF product. It is simple and will only have an id, title, description and the ability to upload its content. I am wanting to restrict the files uploaded to a certain mime type, specifically .txt files (plain text). I see many products like this: 'filter_content_types' : 0, 'allowed_content_types': (), but can't seem to find an example where it is creating this kind of restriction Can I use filter_content_type and allowed_content_types in this context to help restrict the type (or should I do my check on the file type somewhere else (or in addition to something else like discovering the mimetype from a method in the mimetypes registry product))? Regards, David ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] [ANN] TextIndexNG 3.0.1 released
I am pleased to announce the final release of TextIndexNG V 3.0.0. TextIndexNG V 3 is a complete new implementation based on Zope 3 technologies and can be used both in Zope 2.8 or 2.7 (with Five) or in Zope 3. What's new? - multi-field indexing and query support - multi-lingual support - configurable converters (through ZCML) - new indexing API (allowing you to hook your custom content types with TextIndexNG through Zope 3 adapters). Changes since V 3.0.0: - core query options are now available from _apply_index() - new query option 'similarity_ratio' - splitted configuration into Zope 2 and TextIndexNG3 core related configuration files - removed some Zope 2 dependencies from the textindexng package - incorporated some patches by Ivo van der Wijk to integrate TextIndexNG3 as index for Zope 3.1 (requires to uncomment some lines in src/textindexng/configure.zcml) - updated documentation on query syntax and query options (see doc/README.txt) - some more tests Requirements: - Zope 2.8 or Zope 2.7 (+ Five) or Zope 3 (Zope 3 has nothing like catalogs yet) TextIndexNG V3 will *not* run with bare Zope 2.7 installations without Five (and this will not be changed in the future). Download: http://sf.net/projects/textindexng For installation and documentation issues refer to doc/README.txt from the archive. It's basically the same procedure as with former versions except you *need* to recompile the extension modules. Windows binaries of the required extension modules are currently not available (any volunteers?). TextIndexNG V 3 is published under the GPL. Andreas Jung --- - Andreas JungZOPYX Software Development and Consulting - - E-mail: [EMAIL PROTECTED] Web: www.zopyx.com - --- pgpYR7CWNi087.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Keyword index search
Garito wrote at 2005-5-21 13:29 +0200: ... Dieter Maurer escribió: ... A long standing bug in KeywordIndex... Maybe, you give my Managable KeywordIndex a try (part of ManagableIndex). ... I can't understand the lack of concern you talk about unresolved bugs in Zope I am a big Zope user who also files occational bug reports and patches. However, I cannot fix bugs in Zope directly (due to excessive demands with respect to patents, I am not willing to sign the contributors agreement). I am not very concerned about unresolved bugs because: * Zope is open source. I can fix any bug which seriously hampers my work -- not in the public Zope sources but in our sources of Zope. To keep upgrades possible despite local modifications, we maintain Zope in a source code control system (CVS currently). * I am a pragmatist. When I know there is a problem and I know how to avoid it, I just avoid it. Especially, I am no longer concerned with bugs in Zope's indexes since I have ManagableIndex. I believe ManagableIndex it is more flexible, more efficient and has less bugs than the stock Zope indexes. It seems Zope is not a serious tool. Imagine you want to buy a car but the seller says: in these model there are a bug on the brake system but I you put these extra no problem The keyword index bug is far less serious than a bug in the brake system of a car. I think, I wrote about 5 times a long standing bug in the last two to three years. There are apparently not that many people concerned about this bug. How can I convince my customers to use Zope with these kind of searchable information? You tell them that you can fix serious problems yourself because Zope is open source -- if there is not already a fix around (I told you that Managable KeywordIndex does not have this problem). -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] filter_content_type / allowed_content_types query
David Pratt wrote at 2005-5-21 12:36 -0300: I am creating a CMF product. It is simple and will only have an id, title, description and the ability to upload its content. I am wanting to restrict the files uploaded to a certain mime type, specifically .txt files (plain text). I see many products like this: 'filter_content_types' : 0, 'allowed_content_types': (), but can't seem to find an example where it is creating this kind of restriction These are used as defaults for Filter content types and Allowed contents types, respectively, for the type factories (look in portal_types -- sometype). They have nothing to do with MIME types and uploading. Instead, they control what other types can be contained in a folder like type. -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] filter_content_type / allowed_content_types query
Thanks Dieter for clarifying this. I was not sure and could not find anything on these so thought I would ask. I think I got the idea they might restrict mime types from Archetypes which has a similarly named method. Regards, David On Saturday, May 21, 2005, at 03:10 PM, Dieter Maurer wrote: David Pratt wrote at 2005-5-21 12:36 -0300: I am creating a CMF product. It is simple and will only have an id, title, description and the ability to upload its content. I am wanting to restrict the files uploaded to a certain mime type, specifically .txt files (plain text). I see many products like this: 'filter_content_types' : 0, 'allowed_content_types': (), but can't seem to find an example where it is creating this kind of restriction These are used as defaults for Filter content types and Allowed contents types, respectively, for the type factories (look in portal_types -- sometype). They have nothing to do with MIME types and uploading. Instead, they control what other types can be contained in a folder like type. -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )