ok, got this solved, the solution was to provide the
manytoone relation as well with the arguments :

   passive_deletes = 'all',
   viewonly = True,

On Aug 10, 12:56 pm, erikj <[email protected]> wrote:
> Hi,
>
> I have a table and a view mapped to objects
> as such :
>
> class A(object):
>    mapped to a table
>    with a primary key column id
>    with a onetomany attribute list_of_b, being a relation
>    to all rows of B with a_id == self.id
>
> class B(object):
>    mapped to a view
>    with a column a_id being a reference to the id column of A
>
> Since B is mapped to a view, no updates should happen on B.
>
> So, in A, the list_of_b relation is configured with :
>
>   passive_updates = True,
>   passive_deletes = 'all',
>   viewonly = True,
>   cascade = False
>
> But whenever an object of A is deleted, sqlalchemy tries to update
> the a_id columns of all rows of B that were loaded in memory, which
> of course should not happen, since B is a view.
>
> I have tried various permutations of the possible relationship
> configurations,
> but without success.
>
> Is it possible to solve this ?  Can one mark a table or even a column
> as
> non writable ?
>
> Thank you and best regards,
>
> Erik

-- 
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.

Reply via email to