[Zope] Unquoting a string.
Hi, I am trying to pass a column id through a ZMySQL method call. The thing looks like this: UPDATE venapoll SET dtml-sqlvar resp type=string = last_insert_id(+1) WHERE poll_num = 3; where resp is a value passed in by a dtml method and can have the value of resp0, resp1, resp3, etc. These are the names of columns. Zope is blowing chuncks, because the parsed call is actually: SET 'resp1' = last_insert_id(+1) and ZMySQL needs to have the value passed in as SET resp1 = . . . (i.e., without the quotes). Has anyone had a problem with this? TIA. ciao! greg. Gregory Haley venaca.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 )
Re: [Zope] Unquoting a string.
Hi, Yes, I had tried that, but, I had some little a syntax problem that was causing zope to throw an error, and I thought it was because it didn't like the use of dtml-var in an sql call. From the advice here, and in a second response, I looked more closely at the error message and discovered the syntax error. : ( Thanks for helping out here. ciao! greg. Gregory Haley venaca.com Greg, Have you tried using just dtml-var instead of dtml-sqlvar? The sqlvar version I think automatically adds the quotation marks. --Aaron Williamson ___ 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] MySQLDA Won't build
Hi, I'm not sure if you are having the same problem, but when we built MySQLDA, I found that there are some lines in one of the configure files that need to be fixed. Did you save the compile log? (Sorry, but I cannot recall the exact file that has the problems), but there are three places where there is an in the middle of a line that is trying to act in the C like addressing, but there is no address there. A second problem we had, is that after fixing these lines this did not build on redhat but did fine under informix (???). we had to move the .so file by hand, and it works ok. I have been having trouble getting any of the various MySQL modules (either for zope or for python) to build on RedHat -- I'm growing increasingly impatient with redhat it seems to be getting more microsoftish with each new release. ciao! greg. Gregory Haley venaca.com Darin Lee wrote: Help, I cannot get the MySQL Database Adaptor to build. Error: gcc -shared _mysqlmodule.o -L/usr/local/lib/mysql -o _mysqlmodule.so Whoa, couldn't import _mysql: ./_mysqlmodule.so: undefined symbol: mysql_store_result Probably _mysqlmodule.so didn't compile correctly. Or your library paths may be bad. Check the FAQ. I checked the faq (also downloaded and compiled lastest versions - MySQL, Python, and Zope from source) - nada. I've set LD_LIBRARY_CONFIG, I've also edited the "Setup.in" file many, many times. No joy (My MySQL is in /usr/local). System is Redhat 6.1 - Intel... Any idea on what could be wrong?? Thanks, -Darin 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 )
Re: [Zope] Re: low level HTML in Zope
Hi folks, I wholeheartedly agree that one should learn handcoded html, if only in order to be able to clean up what the html editors do that you want to customize. I have found that it is possible to write very complex files with code warrior or dreamweaver. From the zope interface, you can import a dtml document, and pull up the edited file into zope. When you try to submit the 'change' command, the zope parser will throw out any errors, etc. ciao! greg. Gregory Haley venaca.com Anser wrote: "Henny van der Linde" [EMAIL PROTECTED] wrote: ...Zope forces you often to go to nitty gritty details of HTML programming. I think that's a good thing (for me). GUI tools tend to make you very lazy and often produce horrible HTML (for example Frontpage). Today's best WYSIWYG editors produce excellent HTML, including Dreamweaver and Allaire Homesite. (There should be a rule that nothing is every usefully compared to the hideous Frontpage.) Zope's text box interfaces do encourage you to mess with low level HTML, but there is no help or verification that you actually know what you're doing. Learning raw HTML is fun and can be useful, but if you program that way, you should always follow up with a *validator* like CSE HTML Validator or a recent build of Weblint. You will find errors! And errors do matter! ___ 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] trailing whitespace optimization
Hi Paul, You're right about the size of files with trailing blanks. I had a file of over 1 meg yesterday, and when I striped all the blanks it was only 47K, pretty radical reduction. There is an external Python method that is part of the zope Extenions library, it should be in something called /opt/zope/Extensions/ called strip_blanks.py. You can attach it to your zope session, then it is called via: dtml-var "strip_blank(varName)[:-1]" This will at least strip all the trailing blanks from an individual variable. ciao! greg. Gregory Haley venaca.com Paul Abrams wrote: I'm noticing that our file sizes could be reduced by 10% or more by trimming trailing whitespace. Is there a way to get Zope to do that automatically? It would be best if Zope did it whenever a method was saved. Thanks in advance, -Paul __ Do You Yahoo!? Get Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.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 )
Re: [Zope] Aligning Images With Text
Terry Babbey wrote: Here is my code: dtml-if "_[ProgCode + 'PIC']" dtml-var "_[ProgCode + 'PIC']" /dtml-if You might create a dtml variable with a dtml call, e.g., dtml-call "REQUEST.set('image1', _[ProgCode + 'PIC']" Then use your image html tag as img src="dtml-var image1" align="right" ciao! greg. What I would like to do is align the picture to the right of my web page. If I was programming html I would do it like this: img src=T043PIC align=right Any help? Terry -- __ Terry Babbey Technical Support Specialist Lambton College, Sarnia, Ontario, Canada __ ___ 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] two problems.
hi folks, the first of these should be as simple to solve as anything, but i cannot figure it out. the second may be more complicated, and perhaps there is a good tutorial on it that someone could point out to me (though i did not find exactly what i am looking for in the zope list of how-to's, etc.) 1. i am exploring using zope 2.2 on my local machine, the installation went fine, but now when i try to create anything from superuser, i get an error that says: Error Type: SuperCannotOwn Error Value: Objects cannot be owned by superuser what am i doing wrong here. (this of course runs completely counterintuitive from my unix experience, where superuser can do anything anywhere). i was folloing the steps outlined in the "A first zope site" How-to, and still did not get this to work. 2. on a website we are developing, we can log in as a user, and get AUTHENTICATE_USER to authenticate fine, but when we log out and log in as a new user, the content remains that of the original user. we are using a combination of UserDb to store users, acl_user, and a MySQL database to store user folder content information. the zope documentation still seems fairly sketchy as to how the whole authentication process works, and i have seen many questions posted about this. tia. ciao! greg. Gregory Haley venaca.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 )
Re: [Zope] FAQ Wiki and What happend @ O'Reilly Conference
Fiona, Just looked at the zope.faqts.com site and think it looks like a good start. I have only recently started using zope, and I have been amazed at the steepness of the learning curve. Sometimes it feels like a solid and very vertical wall! There have been many times when a good faqts file would have been really useful. Thanks for your contribution. ciao! greg. Gregory Haley venaca.com Fiona Czuczman wrote: Hi Alan, A couple of weeks ago I wrote to the list regarding setting up a FAQ for zope. It is in the beginning stages - http://zope.faqts.com I've been busy so have only got so far as adding 11 questions. Take a look at http://python.faqts.com to get an idea on how the zope knowledge base could be developed, it has taken me two months to get the python knowledge base to the level it is at now, more than 700 questions with answers. I'm developing the python list be summarizing the newsgroup daily, for zope I'm intending on also working on this daily. I had a major project which I finished about 2 hours ago :-) ... as a relief I decided to start on the zope work, where I've found your mail. I'm not interested in creating something in direct opposition to what you are suggesting. Is there some way that we could work on this together, either together creating zope.faqts.com or my helping with http://www.zope.org/Members/runyaga/ZopeFAQs/FrontPage ? Things I like about FAQTs - the hierarchy of folders (information) - the ability to create folders and arrange content - the possibility to edit answers and maintain a version history - the admin stuff (for sending out summaries back to the mailing list) - ability to search questions and answers (works really well) This work I am doing 'off my own bat', FAQTs does pay me for python but _not_ zope, so I am able to do it somewhere else. Because I already have a mode of working off the FAQTs site it seemed reasonable to start the zope knowledge base off that site. But, mails like yours make me think about fragmenting resources and how useless that is, especially now when it seems resources are limited. Now, before I get too far into it, I want to make sure I've made the right decision... I don't want to compete with zdp.zope.org or with what you are suggesting. So, I want to help but where? Could we help each other: share questions and answers for all locations? Therefore taking advantage of the different features of the different sites? Is that a ridiculous suggestion? Perhaps initially it would work ... later re-assess? Otherwise, I'll work off whichever site the community would prefer... so community, please respond :-) Thanks, Fiona ___ 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] Sendmail examples
steve smith wrote: Anyone have any good, real-world examples using DTML-Sendmail tags? Would especially appreciate examples integrating SQL queries. hi steve. one of the worst things with zope sendmail is that you cannot indent things the way you might with clean coding use. but, you can use some very nice sql calls within you sendmail, including appropriate indentation. below is a sendmail method that i use to read a string of email address from a mysql database, and the text of the email from a second database, which gets parsed via an external python script (to parse the string of text into lines of = 75 chars, otherwise the text gets sent as single lines). also, it checks for non-existent email addresses or missing names (the database is a list of people and companies, whether connected to the net or not). it may not be the most efficient, but it works; and any suggestions as to making it more efficient will be most appreciated. ciao! greg. venaca.com ** clip dtml-var standard_html_header p dtml-in get_group dtml-call "REQUEST.set('counter',2)" dtml-let resp_num=sequence-item resp_x=sequence-index dtml-call "REQUEST.set('counter',resp_x)" dtml-call "REQUEST.set('resp_numx',resp_num)" dtml-if "resp_numx ''" dtml-let resp_ct=sequence-item resp_y=sequence-index dtml-if "resp_y == counter" dtml-in get_prs dtml-call "REQUEST.set('pr_num', strip_blank(pr_id)[:-1])" dtml-if "pr_num == selection" dtml-call "REQUEST.set('z_subject', pr_subject)" dtml-call "REQUEST.set('z_title',title)" dtml-call "REQUEST.set('msg',pr_content)" dtml-if "primary_email '' and primary_name ''" dtml-sendmail mailhost="MailHost" To: dtml-var primary_name dtml-var primary_email From: [EMAIL PROTECTED] Subject: dtml-var z_subject dtml-var z_title dtml-in "clean_content(msg)" dtml-var sequence-item /dtml-in /dtml-sendmail dtml-elif "primary_name == ''" dtml-sendmail mailhost="MailHost" To: dtml-var primary_email From: [EMAIL PROTECTED] Subject: dtml-var z_subject dtml-var z_title dtml-in "clean_content(msg)" dtml-var sequence-item /dtml-in /dtml-sendmail /dtml-if /dtml-if /dtml-in /dtml-if /dtml-let /dtml-if /dtml-let /dtml-in dtml-var standard_html_footer ___ 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] Mass Mailing (newbie)
hi yvonne, you can use the zope send mail method to pull data from a database. the problem is with pulling in the text. sendmail appears to send only literal text, i.e., it does not parse html markup. we are using a mysql database to pull text and a second to pull names and emails, etc. to prevent the text from coming out as a single string, i have an external python method that takes the string of text and writes out the lines as lines of = 75 chars, it also reinserts double line breaks, as in between paragraphs. we use something like this: you will need the MailHost product, and you will need to add a sendmail method in your directory. ciao! greg. DBA/web programmer venaca.com *** dtml-in get_prs dtml-call "REQUEST.set('z_subject', pr_subject)" dtml-call "REQUEST.set('z_title',title)" dtml-call "REQUEST.set('msg',pr_content)" dtml-in get_addresses dtml-sendmail mailhost="MailHost" To: dtml-var name dtml-var email From: [EMAIL PROTECTED] Subject: dtml-var z_subject dtml-var z_title dtml-in "clean_content(msg)" dtml-var sequence-item /dtml-in /dtml-sendmail /dtml-in /dtml-in "clean_content" is the name of the python external method. This may not be ALL of the code, as i am really chopping some things out of the actual dtml file for illustrative purposes. a couple of warnings, in case you haven't used dtml sendmail. you can use nice indented tags within a dtml-in or dtml-if but not other wise. the left margin is, in my experience anyway, fairly inviolable. as this is working now, if sendmail gets a bad address, it strangles everything from the point of the error forward. so, you should check to make sure your emails are exactly correct -- i was doing a bulk mailing of about 100 emails, and it died after the 6th one. i don't know how to put in a trap into the method so that the mail server catches the return mail but does not pass them to the zope mailhost. ciao! greg. Yvonne Totty wrote: Hi! I need to send out mass mailings from time to time (newsletters, announcements and the such). Is there an easy way to get this done? I already have the email addy's in the database. TIA, Yvonne ~~~ Yvonne Totty Database Engineer - Wolverine: You actually go outside in these things? Cyclops: Well, what would you prefer? Yellow spandex? ___ 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] PHP-Pages
hi vince, with the exception of xml parsing (i think it's doable though complicated), i don't think php offers anything that zope won't do. i've been writing dtml methods and documents that do everything i once did with php. imho (only). ciao! greg. Hi Zope, I wondered, whether it's possible and sensible to have php-Pages in Zope sites ... any thoughts and comments on this matter? Cheers, Vince ''' ô¿ô - ___ 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] Sorting 'in'
hi yvonne, in your zsql method, you can order by several variables in the same method call. so you can do it all in one method. ciao! greg. Gregory Haley Venaca.com Yvonne Totty wrote: Yes, that is what I am doing, however was wanting to not have to write several Z SQL Methods. 8) ~~~ Yvonne Totty Database Engineer - Wolverine: You actually go outside in these things? Cyclops: Well, what would you prefer? Yellow spandex? If it's a database query sorting with sql first. i.e. ORDER BY X,Y HTH Dan Yvonne Totty wrote: Hi! I need a query sorted by 2-3 different attributes. The 'in' sort only lets me do it by one. Is there a way to get around it? TIA -y ~~~ Yvonne Totty Database Engineer - Wolverine: You actually go outside in these things? Cyclops: Well, what would you prefer? Yellow spandex? ___ 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] help
Andy McKay wrote: BTW: Im not a Unix guru but I dont think having everythin 777 is the most secure way of maintaining your installation... -- Andy McKay, Developer. ActiveState. Hi Andy, actually, if you are talking about permissions, this setting gives anyone in the world read write and execution access to your document(s)/directory(ies). I think you want to set permissions as 755, with owner and group set to nobody (at least for the /opt/zope directory and sub-directories. (allows only owner write access) : ) ciao! greg. ___ 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 )