<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content=Word.Document name=ProgId>
<META content="MSHTML 6.00.2734.1600" name=GENERATOR>
<META content="Microsoft Word 10" name=Originator><LINK
href="cid:filelist.xml@01C3B8F5.308AFFE0" rel=File-List><!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:DoNotRelyOnCSS/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:SpellingState>Clean</w:SpellingState>
<w:GrammarState>Clean</w:GrammarState>
<w:DocumentKind>DocumentEmail</w:DocumentKind>
<w:HyphenationZone>21</w:HyphenationZone>
<w:EnvelopeVis/>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<STYLE>@font-face {
        font-family: Verdana;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 70.85pt 70.85pt 70.85pt 70.85pt; mso-header-margin: 35.4pt; mso-footer-margin: 35.4pt; mso-paper-source: 0; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
SPAN.StyleCourrierlectronique17 {
        COLOR: windowtext; FONT-FAMILY: Arial; mso-style-type: personal-compose; mso-style-noshow: yes; mso-ansi-font-size: 10.0pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial
}
P.error {
        FONT-WEIGHT: bold; FONT-SIZE: 12pt; MARGIN-LEFT: 0cm; COLOR: red; MARGIN-RIGHT: 0cm; FONT-FAMILY: Verdana; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"; mso-style-name: error; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
LI.error {
        FONT-WEIGHT: bold; FONT-SIZE: 12pt; MARGIN-LEFT: 0cm; COLOR: red; MARGIN-RIGHT: 0cm; FONT-FAMILY: Verdana; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"; mso-style-name: error; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
DIV.error {
        FONT-WEIGHT: bold; FONT-SIZE: 12pt; MARGIN-LEFT: 0cm; COLOR: red; MARGIN-RIGHT: 0cm; FONT-FAMILY: Verdana; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"; mso-style-name: error; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
        {mso-style-name:"Tableau Normal";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";}
</style>
<![endif]--></HEAD>
<BODY lang=FR style="tab-interval: 35.4pt" vLink=purple link=blue
bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Your error has nothing to do with deferred. The
error is coming from MySQL and it probably means your trying to insert duplicate
values in a primary key field or some other field which must be uniqe in your
table.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thomas</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=vlupien@drummonddesigns.com
href="mailto:vlupien@drummonddesigns.com">vicky lupien</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=twisted-python@twistedmatrix.com
href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, December 02, 2003 10:56
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Twisted-Python] deferred</DIV>
<DIV><BR></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA">I have a
problem with deferred. <SPAN style="mso-spacerun: yes"> </SPAN>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.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA">Here’s
what I talking about:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA">class
MessagePage(pages.BasePage):<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA"><SPAN
style="mso-spacerun: yes"> </SPAN>templateDirectory =
str(os.sep).join([pages.BasePage().templateDirectory])<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA"><SPAN
style="mso-spacerun: yes"> </SPAN>templateFile =
"message.html"<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA"><SPAN
style="mso-spacerun: yes">
</SPAN><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA"><SPAN
style="mso-spacerun: yes"> </SPAN>def initialize(self,
theDeferred=None):<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA"><SPAN
style="mso-spacerun: yes">
</SPAN># theDeferred is the results of an sql query of an other page but at
the stage of deferred<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA"><SPAN
style="mso-spacerun: yes">
</SPAN>self.theDeferred = theDeferred<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA"><SPAN
style="mso-spacerun: yes">
</SPAN><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA"><SPAN
style="mso-spacerun: yes">
</SPAN><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA"><SPAN
style="mso-spacerun: yes"> </SPAN>def
wmfactory_theDeferred(self, request):<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA"><SPAN
style="mso-spacerun: yes">
</SPAN>return self.theDeferred<SPAN style="mso-spacerun: yes">
</SPAN>#here’s where the error occurs.<SPAN style="mso-spacerun: yes">
</SPAN>When the sql queries is ok everything is fine but when it’s an sql
exception it breaks<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA"><SPAN
style="mso-spacerun: yes">
</SPAN><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA"><SPAN
style="mso-spacerun: yes"> </SPAN>def wvupdate_message(self,
request, widget, data):<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: EN-CA"><SPAN
style="mso-spacerun: yes">
</SPAN>print data<SPAN style="mso-spacerun: yes"> </SPAN># I don’t want
to just print the data (self.deferred) but it’s a test to see what’s the
problem<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA">My
template:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA"><html><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA"><SPAN
style="mso-tab-count: 1">
</SPAN><head><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA"><SPAN
style="mso-tab-count: 1">
</SPAN></head><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA"><SPAN
style="mso-tab-count: 1">
</SPAN><body><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA"><SPAN
style="mso-tab-count: 1">
</SPAN><SPAN
style="mso-tab-count: 1">
</SPAN><br /><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA"><SPAN
style="mso-tab-count: 1">
</SPAN><SPAN
style="mso-tab-count: 1">
</SPAN><br /><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA"><SPAN
style="mso-tab-count: 1">
</SPAN><SPAN
style="mso-tab-count: 1">
</SPAN>ALLO<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA"><SPAN
style="mso-tab-count: 1">
</SPAN><SPAN
style="mso-tab-count: 1">
</SPAN><div model="theDeferred"
view="message"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA"><SPAN
style="mso-tab-count: 1">
</SPAN><SPAN
style="mso-tab-count: 1">
</SPAN></div><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA"><SPAN
style="mso-tab-count: 1">
</SPAN></body><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA"></html><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA">The error I got when it’s an
sql exception:<o:p></o:p></SPAN></FONT></P>
<P class=error><B><FONT face=Verdana color=red size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA">_mysql_exceptions.IntegrityError:
(1062, "Duplicate entry '12345' for key 2")<o:p></o:p></SPAN></FONT></B></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA">how can I avoid this
error?<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-CA
style="FONT-SIZE: 12pt; mso-ansi-language: EN-CA">vicky<o:p></o:p></SPAN></FONT></P></DIV></BLOCKQUOTE></BODY></HTML>