On Jun 1, 2010, at 2:39 PM, ObjectEvolution wrote: > Hi, > > My project has a BASE table which contains all base objects. There is > a column called DELETED which has a value of 0 or 1. Finally, there is > V_BASE which is a view of BASE that only shows objects not deleted. > > I can work with my Base object easily but when I want to view deleted > objects there isn't any reference to them. What I'm looking for, I > think, is multiple mappers for my Base class. But, some questions:
already, what you say is confusing. Is a row in V_BASE also in BASE ? what would be "referenced" here ? wouldnt each BASE simply have the "DELETED" attribute? > > 1. In my second mapper I can't redefine properties, correct? But do I > get all the properties from the first mapper? you get all the properties from the table or selectable you are mapping onto. They need to match that of the original mapper since we are instrumenting those attributes on the class. > 2. The only difference in the second mapper is that it maps to the > BASE table and not the V_BASE view; should the syntax be the same as > the first mapper with the addition of non_primary=True? I would think that non_primary=True would be on the view, the primary mapper is usually on the underlying table, i.e. that which encompasses all rows and is mutable. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@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.