Bugs item #1546294, was opened at 2006-08-24 18:11
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1546294&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: SQLObject release (specify)
Status: Open
Resolution: None
Priority: 5
Submitted By: Rick Copeland (rick446)
Assigned to: Nobody/Anonymous (nobody)
Summary: inheritance and cascade='null' do not work together
Initial Comment:
(Based on development version 0.8dev_r1883)
Start with the following schema:
class A(InheritableSQLObject):
dummy=IntCol()
class B(A):
c=ForeignKey('C', cascade='null')
class C(SQLObject):
dummy=IntCol()
C.createTable()
A.createTable()
B.createTable()
c=C(dummy=1)
b=B(cID=c.id, dummy=1)
c.destroySelf()
***exception***
This can be fixed by updating SQLObject.destroySelf to
use SQLBuilder by the following changes:
in sqlobject/main.py:
(insert at top)
from sqlbuilder import OR
(replacing line starting with "query.append("%s = (%...
query.append(getattr(k.q, col.name)==self.id)
(replacing line "' OR '.join(query)")
query=OR(*query)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1546294&group_id=74338
|