[Twisted-web] pgasync (was: /freeform_post!!random causes
exceptions)
J Turner
jamwt-twistedlist at jamwt.com
Thu Feb 17 12:27:30 MST 2005
Andrea,
Thanks for your suggestions; sorry I've taken so long to get back to
them, but I haven't had time to work on pgasync until now...
On Thu, Jan 20, 2005 at 02:15:36AM +0100, Andrea Arcangeli wrote:
> Next thing I had to fix to be able to login has been to add this:
[snip bool patch]
I've patched that in, thanks.
> With the above a good part of my app started working. But it's not enough.
>
> Here a list of the remaining issues (which I believe aren't related anymore to
> the API, as far as I'm concerned the current adbapi wrapper is all I need ;).
>
> 1) the '%(xx)d' format for integeres/logs insn't recognized. I'd like to use
> "%(xx)d" to be strict for integers.
This is fixed.
> btw, is there any difference in python between %u and %d at all?
Nope, I don't think so.
> 2) it cannot handle a ";" at the end of the sql string. so I deleted all the
> finals ";" and I left only the intermediate ones.
This is fixed as well.
> 3) it doesn't print the nevow url type, note that such parameter is just
> incidentally passed down to the sql query, and pgasync should ignore it
> instead of complaining since it never gets resolved
It's not trival to determine whether or not something gets resolved. If
it's a keyword argument situation, then I need to search the format
string for some variation of %(keyword)s. If it's just tuple-style,
then I need to count the number of %s/d/whatevers and determine whether
or not it's beyond the limit.
This seems ugly, and needlessly expensive for a corner case; I think the
right answer is, only pass things to format() that are intended to be
formatted and made safe for insertion into SQL.
But, then again, maybe I'm misunderstanding you.
- Jamie
More information about the Twisted-web
mailing list