RE: [Zope] Another Zope E-Commerce Site Online
Ooops I get a Zope transaction error when I go there Ian Cottee ___ 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 Chinese Characters
With reference to inputting chinese characters I have similar issues within handling Japanese. My two solutions are either use Internet Explorer (if you have a windows machine) and use their add on extensions (download 5.5 and look at the extra options during download setup) or use emacs with MULE. Obviously there are limitations with the emacs method with what you can and can not edit. Some distributions of Linux will allow you to setup your environment in both Japanese and English and toggle between the. I think the same is true for Chinese. Try Kondara at http://www.kondara.com - I saw a demo of their new version at the Linux Expo which seemed to work well. Apart from playing with a Japanese distribution for fun I haven't done any serious work with these. Note that if you ever want to start storing your characters in external databases you will need to make sure that it can handle your encoding as well. MySQL has to be compiled with a certain config flag and I believe the same is true with Postgres. Otherwise strange things will happen :-) Ian ___ 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] Showing the name of a file-type form variable
Hi file.filename should be what you are after. e.g. In my latest project I set a variable myFileName to be the name of the file uploaded using dtml-var "REQUEST.set('myFileName',file.filename)" where file is the name of my file upload control in my form. Ian Original Message --- Hi Zopers I've got this:: tdinput type="file" name="file" dtml-if file value="dtml-var "file"" /dtml-if /td Which returns:: ZPublisher.HTTPRequest.FileUpload instance at 131dc48 in the input box. I'd really rather have the filename. How does one do that? ___ 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] The tree tag, SQL and what should be simple
I thought this was going to be simple but having read numerous postings on the mailing list and all related HOW-TOs I can find, I think I can confirm I am stuck. This is sad because I've just spent a very productive couple of days with Zope and MySQL making the world a better place. I have a table for chickens. Basically it looks like this CREATE TABLE T_CHICKEN ( ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, CODE CHAR(10) NOT NULL, DESCRIPTION CHAR(40) NOT NULL, NOOFLEGS INT NOT NULL DEFAULT 2, TYPEID INT NOT NULL ); And another table for types. CREATE TABLE T_TYPE ( ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, CODE CAR(10) ); Each chicken has a type associated with it. At the end of the day I want to display the chickens underneath the type it has ... start the screen up it would say + BIG + MEDIUM + SMALL And the users can then expand to see the chickens available in each category. + BIG - Flossie - Wombat - Hank + MEDIUM - Debbie - Fruitbat - Harold + SMALL - Bob It would appear that I need to feed two things to the dtml-tree tag. Firstly my starting levels (my types) and then the related data underneath but I can only feed one SQL query to the tag. All the stuff I read seems to assume the info at the top level comes from the same file (and from a key id). How do I do this or indeed, is it possible? I have a nasty feeling I am missing something obvious. Ian ___ 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] FSSession - don't call FSSession twice!
I've been using the excellent FSSession product (many thanks Mr Christoforou) to hold some information on the language a user wishes to display a page in. I kept having weird errors however - every now and again I'd change some code somewhere completely unrelated (even just adding a user) and FSSession would break. Undoing the last change wouldn't help. The error was to do with _v_data and (I think) _v_id or something similar. This post isn't about that problem. From reading through the extremely useful nipltd archives it appeared the problem was not doing a dtml-call FSSession at the beginning of the code. This was bemusing because that code was sitting in my standard header and called everywhere. However, I had an uneasy workaround which did a 'try' on using FSSession and if it failed initialise it in the normal way. I say 'uneasy' because I didn't know why I needed it and when I added another bit of code to handle another cookie that needed to be recorded it broke again. This post isn't about that problem either. I decided enough was enough today and thought I'd try and find out what was happening. So I could give some proper information to Pavlos Christoforou I downloaded the latest version of FSSession and tried to reproduce my error. Bang - I got a much more impressive error. Whenever I went to any of my pages that used FSSession I got the following. Zope has encountered an error while publishing this resource. Error Type: OSError Error Value: [Errno 2] No such file or directory Followed by the following traceback Traceback (innermost last): File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/zope/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: ElementWithAttributes) File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 175, in publish File /usr/local/zope/lib/python/Zope/__init__.py, line 235, in commit File /usr/local/zope/lib/python/ZODB/Transaction.py, line 296, in commit File /usr/local/zope/lib/python/Shared/DC/ZRDB/TM.py, line 122, in tpc_finish (Object: TM) File /usr/local/zope/lib/python/Products/FSSession/FSSession.py, line 84, in _finish (Object: TM) File /usr/local/zope/lib/python/Products/FSSession/FSSession.py, line 193, in final_commit (Object: FSSession) OSError: (see above) Interestingly the line above 193 in FSSession.py is a comment which reads 'should never fail'. Well it does and the reason is (as you may have guessed from the title) that I called FSSession twice. Line 193 appears to rename a .tmp file and I'd guess that by calling it twice my second attempt fails as the file has already been renamed. Obviously this isn't the way I should be doing things and I'm going to have a go and see if the new version of FSSession cures my earlier problems. The reason I mention this now is that the problem causes any future attempts at transactions to give the following error - which can only be remedied by restarting zope. Error Type: TransactionError Error Value: A serious error, which was probably a system error, occurred in a previous database transaction. This application may be in an invalid state and must be restarted before database updates can be allowed. Beware though that if the error was due to a serious system problem, such as a disk full condition, then the application may not come up until you deal with the system problem. See your application log for information on the error that lead to this problem. So if you make the same mistake as I did on a production server you will not be popular :-). I'm running this on Zope 2.2.0 by the way (although it happens on the previous production version as well). Hope this is of some use Ian ___ 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] FSSession - don't call FSSession twice!
You are very welcome. By the way, just to confirm I don't have the problems I had before with the new 0.4 version of FSSession so I have no need now to try and call FSSession twice. Thanks once again Ian ___ 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] Customising the calling of the _add method for a product
I have a TimeSheet product which is currently utilising the suggestions from one of the howtos on zope.org, to make the handling of errors a little smarter. Subsequently my addForm code checks to see if any errors were detected and, if not, tries to go to the usual _add method. But this fails. The code below shows what I currently have. If I can just call this _add method I am finished. dtml-if "I_Error==1" dtml-var TimeSheet_addForm_include dtml-else dtml-call "TimeSheet_add(_,_.None)" /dtml-if As always, any help greatfully received Ian ___ 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] The right way to sum fields
I have a folder with a set of timesheets in it. If I create a method to sum a field called I_TimeTaken is this the correct syntax? --- dtml-in "PARENTS[0].objectValues(['TimeSheet'])" size=1 dtml-var total-I_TimeTaken /dtml-in --- To explain, this works but I'm interested to know if this is the right way. Specifically because I am now trying to write another routine which totals not just the current folder but the contents of any sub folders below and am running into problems (i.e. I can't do it). If the basic step is wrong I'd like to know before I use it in other places. Haven't managed to find anything in the archives but I think I may be suffering from docs overload. Many thanks for any help Ian Cottee (knee deep in Zope and way out of time) ___ 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] Referring to a total-xxx variable
Following on from my last posting I seem to have made a lot of progress - although still not sure if what I have done is the right thing or not. However, please somebody put me out of my misery. In the following code snippet the dtml-var part works fine. How can I, therefore, add count-id to v_allItems? It seems to think I am trying to do subtraction. I've spent a couple of hours trying to find the mystical incantation. dtml-in "PARENTS[0].objectValues(['TimeSheet'])" dtml-var count-id dtml-call "REQUEST.set('v_allItems', v_allItems + count-id)" /dtml-in Ian Cottee Nagoya, Japan ___ 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] Referring to a total-xxx variable
Many thanks to both you and Andrew. I should really sit down and write out all the different ways of reffering to variables and learn them properly. I had tried to use something similar to dtml-let ci=count-id dtml-call "REQUEST.set('v_allItems', v_allItems + ci )" /dtml-let and I thought it hadn't worked. However, just tried again and it does so I am obviously loosing the plot. Many thanks for your help Ian Cottee Nagoya, Japan ___ 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 )