[Z3-sqlos] add and sqlmeta errors
Brian Sutherland
jinty at web.de
Thu Mar 30 19:43:57 CEST 2006
On Thu, Mar 30, 2006 at 06:05:43PM +0200, Stéphane Brault wrote:
> > > create a table object as well as a container. I
> > also
> > > had to add a sqlmeta class. Everything works fine
> > > except :
> > > - when I try to add an object, I get the
> > following
> > > error :
> > > TypeError: Categories() did not get expected
> > keyword
> > > argument CategoryID
> > > I must say that the CategoryID is in the form and
> > is
> > > declared in the class.
> >
> > I've seen this before and believe it is more an
> > issue with SQLObject
> > rather than SQLOS. There may be a better response
> > from the SQLObject
> > docs or list.
> >
> > I seem to remember that SQLObject is very picky with
> > what the names of
> > attributes and columns are. This is especially a
> > problem when you try to
> > use an existing database.
> >
>
> That is why I declared a sqlmeta class in my class,
> the problem only arises with one field, which is
> strange. It doesn't have any problem when retrieving
> the rows or updating.
Yeah, it normally happens when the attribute name is different to what
sqlobject expects. I normally haul out the python debugger at this
point, or start printing out SQL (which you can do by setting debug=1 in
sqlos.adapter).
Hopefully SQLObject 2 will be better about this.
> > > - When I copy paste an object, I get :
> > > PicklingError: Can't pickle <class
> > > 'sqlobject.declarative.sqlmeta'>: attribute lookup
> > > sqlobject.declarative.sqlmeta failed.
> >
> > Are you inheriting from SQLOS and Persistent, or
> > pasting into a
> > persistent container?? Because zope is trying to put
> > your SQLObject into
> > the ZODB...
> >
> > Please bear in mind that SQLOS still doesn't work
> > very well through the
> > ZMI. People have generally been using it for
> > projects where they replace
> > the ZMI completely.
> >
>
> I know this might be asked elsewhere, but is it easy
> to replace the ZMI ?
Replacing the ZMI is actually what people normally do. Just have a look
at https://launchpad.net/ or schooltool (The app, not the website) for
examples.
I have never had a customer I can show the ZMI too;) Normally they want
something simpler with a custom design...
--
Brian Sutherland
Metropolis - "it's the first movie with a robot. And she's a woman.
And she's EVIL!!"
More information about the z3-sqlos
mailing list