anyone have an idea? this prevents me from developing further. Thank you in advance.
On Apr 1, 1:33 pm, snf <[email protected]> wrote: > Hi, > > I'm trying to implement a soap interface that will allow me to pass > pure sqlalchemy objects as a reponse. I'm using the declarative based > table definition and a soaplib library to do that. The project is a > pylons project. > > The problem is that when i do: > > from project.model.meta import Base # declarative base > from soaplib.serializers.clazz import ClassSerializer > from soaplib.serializers.primitive import Integer > > <quote> > class Resource(Base, ClassSerializer): > > # ...field definitions follow... > > # then i define soap types of the fields > class types: > id = Integer > subid = Integer > > </quote> > > I had a problem with multiple __metaclass__ definitions, which i > overcame with this snippet: > > http://code.activestate.com/recipes/204197-solving-the-metaclass-conf... > > so I added: > > __metaclass__ = classmaker() > > after: > > class Resource(Base, ClassSerializer): > > and the problem was solved. But now in my controller, when I try to > return this object: > > <quote> > @soap_method(soap_str, _returns = Resource) > def get(self, name): > agent = > db_session.query(Resource).filter(Resource.name==name).first() > return agent > </quote> > > I get an error: > > type object 'Resource' has no attribute 'soap_members' > > which is set by the soaplib's ClassSerializer's __metaclass__ in > theory (I looked through the code). So it seems that the multiple > __metaclass__ hack (mentioned above) is not firing the __call__ method > of ClassSerializer's __metaclass__ > > Does any one have any idea how to overcome that? Is it even possible? -- 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.
