Re: [Zope] File referencing and LocalFS
> 1)Folders names are directly related to string fields > in a MySQL database which use spaces between words (eg > New York), but folders names don't use spaces (eg > NewYork). How can I skip spaces from database fields to > make them refer to these folders (eg New York --> > NewYork)? _.string.replace(folder_name, " ", "") This will return a string with the spaces removed, if 'folder_name' is a string variable containing the folder name (with spaces). > > 2)Using LocalFS, can I do something like var "localfsObject[''].[' par11>'], where par1 and par11 are folder names (after > skiping spaces)? You can't nest dtml like this. Just use: (also note that I removed the . between [par1] and [par11]) See http://www.zope.org/Members/jfarr/HowTo/DTML_with_LocalFS for more information on using DTML with Local File System objects. --jfarr ___ 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] File referencing and LocalFS
Hi Marco, From: Marco Mariani [mailto:[EMAIL PROTECTED]] Subject: Re: [Zope] File referencing and LocalFS >> >> foldername = string.join(colname, '') >> >> using a "blank" ('') between each string, in other words, with no delimiter. >Maybe you meant >foldername = string.join(string.split(colname,' '),'') >or >foldername = string.replace(colname,' ','') >because join takes a list, not a string. Yes, you are correct! Later, Jerry S. ___ 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] File referencing and LocalFS
Rogerio Atem de Carvalho writes: > I am using LocalFS to refer to a directory structure > like this: > > folder1 > | > folder11 > > There are image (.jpg) files in both folders. I have > two questions about this: > > 1)Folders names are directly related to string fields > in a MySQL database which use spaces between words (eg > New York), but folders names don't use spaces (eg > NewYork). How can I skip spaces from database fields to > make them refer to these folders (eg New York --> > NewYork)? gives you the folder name. "opens" the folder object. You now can use "" to access the object with name *id* in the folder. Dieter ___ 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 )