Re: [Zope] Batch folder creation
Thanks David, That works fine although it is a little crude. What I'd like to be able to do is create folders with names and titles derived from an external File where each line contains the name and title, separated by a comma. Guess I need to find out how to get python to read lines from a Zope File object On Wed, Jun 22, 2005 at 10:49:07AM -0700, David H wrote: John Poltorak wrote: Is there any way to create folders in batch? I need to create around 50 but don't fancy doing this manually. John, Put this in a python script and test. for n in range(10): container.manage_addFolder(id= str(n)) 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 )
Re: [Zope] Batch folder creation
John, Seems like external scripts and dictionaries are a theme today. You need to check python manuals for file handling. Its a simple implementation. Then you would parse out names and title and put them in a dictionary and return. then in replace range(1...10) as seen in earlier messages with something *like* for n in yourDictionary: container.manage_addFolder(id = n, title = yourDictionary[n]) David John Poltorak wrote: Thanks David, That works fine although it is a little crude. What I'd like to be able to do is create folders with names and titles derived from an external File where each line contains the name and title, separated by a comma. Guess I need to find out how to get python to read lines from a Zope File object On Wed, Jun 22, 2005 at 10:49:07AM -0700, David H wrote: John Poltorak wrote: Is there any way to create folders in batch? I need to create around 50 but don't fancy doing this manually. John, Put this in a python script and test. for n in range(10): container.manage_addFolder(id= str(n)) 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 )
Re: [Zope] Batch folder creation
Hi David, I'm used to using the term 'file'. I guess it isn't appropriate in this case since I'm not actually handling a file but a Zope File object. I'm not sure where to look to see how Python handles this... John On Thu, Jun 23, 2005 at 04:30:07PM -0700, David H wrote: John, Seems like external scripts and dictionaries are a theme today. You need to check python manuals for file handling. Its a simple implementation. Then you would parse out names and title and put them in a dictionary and return. then in replace range(1...10) as seen in earlier messages with something *like* for n in yourDictionary: container.manage_addFolder(id = n, title = yourDictionary[n]) David John Poltorak wrote: Thanks David, That works fine although it is a little crude. What I'd like to be able to do is create folders with names and titles derived from an external File where each line contains the name and title, separated by a comma. Guess I need to find out how to get python to read lines from a Zope File object On Wed, Jun 22, 2005 at 10:49:07AM -0700, David H wrote: John Poltorak wrote: Is there any way to create folders in batch? I need to create around 50 but don't fancy doing this manually. John, Put this in a python script and test. for n in range(10): container.manage_addFolder(id= str(n)) 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] Batch folder creation
Is there any way to create folders in batch? I need to create around 50 but don't fancy doing this manually. -- John ___ 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] Batch folder creation
John Poltorak wrote: Is there any way to create folders in batch? I need to create around 50 but don't fancy doing this manually. John, Put this in a python script and test. for n in range(10): container.manage_addFolder(id= str(n)) 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 )
Re: [Zope] batch processing with CMFPhotoAlbum
I think the Silva product has that feature, if I remember correctly... perhaps there's a clue there. -Jon Malthe Borch wrote: Hello list, --- In the sake of usability, I'd like to offer my users the ability to upload a compressed archive (i.e. zip og tarball) of photos, so that uploading a roll of film isn't a days work, but rather two or three clicks. Obviously, there still would be a need to do a group-rename afterwards, but the idea is pretty solid I think. I'll want to use the standard way of adding a photo, only also allow for archives in the submission process. Would anyone care to collaborate or share ideas on such a patch? I assume it would be useful with other media as well. \malthe ___ 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 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] batch processing with CMFPhotoAlbum
Hello list, --- In the sake of usability, I'd like to offer my users the ability to upload a compressed archive (i.e. zip og tarball) of photos, so that uploading a roll of film isn't a days work, but rather two or three clicks. Obviously, there still would be a need to do a group-rename afterwards, but the idea is pretty solid I think. I'll want to use the standard way of adding a photo, only also allow for archives in the submission process. Would anyone care to collaborate or share ideas on such a patch? I assume it would be useful with other media as well. \malthe ___ 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] batch processing problem
Hi everyone, I was trying to throw together a page with some pictures of my brand-new nephew for his parents to show to relatives. What should have been a relatively simple dtml-in iteration through a folder full of images has turned out to be headache inducing. I'm sure that there's something I'm just not understanding, but I can't figure out why the following doesn't work. I've tried many different combinations without success. You can see it for yourself at http://208.42.140.222:9673/olsen/cullypics/ (Sorry, DNS problems.) dtml-var standard_html_header h2 align="center"Cullin Isaac Olsen/h2 h3 align="center"January 17, 2001br8 lb. 1 oz., 22 in./h3 br table align="center" cellspacing="10" dtml-in "PARENTS[0].objectValues(['Image'])" size=1 start=query_start sort=display_order tr td colspan="2" span style="font: bold larger Verdana, Arial, Helvetica, sans-serif"Picture #dtml-var display_order/spanbr a href="fullsize/dtml-var id_fullsize"dtml-var sequence-item/a dtml-if titleh4 align="center"dtml-var title/h4/dtml-if /td /tr tr td dtml-if previous-sequence p align="left"a href="dtml-var URLdtml-var sequence-queryquery_start=dtml-var previous-sequence-start-number"p align="left"Previous picture/a/p dtml-else nbsp; /dtml-if previous-sequence /td td dtml-if next-sequence p align="right"a href="dtml-var URLdtml-var sequence-queryquery_start=dtml-var next-sequence-start-number" Next picture/a/p dtml-else nbsp; /dtml-if next-sequence /td /tr /dtml-in /table dtml-var standard_html_footer Any ideas? -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/ W. St. Paul, MN | | http://slashdot.org/ [EMAIL PROTECTED] | dtml-var pithy_quote | http://linux.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] Batch.
Hi everybody, I am studying Zope and I saw a batch exemple on the zopebook but I don't know why it does't work properly. I would be glad if any of you could send me a batch exemple to see why the one I saw in the book is not working. Thanks in advance, Rommel Novaes Carvalho ___ 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] Batch processing
Hi, few q'ns concerning batch processing: 1. I want the user to be able to choose a batch-page. So, when a query is done, I want to show something like : previous page 1 - 2 - 3 - 4 - 5 next page. The following code works partly: ie. the one thing missing is that it doesn't shows the current page. How can I implement this? dtml-in address_lookup previous size=5 start=query_start dtml-in previous-batches mapping dtml-unless sequence-startnbsp; /dtml-unless a href="dtml-var document_iddtml-var sequence-queryquery_start=dtml-var batch-start-number" dtml-var "(_.getitem('batch-start-index',0)/_.getitem('batch-size',0))+1"/a /dtml-in /dtml-in dtml-in address_lookup next size=5 start=query_start dtml-in next-batches mapping dtml-unless sequence-startnbsp; /dtml-unless a href="dtml-var document_iddtml-var sequence-queryquery_start=dtml-var batch-start-number" dtml-var "(_.getitem('batch-start-index',0)/_.getitem('batch-size',0))+1"/a /dtml-in /dtml-in dtml-in address_lookup size=5 start=query_start ... /dtml-in 2. Is there an easier way to get what I want? 3. Does the above code means that it has to iterate 3 times over the list? Isn't there a way so that it needs only one pass over the list? Thanks in advance, Tom Deprez. ___ 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] Batch Processing, final
Pfew, I managed to implement the thing I wanted. However I'm not satisfied. There must be an easier solution. If somebody knows which, then please let me know! Thanks. Here is the code I use to display something like in a search result : Previous 1 2 3 4 5 6 Next dtml-in address_lookup size=5 start=query_start dtml-if sequence-start pSearch Result : dtml-var count-CENTRE_NOnbsp;matchesp table width="100%" tr td align="left" width="60" !-- if not first page then show previous button -- dtml-if previous-sequence a href="dtml-var URLdtml-var sequence-queryquery_start=dtml-var previous-sequence-start-number" dtml-var "gif_previous.tag(border='0')"/a /dtml-if /td td align="center" !-- show previous page numbers -- dtml-in address_lookup previous size=5 start=query_start dtml-in previous-batches mapping a href="dtml-var document_iddtml-var sequence-queryquery_start=dtml-var batch-start-number" dtml-var "(_.getitem('batch-start-index',0)/_.getitem('batch-size',0))+1"/a /dtml-in /dtml-in !-- show present page number-- dtml-var "(_.getitem('sequence-index',0)/_.getitem('sequence-step-size',0))+1"/a !-- show next pages numbers-- dtml-in address_lookup next size=5 start=query_start dtml-in next-batches mapping a href="dtml-var document_iddtml-var sequence-queryquery_start=dtml-var batch-start-number" dtml-var "(_.getitem('batch-start-index',0)/_.getitem('batch-size',0))+1"/a /dtml-in /dtml-in /td td align="right" width="60" !-- if not last page then show next button -- dtml-if "((_.getitem('sequence-index',0)+_.getitem('sequence-step-size',0))+1) (_.getitem('count-CENTRE_NO',0))" a href="dtml-var URLdtml-var sequence-queryquery_start=dtml-var "(_.getitem('sequence-index',0)+_.getitem('sequence-step-size',0))+1"" dtml-var "gif_next.tag(border='0')"/a /dtml-if /td /tr /table /dtml-if sequence-start show present page results ... /dtml-in Regards, Tom. ___ 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 )