Re: [Zope] ZCatalog : Searching Multiple Indexes : Returning One Result
If I understand correctly, this seems like searching for multiple values in one index. What I'm looking to do is search for one value in multiple indexes... and get back one result even if there are True hits in more than one index. On Mon, Jul 7, 2008 at 4:00 PM, Jonathan <[EMAIL PROTECTED]> wrote: > > - Original Message - From: "Tom Von Lahndorff" <[EMAIL PROTECTED]> > To: "zope list user" > Sent: Monday, July 07, 2008 3:42 PM > Subject: [Zope] ZCatalog : Searching Multiple Indexes : Returning One > Result > > > > Hi, I have a catalog called "catalog" that contains a bunch of cataloged >> items. I have indexed 3 properties for each item, "name", "body" and >> "description". I'd like to be able to search the catalog in the following >> way: >> >> if the word "text" shows up in any index, "name", "body" or "description", >> return that result back once. >> >> The problem is I have is that if a do a search for "text" and say there's >> results that have the word "text" in one or more of those indexes: >> >> catalog({name:query}) or catalog({body:query}) or >> catalog({description:query}) >> only gives back limited results (leaves out some 'True' hits) and: >> catalog({name:query}) + catalog({body:query}) + >> catalog({description:query}) >> gives me back the same result 3 times. >> >> any ideas? Thanks. >> > > Something I saved from a long time ago post (warning untested) which may > give you some ideas: > > > context.Catalog({'keywordindex': ['Value1', 'Value2']}) > Catalog returns me an OR search instead of an AND one > > Use "context.Catalog(keywordindex = {'query':[...], operator='and'})" > when you want to use the "and" operator. > > > hth > > Jonathan > > ___ 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] getting post data from a webcam
Can you use ftp or webdav, that may be easier, this would take care of mimetypes without having to move to a lower level. It depends on the capabilities of your camera but not knowing the model there is limited help. I had an Axis camera, that ran embedded linux and had a built in python web server (boa) which I used to get an image from the camera every 5 seconds replacing the previous image for viewing from our WEB site. And, I had to put the image directly on the file system and use the Local File System product for Zope to access it because it was always downloaded under the same file name and putting it in Zope directly quickly filled up the hard drive because of the undo option, a learning experience. It's been so long ago I don't remeber all of the details. Thomas On Wednesday 09 July 2008 00:16, William Heymann wrote: > I am trying to integrate a webcamera with a site and I can get it to POST > the data to a certain url on the server the problem is I can't figure out > how to get access to the data. It is not in REQUEST.form > > the relevant request vars are > > ('CONTENT_LENGTH', '111695') > ('CONTENT_TYPE', 'image/jpeg') > ('HTTP_CONTENT_DISPOSITION', 'attachment; > filename="image01-07-29_05-54-26-96.jpg"') > > This is being posted to a python script object inside zope, however if I > need to use an external method that is not a problem I just need to figure > out how to get the data. > > Thanks > ___ > 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 ) -- Thomas McMillan Grant Bennett Appalachian State University Operations & Systems AnalystP O Box 32026 University Library Boone, North Carolina 28608 (828) 262 6587 "... using OpenOffice.org, and save them back to disk automatically, in MS Word format. They surf the Web, check e-mail, do instant messaging, view YouTube videos, visit their Facebook pages, learn touch-typing skills and lots more. Our public library has been offering these Linux public stations for the past three years." - Phil Shapiro Linux Journal January 2008 Library Systems Help Desk: https://www.library.appstate.edu/help/ ___ 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] getting post data from a webcam
- Original Message - From: "William Heymann" <[EMAIL PROTECTED]> To: Sent: Wednesday, July 09, 2008 7:23 AM Subject: Re: [Zope] getting post data from a webcam On Wednesday 09 July 2008, Jonathan wrote: You need to provide more details... try dumping the contents of REQUEST and posting them as was suggested earlier. I did post all the relevant fields from the REQUEST here are all of the them in REQUEST.items() [('ACTUAL_URL', 'http://www.X.com/imageuploader'), ('AUTHENTICATED_USER', ), ('AUTHENTICATION_PATH', 'XXX/VirtualHostBase//'), ('BASE0', 'http:// www.XXcom'), ('BASE1', 'http://www.cougarcanyonliving.com'), ('BASE2', 'http://www..com/imageuploader'), ('CONTENT_LENGTH', '111695'), ('CONTENT_TYPE', 'image/jpeg'), ('GATEWAY_INTERFACE', 'CGI/1.1'), ('HTTP_CONTENT_DISPOSITION', 'attachment; filename="image01-07-29_05-54-26-96.jpg"'), ('HTTP_HOST', '127.0.0.1:9673'), ('HTTP_MAX_FORWARDS', '10'), ('HTTP_USER_AGENT', 'Axis shttpclien t $Revision: 1.45 $'), ('HTTP_VIA', '1.0 www..com'), ('HTTP_X_FORWARDED_FOR', 'XX.XXX.XXX.XXX'), ('HTTP_X_FORWARDED_HOST', '.com'), ('HTTP_X_FORWARDED_SERVER', 'www.X.com'), ('PARENTS', [, ]), ('PATH_INFO', '/VirtualHostBase/http/www..com:80/XXX/VirtualHostRoot/imageuploader'), ('PATH_TRANSLATED', '/VirtualHostBase /http/www..com:80/XXX/VirtualHostRoot/imageuploader'), ('PUBLISHED', ), ('REMOTE_ADDR', '127.0.0.1'), ('REQUEST_METHOD', 'POST'), ('RESPONSE', ZServerHTTPRe sponse('')), ('SCRIPT_NAME', ''), ('SERVER_NAME', 'localhost'), ('SERVER_PORT', '9673'), ('SERVER_PROTOCOL', 'HTTP/1.1'), ('SERVER_SOFTWARE', 'Zope/(Zope 2.9.6-final, python 2.4.4, linux2) ZServer/1.1'), ('SERVER_URL', 'http://www..com'), ('SESSION', id: 12155753281337189705, token: 99836730A3cKJMzoaVU, content keys: []), ('TraversalRequestNameStack', []), ('URL', 'http://www..com/ imageuploader'), ('URL0', 'http://www..com/imageuploader'), ('URL1', 'http://www..com'), ('VIRTUAL_URL', 'http://www..com/imageuploader'), ('VIRTUAL_URL_PARTS', ('http://www..com', 'imageuploader')), ('VirtualRootPhysicalPath', ('', 'XXX')), ('__aca', '/36gevRRS99FhE%2BrH6GVLeSzXzA%3D%0A'), ('traverse_subpath', [])] there is nothing in REQUEST.form Just a thought... could your front-end (apache?) be stripping out the image due to attachment size restrictions or some other restriction? Jonathan ___ 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] Best policy to assign policy to assign ids to objects inside BTreeFolder2
On Wed, Jul 9, 2008 at 1:53 PM, Sascha Welter <[EMAIL PROTECTED]> wrote: > (Mon, Jul 07, 2008 at 02:52:57PM +0200) Marco Bizzarri wrote/schrieb/egrapse: >> I need to create a number of objects inside a BTreeFolder2 container. >> >> I would like to minimize the chances of conflicts, so I'm exploring >> possibilities to assign ids; up to now I've found the following: >> >> - timestamps >> - random numbers >> >> What is the best choice to reduce the chances of conflicts? > > How about the API that BTreeFolder2 provides? > > Look for generateId(). In my experience it works quite well. It just > counts integers up, but resolves conflicts. It gives you the ability to > assign prefixes and suffixes. > > Regards, > > Sascha > > ___ > 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 ) > I was not aware of the BTreeFolder2 API. I'll take a look at it right now. Regards Marco. -- Marco Bizzarri http://iliveinpisa.blogspot.com/ ___ 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] Best policy to assign policy to assign ids to objects inside BTreeFolder2
(Mon, Jul 07, 2008 at 02:52:57PM +0200) Marco Bizzarri wrote/schrieb/egrapse: > I need to create a number of objects inside a BTreeFolder2 container. > > I would like to minimize the chances of conflicts, so I'm exploring > possibilities to assign ids; up to now I've found the following: > > - timestamps > - random numbers > > What is the best choice to reduce the chances of conflicts? How about the API that BTreeFolder2 provides? Look for generateId(). In my experience it works quite well. It just counts integers up, but resolves conflicts. It gives you the ability to assign prefixes and suffixes. Regards, Sascha ___ 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] getting post data from a webcam
On Wednesday 09 July 2008, Jonathan wrote: > > You need to provide more details... try dumping the contents of REQUEST and > posting them as was suggested earlier. > I did post all the relevant fields from the REQUEST here are all of the them in REQUEST.items() [('ACTUAL_URL', 'http://www.X.com/imageuploader'), ('AUTHENTICATED_USER', ), ('AUTHENTICATION_PATH', 'XXX/VirtualHostBase//'), ('BASE0', 'http:// www.XXcom'), ('BASE1', 'http://www.cougarcanyonliving.com'), ('BASE2', 'http://www..com/imageuploader'), ('CONTENT_LENGTH', '111695'), ('CONTENT_TYPE', 'image/jpeg'), ('GATEWAY_INTERFACE', 'CGI/1.1'), ('HTTP_CONTENT_DISPOSITION', 'attachment; filename="image01-07-29_05-54-26-96.jpg"'), ('HTTP_HOST', '127.0.0.1:9673'), ('HTTP_MAX_FORWARDS', '10'), ('HTTP_USER_AGENT', 'Axis shttpclien t $Revision: 1.45 $'), ('HTTP_VIA', '1.0 www..com'), ('HTTP_X_FORWARDED_FOR', 'XX.XXX.XXX.XXX'), ('HTTP_X_FORWARDED_HOST', '.com'), ('HTTP_X_FORWARDED_SERVER', 'www.X.com'), ('PARENTS', [, ]), ('PATH_INFO', '/VirtualHostBase/http/www..com:80/XXX/VirtualHostRoot/imageuploader'), ('PATH_TRANSLATED', '/VirtualHostBase /http/www..com:80/XXX/VirtualHostRoot/imageuploader'), ('PUBLISHED', ), ('REMOTE_ADDR', '127.0.0.1'), ('REQUEST_METHOD', 'POST'), ('RESPONSE', ZServerHTTPRe sponse('')), ('SCRIPT_NAME', ''), ('SERVER_NAME', 'localhost'), ('SERVER_PORT', '9673'), ('SERVER_PROTOCOL', 'HTTP/1.1'), ('SERVER_SOFTWARE', 'Zope/(Zope 2.9.6-final, python 2.4.4, linux2) ZServer/1.1'), ('SERVER_URL', 'http://www..com'), ('SESSION', id: 12155753281337189705, token: 99836730A3cKJMzoaVU, content keys: []), ('TraversalRequestNameStack', []), ('URL', 'http://www..com/ imageuploader'), ('URL0', 'http://www..com/imageuploader'), ('URL1', 'http://www..com'), ('VIRTUAL_URL', 'http://www..com/imageuploader'), ('VIRTUAL_URL_PARTS', ('http://www..com', 'imageuploader')), ('VirtualRootPhysicalPath', ('', 'XXX')), ('__aca', '/36gevRRS99FhE%2BrH6GVLeSzXzA%3D%0A'), ('traverse_subpath', [])] there is nothing in REQUEST.form ___ 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] getting post data from a webcam
- Original Message - From: "William Heymann" <[EMAIL PROTECTED]> To: Sent: Wednesday, July 09, 2008 6:42 AM Subject: Re: [Zope] getting post data from a webcam On Wednesday 09 July 2008, Tino Wildenhain wrote: William Heymann wrote: > I am trying to integrate a webcamera with a site and I can get it to > POST > the data to a certain url on the server the problem is I can't figure > out > how to get access to the data. It is not in REQUEST.form > > the relevant request vars are > > ('CONTENT_LENGTH', '111695') > ('CONTENT_TYPE', 'image/jpeg') > ('HTTP_CONTENT_DISPOSITION', 'attachment; > filename="image01-07-29_05-54-26-96.jpg"') > > This is being posted to a python script object inside zope, however if > I > need to use an external method that is not a problem I just need to > figure out how to get the data. If the file is posted as attachment (similar to file upload) it should appear in the relevant form element as file. You can just use the method .read() on it to get the data (or feed it into factory of image/file) Unfortunately it is now showing up in REQUEST.form, it is not a POST like what you get with a file upload from a form. Zope is showing that the correct size of data was sent to that page. For this to work the data needs to be sent as enctype="multipart/form-data" (hopefully the cam does this). It was not sent with that kind of encoding at least not in any way I can tell. It was a webcam and all I could give it was a url to POST the data to and it did not submit it like a regular form. Maybe you send all variables of the request to figure out. Regards Tino You need to provide more details... try dumping the contents of REQUEST and posting them as was suggested earlier. Jonathan ___ 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] getting post data from a webcam
On Wednesday 09 July 2008, Tino Wildenhain wrote: > William Heymann wrote: > > I am trying to integrate a webcamera with a site and I can get it to POST > > the data to a certain url on the server the problem is I can't figure out > > how to get access to the data. It is not in REQUEST.form > > > > the relevant request vars are > > > > ('CONTENT_LENGTH', '111695') > > ('CONTENT_TYPE', 'image/jpeg') > > ('HTTP_CONTENT_DISPOSITION', 'attachment; > > filename="image01-07-29_05-54-26-96.jpg"') > > > > This is being posted to a python script object inside zope, however if I > > need to use an external method that is not a problem I just need to > > figure out how to get the data. > > If the file is posted as attachment (similar to file upload) it should > appear in the relevant form element as file. You can just use the method > .read() on it to get the data (or feed it into factory of image/file) > Unfortunately it is now showing up in REQUEST.form, it is not a POST like what you get with a file upload from a form. Zope is showing that the correct size of data was sent to that page. > For this to work the data needs to be sent as > enctype="multipart/form-data" (hopefully the cam does this). > It was not sent with that kind of encoding at least not in any way I can tell. It was a webcam and all I could give it was a url to POST the data to and it did not submit it like a regular form. > Maybe you send all variables of the request to figure out. > > Regards > Tino ___ 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 )