[sqlalchemy] Re: How to map a Selectable such that objects can be created/inserted, updated, and deleted?
mapper() has a selectable= argument, go read about it. it can do just about anything u fancy. Is there a way to create object mappers with bean managed persistence, as the Java folks would call it? What I would like to do is to map a class to a Selectable such as a join. Now when an object is created, its attributes should be inserted into several tables. Likewise, updates or deletes of objects should spread over several tables. For this to happen, I think I would need to hook into the ORM. Any ideas? I'm afraid that this is connected with the VIEWs on the sqlalchemy todo list. Best regards, Klaus --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: How to map a Selectable such that objects can be created/inserted, updated, and deleted?
Sorry but I don't see how the select_table parameter (used in inheritance hierarchies) relates to my question. Selecting things from a Selectable is not much of a problem, for example, and I need more than one table. On 18 Jun., 13:00, svilen [EMAIL PROTECTED] wrote: mapper() has a selectable= argument, go read about it. it can do just about anything u fancy. Is there a way to create object mappers with bean managed persistence, as the Java folks would call it? What I would like to do is to map a class to a Selectable such as a join. Now when an object is created, its attributes should be inserted into several tables. Likewise, updates or deletes of objects should spread over several tables. For this to happen, I think I would need to hook into the ORM. Any ideas? I'm afraid that this is connected with the VIEWs on the sqlalchemy todo list. Best regards, Klaus --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: How to map a Selectable such that objects can be created/inserted, updated, and deleted?
The MapperExtension might be what I need, however. On 18 Jun., 13:48, [EMAIL PROTECTED] wrote: Sorry but I don't see how the select_table parameter (used in inheritance hierarchies) relates to my question. Selecting things from a Selectable is not much of a problem, for example, and I need more than one table. On 18 Jun., 13:00, svilen [EMAIL PROTECTED] wrote: mapper() has a selectable= argument, go read about it. it can do just about anything u fancy. Is there a way to create object mappers with bean managed persistence, as the Java folks would call it? What I would like to do is to map a class to a Selectable such as a join. Now when an object is created, its attributes should be inserted into several tables. Likewise, updates or deletes of objects should spread over several tables. For this to happen, I think I would need to hook into the ORM. Any ideas? I'm afraid that this is connected with the VIEWs on the sqlalchemy todo list. Best regards, Klaus --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: How to map a Selectable such that objects can be created/inserted, updated, and deleted?
On Jun 18, 2007, at 4:13 AM, [EMAIL PROTECTED] wrote: Is there a way to create object mappers with bean managed persistence, as the Java folks would call it? What I would like to do is to map a class to a Selectable such as a join. Now when an object is created, its attributes should be inserted into several tables. Likewise, updates or deletes of objects should spread over several tables. For this to happen, I think I would need to hook into the ORM. Any ideas? I'm afraid that this is connected with the VIEWs on the sqlalchemy todo list. map directly to the select() (or join()) of your choice. SQLAlchemy identifies the Table objects which comprise the select when it does insert/update/delete operations, and operates upon those for which it can formulate a primary key. http://www.sqlalchemy.org/docs/ adv_datamapping.html#advdatamapping_selects --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: How to map a Selectable such that objects can be created/inserted, updated, and deleted?
On Jun 18, 2007, at 7:00 AM, svilen wrote: mapper() has a selectable= argument, go read about it. it can do just about anything u fancy. select_table is only used for polymorphic inheritance situations such that a mapper's select operations occur via a different selectable than that which the base mapper is mapped against. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---