vlupien at drummonddesigns.com
Tue Dec 2 16:56:12 EST 2003
I have a problem with deferred. I have a wmfactory that return the
results of a sql query but sometimes it occurs that the result is an
sql-exception error because it's an insert query and sometimes the data
are already in the database. When this kind of error occurs, the page is
not render and I got an error.
Here's what I talking about:
templateFile = "message.html"
def initialize(self, theDeferred=None):
# theDeferred is the results of an sql query of an other page
but at the stage of deferred
self.theDeferred = theDeferred
def wmfactory_theDeferred(self, request):
return self.theDeferred #here's where the error occurs. When
the sql queries is ok everything is fine but when it's an sql exception
def wvupdate_message(self, request, widget, data):
print data # I don't want to just print the data
(self.deferred) but it's a test to see what's the problem
<div model="theDeferred" view="message">
The error I got when it's an sql exception:
_mysql_exceptions.IntegrityError: (1062, "Duplicate entry '12345' for
how can I avoid this error?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python