Bugs item #1546294, was opened at 2006-08-25 02:11
Message generated for change (Comment added) made by phd
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: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Rick Copeland (rick446)
>Assigned to: Oleg Broytmann (phd)
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)
----------------------------------------------------------------------
>Comment By: Oleg Broytmann (phd)
Date: 2006-09-05 17:51
Message:
Logged In: YES
user_id=4799
Fixed with the patch 1546314.
----------------------------------------------------------------------
Comment By: Rick Copeland (rick446)
Date: 2006-08-25 02:46
Message:
Logged In: YES
user_id=1583356
I have created patch #1546314 to address this bug.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1546294&group_id=74338
|