on Thursday, March 30, 2000 Anders Holmbech Nielsen wrote : AHN> Thanks for your answer but it doesn't seem to work. AHN> I have tried to made a method called both raw and AHN> PrincipiaSearchSource, reindexed the catalog and placed the method in AHN> both the product dir and the product/product_entry/method dir. But it AHN> doesn't work. Do you or anyone have an idea to what I have missed. AHN> The method I have used is: AHN> return string.join((self.overskrift, self.indhold, self.forfattere), ';') Does the method return the full text if you call it directly? like: http://your.zopeserver.dk/yourZclass_instance/PrincipiaSearchSource you should get the raw contents of the instance.. If you don't , somethings wrong with the method or its placement.. i think product/product_entry/methods is the right place.. If you get the raw text returned, the fault is with your Zcatalog.. Have you updated it after adding the pythonmethod ?? - Checking the status-view of your zcatalog can often help to see if it has updated correctly.. -- Geir Bækholt Hansen web-developer/designer geirh@funcom.com http://www.funcom.com
on Thursday, March 30, 2000 Anders Holmbech Nielsen wrote : AHN> Thanks for your answer but it doesn't seem to work.
AHN> I have tried to made a method called both raw and AHN> PrincipiaSearchSource, reindexed the catalog and placed the method in AHN> both the product dir and the product/product_entry/method dir. But it AHN> doesn't work. Do you or anyone have an idea to what I have missed. AHN> The method I have used is:
AHN> return string.join((self.overskrift, self.indhold, self.forfattere), ';')
Does the method return the full text if you call it directly?
Nope - instead it just returns the content of the method: return string.join((self.overskrift, self.indhold, self.forfattere), ';') In other words it doesn't calculate anything but just return the content. It is in a DTML method so I guess that that is the correct way to do it. But it sure seems that I am doing something wrong here. But what ??? Do you or anyone else have an idea or an example that works ?
like:
http://your.zopeserver.dk/yourZclass_instance/PrincipiaSearchSource
you should get the raw contents of the instance..
If you don't , somethings wrong with the method or its placement.. i think product/product_entry/methods is the right place..
If you get the raw text returned, the fault is with your Zcatalog.. Have you updated it after adding the pythonmethod ?? - Checking the status-view of your zcatalog can often help to see if it has updated correctly..
-- Geir Bækholt Hansen web-developer/designer geirh@funcom.com http://www.funcom.com
Regards ------------------------------------------------- Anders Holmbech Nielsen | Tlf: (+45) 70 22 56 00 Software Engineer | Fax: (+45) 70 22 57 00 Integrator Uniware A/S | http:/www.integrator.dk
on Tuesday, April 04, 2000 Anders Holmbech Nielsen wrote : AHN> Nope - instead it just returns the content of the method: AHN> return string.join((self.overskrift, self.indhold, self.forfattere), ';') AHN> In other words it doesn't calculate anything but just return the AHN> content. It is in a DTML method so I guess that that is the correct ^^^^^^^^^^ AHN> way to do it. But it sure seems that I am doing something wrong here. AHN> But what ??? AHN> Do you or anyone else have an idea or an example that works ? Do i understand you right in that you are using a DTML method for this ? You'll have to use a Pythonmethod or external method.. Pythonmethods are generally easier to use in matters like this.. The above code should work when evaluated as Python.. -- Geir Bækholt Hansen web-developer/designer geirh@funcom.com http://www.funcom.com
duh... Ok I didn't quite get it right the first time but now I have installed the PythonMethod module and made a Pythonmethod instead. Doing this I get this return: Error Type: NameError Error Value: self Still with this content in the method: return string.join((self.overskrift, self.indhold, self.forfattere), ';')
on Tuesday, April 04, 2000 Anders Holmbech Nielsen wrote :
AHN> Nope - instead it just returns the content of the method: AHN> return string.join((self.overskrift, self.indhold, self.forfattere), ';')
AHN> In other words it doesn't calculate anything but just return the AHN> content. It is in a DTML method so I guess that that is the correct ^^^^^^^^^^ AHN> way to do it. But it sure seems that I am doing something wrong here. AHN> But what ???
AHN> Do you or anyone else have an idea or an example that works ?
Do i understand you right in that you are using a DTML method for this ? You'll have to use a Pythonmethod or external method.. Pythonmethods are generally easier to use in matters like this.. The above code should work when evaluated as Python..
-- Geir Bækholt Hansen web-developer/designer geirh@funcom.com http://www.funcom.com
_______________________________________________ Zope maillist - Zope@zope.org 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 )
Regards ------------------------------------------------- Anders Holmbech Nielsen | Tlf: (+45) 70 22 56 00 Software Engineer | Fax: (+45) 70 22 57 00 Integrator Uniware A/S | http:/www.integrator.dk
on Tuesday, April 04, 2000 Anders Holmbech Nielsen wrote : AHN> duh... Ok I didn't quite get it right the first time but now I have AHN> installed the PythonMethod module and made a Pythonmethod instead. AHN> Doing this I get this return: AHN> Error Type: NameError AHN> Error Value: self AHN> Still with this content in the method: AHN> return string.join((self.overskrift, self.indhold, self.forfattere), ';') works here.. are you calling it for a Zclass instance, and not the Zclass itself when testing it ? yoursite.dk/YourZclassInstance/YourPythonMethod -- Geir Bækholt Hansen web-developer/designer geirh@funcom.com http://www.funcom.com
on Tuesday, April 04, 2000 Anders Holmbech Nielsen wrote : AHN> duh... Ok I didn't quite get it right the first time but now I have AHN> installed the PythonMethod module and made a Pythonmethod instead. AHN> Doing this I get this return:
AHN> Error Type: NameError AHN> Error Value: self
AHN> Still with this content in the method: AHN> return string.join((self.overskrift, self.indhold, self.forfattere), ';')
works here.. are you calling it for a Zclass instance, and not the Zclass itself when testing it ?
yoursite.dk/YourZclassInstance/YourPythonMethod
Yes i call it from an instance of my zclass. ie: http://dyn-90:8080/byg/artikler/953721827/raw where "953721827" is the zclass. I have tried just to return a string and that works fine. It seems that Zope cannot find the "self" reference.
-- Geir Bækholt Hansen web-developer/designer geirh@funcom.com http://www.funcom.com
Regards ------------------------------------------------- Anders Holmbech Nielsen | Tlf: (+45) 70 22 56 00 Software Engineer | Fax: (+45) 70 22 57 00 Integrator Uniware A/S | http:/www.integrator.dk
participants (3)
-
Anders Holmbech Nielsen -
Geir B Hansen -
Geir B�kholt Hansen