How to specify caching for ZSQL methods on file system
I have some ZSQL methods written on the file system using FSDV. In ZMI I can not find the 'Advanced' tab usually available for ZSQL methods in ZODB for specifying the caching properties of the ZSQL method. Can anyone give some clues as how to do this for ZSQL on FSDV? I suppose I might need to write some *.metadata file to specify these properties using FSDV? -- Hong Yuan 大管家网上建材超市 装修装潢建材一站式购物 http://www.homemaster.cn
On 2 Mar 2006, at 14:15, Yuan HOng wrote:
I have some ZSQL methods written on the file system using FSDV. In ZMI I can not find the 'Advanced' tab usually available for ZSQL methods in ZODB for specifying the caching properties of the ZSQL method.
Can anyone give some clues as how to do this for ZSQL on FSDV? I suppose I might need to write some *.metadata file to specify these properties using FSDV?
Here is an example taken from the unit test data at... /path/to/CMFCore/tests/fake_skins/fake_skin/testsql.zsql <dtml-comment> title : This is a title connection id : testconn arguments : id max_rows : 1000 max_cache : 100 cache_time : 10 class_name : MyRecord class_file : CMFCore.TestRecord connection_hook : MyHook allow_simple_one_argument_traversal : 1 </dtml-comment> FROM test_table SELECT * WHERE <dtml-sqltest id type="string"> jens P.S.: The list for CMF-related questions is zope-cmf@zope.org.
On 3/2/06, Yuan HOng <hongyuan1306@gmail.com> wrote:
Can anyone give some clues as how to do this for ZSQL on FSDV? I suppose I might need to write some *.metadata file to specify these properties using FSDV?
You must specify the cache settings in the .zsql file itself, using a <dtml-comment> block at the top. Here is an example: <dtml-comment> title: Retrieve the per_id of a given uid connection_id: portal_cvix arguments: uid cache_time: 10 </dtml-comment> 'cache_time: 10' sets the caching time to 10 seconds. -- Martijn Pieters
You are close ;-) The info goes into a <dtml-comment> block at the start of the file. <dtml-comment> title: Foo arguments: foo bar max_rows: 1000 max_cache: 100 cache_time: 60 </dtml-comment> ... Stefan On 2. Mär 2006, at 15:15, Yuan HOng wrote:
I have some ZSQL methods written on the file system using FSDV. In ZMI I can not find the 'Advanced' tab usually available for ZSQL methods in ZODB for specifying the caching properties of the ZSQL method.
Can anyone give some clues as how to do this for ZSQL on FSDV? I suppose I might need to write some *.metadata file to specify these properties using FSDV?
-- Hong Yuan
-- Anything that happens, happens. --Douglas Adams
participants (4)
-
Jens Vagelpohl -
Martijn Pieters -
Stefan H. Holek -
Yuan HOng