1) Is there shortcut for this in the ForeignKey() constructor? No 2) Is this considered typical SQLAlchemy code? Yes, but look at declarative also; I find that to be more intuitive
3) Can this relation's objects be made "read-only"? That is: "u.room = new_room" would work, but this would not: "u.room.name = 'kitchen'" I don't think so, someone else would have to give a definitive answer -- Mike Conley On Wed, Jun 17, 2009 at 10:14 AM, allen.fowler <allen.fow...@yahoo.com>wrote: > > > > 3) Can this relation's objects be made "read-only"? That is: > > "u.room = new_room" would work, but this would not: "u.room.name = > > 'kitchen'" > > > > To clarify the question: > > Can this objects seen via this relation be made "read-only"? That is: > > u.room = a_room > u.room = a_new_room > ...would work fine. > > And this would work, too: > r = session.query(u.room).one() > r.name = "kitchen" > > But, this would not: > u.room.name = 'kitchen' > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---