[Zope] zSQl and changing connection ids?
David Hassalevris
bluepaul@bluepaul.com
Mon, 02 Apr 2001 21:14:52 -0700
First, I would like to thank Dieter for his quick (and deflating)
response.
Ok, I was afraid of something like this. Let me ask the "Zope
collective" this:
How much work would be involved in creating an "alternative" zSQL method
(product?) that would accept the "connection id" as a parameter? This
seems like such a natural.
Anyone found/thought of yet another solution? (Dieter - yes I am looking
for an easier way out :-)
>
> David Hassalevris writes:
> > ....
>
> A Z SQL method consists of
>
> the connection id,
> the parameters
> and the SQL template
>
> You want to share the parameters and the template but vary
> the connection id.
>
Dieter, that wasnt fair, you phrased my own question much more
elegantly.
> I think it is not a good idea to dynamically change the
> connection id to handle this case. You object would
> be changed continously and create lots of artificial
> versions - a bad thing.
>
No such luck as "local copies"? The object manager always "commits"
changes? (hey Im new I can ask this stuff!)
> I would create several SQL methods that share a common
> SQL template. I fear, you would need to replicate
> the parameter parts.
>
> Thus, you would have:
>
> Z SQL method<n>:
>
> Connection: different ones according to object
> Parameters: explicit copies of the parameter list
> Template: <dtml-var common-template>
>
> It may be (I fear it will be) that you can not use
> "dtml-sql*" tags in "common-template".
> In this case, you have 2 options:
(waves of fear n loathing)
>
> * emulate the "dtml-sql*" tags by normal tags
>
> * make a small product that makes the "dtml-sql*" tags
> generally available
>
> Dieter
Thanks Dieter, btw I just printed out your Zope book. I suppose I
should read it.