Hey,
Tried adding cascade to Rating's backref call like so:
subrating = relationship("SubRating", backref=backref("rating",
cascade="all, delete-orphan"
uselist=False))
This unfortunately doesn't work - when I delete a Rating, the
according Subratings are NOT removed.
What am I doing wrong? (Testing with SQLite)
On Jul 31, 9:01 am, Stefano Fontanelli <[email protected]>
wrote:
> Il 30/07/11 23.24, Aviv Giladi ha scritto:
>
> > Sorry, but I am really confused.
> > Are you guys saying that on SQLite for example, cascade deletes don't
> > work at all? Or do they work, but are less efficient?
>
> ONUPDATE/ONDELETE cascade -> SQL expression: on SQLite and MySQL MyISAM
> doesn't work at all.
>
> Michael told you that you can reach the same result using the SQLA's
> relationship option:
>
> cascade='all, delete-orphan'
>
> This approach is less efficient because delete actions are performed by
> mapper at the application layer instead of the database: relationship
> collection objects must be loaded into memory then deleted.
>
> Regards,
> Stefano.
>
> --
> Ing. Stefano Fontanelli
> Asidev S.r.l.
> Via Osteria Bianca, 108/A 50053 Empoli (Firenze)
> Tel. (+39) 333 36 53 294 Fax. (+39) 0571 1 979 978
> E-mail: [email protected] Web:www.asidev.com
> Skype: stefanofontanelli
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" 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/sqlalchemy?hl=en.