Please, can anybody tell me what's the meaning of 'non_primary' arg of mapper function.
I probably misunderstood it but I'd like to know what it is meant for. thanks sandro On Thu, Jul 01, 2010 at 10:41:44AM -0700, sandro dentella wrote: > Hi, > > I'm trying to use non_primary arg of function 'mapper'. > > > Currently I have a GUI widget to browse/edit tables that is based on > introspection of the mapper. > > My goal would be to reuse all the machinary of table browsing even > when browsing tables that where built w/o primary key. > > I'm ready to understand that I can't use persistence but I thought > that flagging as a non primary mapper I could assemble a mapper even > from a table missing a primary_key, that's what I thought was the > meaning of: "Construct a Mapper that will define only the selection of > instances, not their persistence." > > What I get is: > > ipdb> mapper(X, table, non_primary=True) > *** ArgumentError: Mapper Mapper|lavori_class|lavori|non-primary could > not assemble any primary key columns for mapped table 'lavori' > > So what's the real meaning of primary_key? > > > thanks > > sandro > *:-) -- Sandro Dentella *:-) http://sqlkit.argolinux.org SQLkit home page - PyGTK/python/sqlalchemy -- 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.
