[Twisted-Python] Questions about class KeyFactory.
thomas at copyleft.no
Wed Dec 8 06:30:59 EST 2004
I my a bit afraid im asking a stupid question here, I'll do it anyways
warnings.warn("This is deprecated. Use the underlying database to
generate keys, or just roll your own.", DeprecationWarning)
As the warnings says this class is deprecated. Use the underlying
database. I was wondering if anybody have some example code for this. Im
using a PgDB.
Here's my rowObject:
rowColumns = [
rowKeyColumns = [("testId","int")]
rowTableName = "dummytable"
And my sql code:
CREATE TABLE dummytable (
testId SERIAL PRIMARY KEY,
So when using a sequencer to generate an unique key for testId, I dont
need to supply testId in my insert sql statement. But twisted complains if
i dont use the assignKeyAttr function, PG complains if I use it with a
value thats already used (ofcourse).
My insert code
b = DummyRow()
b.testName = "myTestName"
b.testData = "My test data string"
Again if was wondering if somebody had some sample code to help me solve
my problem or a point in the right direction.
Thanks in advance,
More information about the Twisted-Python