[Zope3-Users] zalchemy in ZMI

David Pratt fairwinds at eastlink.ca
Wed Aug 9 11:15:44 EDT 2006

Hi Carlo.

As a workaround to get objects into the db you can comment out the 
following lines in checkName like this:

     def checkName(self, name, container):
         if isinstance(name, str):
             name = unicode(name)
         elif not isinstance(name, unicode):
             raise TypeError("Invalid name type", type(name))

         #unproxied = removeSecurityProxy(container)
         #if not name.startswith(unproxied._class.__name__+'.'):
         #  raise UserError("Invalid name for SQLAlchemy object")
         return True

If you plan on using it, the container implementation needs some work 
and there is currently no adapter for deleting objects (see TODO.txt) I 
am grateful though for the efforts to get the package this far along and 
for the transaction integration work particularly.


Carlo Cardelli wrote:
> Hi all,
> I have an error trying to get zalchemy working in the ZMI.
> - I created an SQLAlchemyContainer named cCustomer;
> - In its "class" attribute I put the path to my content class 
> "Customer", marked with the ISQLAlchemyObject interface and 
> as-far-as-i-can-see well mapped with a 'customerTable' db-model;
> - When trying to add a Customer object (just submitting the name of the 
> new object in the 'adding' form, not in the subsequent 'edit' form), I 
> get an error from zalchemy.container.SQLAlchemyNameChooser in the method 
> 'checkName':
> <Customer> object has no attribute '_class'
> Looking at the code, seems like the method wants to be given the 
> 'container' object, but get instead the 'contained' one.
> I am working with the 'trunk' version of zalchemy and Zope 3.3.0b1.
> I am still a newbie, so it is very likely I am getting something wrong.
> Any hint?
> Thank you in advance.
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users

More information about the Zope3-users mailing list