Just answered my own question....
from the sqlite website: "FOREIGN KEY constraints are parsed but are
not enforced. However, the equivalent constraint enforcement can be
achieved using triggers. The SQLite source tree contains  source code
and  documentation for a C program that will read an SQLite database,
analyze the foreign key constraints, and generate appropriate triggers
automatically."

Dangit I've been banging my head on this for way too long for that to
the be issue....::sigh::

On Mar 11, 6:55 am, robneville73 <[email protected]> wrote:
> Absolutely sure. Here's the deal though, I can't get it fail running
> the nosetests. However, IF I run the server and manually call it in a
> browser, the part that I claim never executes, well it executes just
> fine. I altered my test to verify that the referenced DB object is in
> fact absent before invoking the controller method, still nada. So, it
> works in development.ini but not test.ini. That may well be my problem
> as development.ini is pointing to a PostgresDB and test.ini is a
> sqlite db. Does sqlite not support foreign key refs or something?
> Thanks in advance...
>
> On Mar 11, 3:50 am, Christoph Zwerschke <[email protected]> wrote:
>
> > robneville73 schrieb:
>
> > > I've searched around and I see I'm not the first to ask this...
>
> > >  try:
> > >    DBSession.save(order)
> > >    DBSession.flush()
> > > except IntegrityError:
> > >    THIS NEVER EXECUTES....
>
> > This works for me, with both TG1 and TG2.
>
> > Some things you should check:
>
> > - Are you sure you really *have* an IntegrityError
> >    (because the DBSession maintains unique copies)?
> > - Did you import IntegrityError from sqlalchemy.exceptions?
> > - Do you have the latest zope.sqlalchemy?
>
> > Btw, I also found that bulk deletes only work with the latest
> > zope.sqlalchemy 0.4. Maybe we should make this an requirement in TG2?
>
> > You can check that this work with a quickstarted project, after you have
> > run paster setup-app, like this:
>
> >      from sqlalchemy.exceptions import IntegrityError
> >      p = model.Permission()
> >      p.permission_name = u'manage'
> >      model.DBSession.add(p)
> >      try:
> >          model.DBSession.flush()
> >      except IntegrityError:
> >          raise ValueError("Manager exists!")
>
> > I get the "Manager exists" message in my WebError Traceback.
>
> > -- Christoph
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to