[SQLObject] problem while _get_ function with parameter
hi all I meet a problem I write a _get_ function in my class: class Page(SQLObject): ... def _get_link_copy_by_space(self, space_id): return None And while I call this function by such code: page = Page.get(page_id) page.link_copy_by_space(space.id) sqlobject give me this error: TypeError: _get_link_copy_by_space() takes exactly 2 arguments (1 given) I dont know what is the argument I missed. -- with kind regards - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
Re: [SQLObject] Vacation
> Hello everyone. Hello and goodbye! I am leaving the town for a vacation. > >Please do not stop asking and answering questions. Help each other. > Discuss bugs and patches in the list, submit them to the Trac or SF > tracker. > >I'll be back in the beginning of June. > > Oleg. Have a good time! - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
[SQLObject] How to detect the attribute names....
Hi All, How do I discover, at runtime, the attribute names used in a resultlist like this one. list(alist) [] Thanks, Frans. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
Re: [SQLObject] Why?, what am I doing wrong or do not understand.
Hi Christopher Thanks, sometimes you need a kick.:-) I did not realize that AddressBookDB is the name of a module, written by me and imported withfrom AddressBookDB import * Thanks again. Frans. Christopher Singley wrote: > Frans, > > Your problem is not with SQLObject, it's just standard Python namespace > confusion. > > To have a look at your namespace, type dir(). You will find that one entry > on > the list is 'Family', but you shouldn't find 'AddressBookDB' on the list. > > If you want to define AddressBookDB in your namespace, try this: > import AddressBookDB > dir() > > Or else, to simply do what you want to do with your existing namespace, try > this: > type(blist[0])==Family > > Hope that helps. > > On Thursday 17 May 2007 06:44, F.A. Pinkse wrote: >> Hi All, >> >> While trying to refactor my app, I found out that there are more than >> one type of resultlists returned with and within the Results of a select. >> >> >> I use Boa constructor debug mode. >> >> When I do: >> >> Db> blist=Family.select() >> >> Db> type(blist) >> >> >> >> Db> type(blist)==sqlobject.sresults.SelectResults >> >> True >> >> >> But...when I continue. >> >> Db> blist[0] >> >> >> >> Db> type(blist[0]) >> >> >> >> Db> type(blist[0])==AddressBookDB.Family >> >> NameError: name 'AddressBookDB' is not defined >> >> >> Do I do something wrong or do I not understand something? >> Who can help me out. >> >> >> With best regards, >> >> >> Frans. >> >> >> >> - >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> ___ >> sqlobject-discuss mailing list >> sqlobject-discuss@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss > > - > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
Re: [SQLObject] Why?, what am I doing wrong or do not understand.
Frans, Your problem is not with SQLObject, it's just standard Python namespace confusion. To have a look at your namespace, type dir(). You will find that one entry on the list is 'Family', but you shouldn't find 'AddressBookDB' on the list. If you want to define AddressBookDB in your namespace, try this: import AddressBookDB dir() Or else, to simply do what you want to do with your existing namespace, try this: type(blist[0])==Family Hope that helps. On Thursday 17 May 2007 06:44, F.A. Pinkse wrote: > Hi All, > > While trying to refactor my app, I found out that there are more than > one type of resultlists returned with and within the Results of a select. > > > I use Boa constructor debug mode. > > When I do: > > Db> blist=Family.select() > > Db> type(blist) > > > > Db> type(blist)==sqlobject.sresults.SelectResults > > True > > > But...when I continue. > > Db> blist[0] > > > > Db> type(blist[0]) > > > > Db> type(blist[0])==AddressBookDB.Family > > NameError: name 'AddressBookDB' is not defined > > > Do I do something wrong or do I not understand something? > Who can help me out. > > > With best regards, > > > Frans. > > > > - > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ___ > sqlobject-discuss mailing list > sqlobject-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
[SQLObject] Why?, what am I doing wrong or do not understand.
Hi All, While trying to refactor my app, I found out that there are more than one type of resultlists returned with and within the Results of a select. I use Boa constructor debug mode. When I do: Db> blist=Family.select() Db> type(blist) Db> type(blist)==sqlobject.sresults.SelectResults True But...when I continue. Db> blist[0] Db> type(blist[0]) Db> type(blist[0])==AddressBookDB.Family NameError: name 'AddressBookDB' is not defined Do I do something wrong or do I not understand something? Who can help me out. With best regards, Frans. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
Re: [SQLObject] How to use Update
ro <[EMAIL PROTECTED]> writes: > Page._connection.query(Page._connection.sqlrepr(Update(Page.sqlmeta.table, > > {"synchronized": True}, > > where=Page.q.space_id==1))) Try: Page.q.spaceID -- Jorge Godoy <[EMAIL PROTECTED]> - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
Re: [SQLObject] How to use Update
On 5/17/07, ro <[EMAIL PROTECTED]> wrote: > On 5/16/07, Oleg Broytmann <[EMAIL PROTECTED]> wrote: > > Page._connection.query(Page._connection.sqlrepr( > > Update(Page.sqlmeta.table, {"synchronized": True}, where=Space.q.id==1) > > )) > > > > Sorry, I am trying this code now, but it does not work. > The error is > > OperationalError: (1054, "Unknown column 'space.id' in 'where clause'") > > I think maybe I need use the column in Page class, so I change the code : > > Page._connection.query(Page._connection.sqlrepr(Update(Page.sqlmeta.table, > > {"synchronized": True}, > > where=Page.q.space_id==1))) > > And the error change to: > AttributeError: Page instance has no attribute 'space_id' > > If I write Page.q.space, the error is > AttributeError: Page instance has no attribute 'space' > > But I am sure there is space in Page class I think I have got the correct column by print Page.sqlmeta.columns I dont know why the columns is different with that I wrote in Page class and the true column in database. -- with kind regards - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
Re: [SQLObject] How to use Update
On 5/16/07, Oleg Broytmann <[EMAIL PROTECTED]> wrote: > On Wed, May 16, 2007 at 08:36:00PM +0800, ro wrote: > > I need to update all of records' synchronized attribute to 'True' in > > page table where the space.id is 1. > > > > from sqlobject.sqlbuilder import Update > > Update(Page.sqlmeta.table, True, ..., "Space.q.id=1") > > Update is a low-level object, you have to convert it to an SQL query > and run the query yourself: > > Page._connection.query(Page._connection.sqlrepr( > Update(Page.sqlmeta.table, {"synchronized": True}, where=Space.q.id==1) > )) > Sorry, I am trying this code now, but it does not work. The error is OperationalError: (1054, "Unknown column 'space.id' in 'where clause'") I think maybe I need use the column in Page class, so I change the code : Page._connection.query(Page._connection.sqlrepr(Update(Page.sqlmeta.table, {"synchronized": True}, where=Page.q.space_id==1))) And the error change to: AttributeError: Page instance has no attribute 'space_id' If I write Page.q.space, the error is AttributeError: Page instance has no attribute 'space' But I am sure there is space in Page class -- with kind regards - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss