i see. thank you Oleg.
------------------ Original ------------------
From: "Oleg Broytman"<p...@phdru.name>;
Date: 2015??12??20??(??????) ????10:16
To: "sqlobject-discuss"<sqlobject-discuss@lists.sourceforge.net>;
Subject: Re: [SQLObject] sqlobject how to limit return column list
hi!
On Sun, Dec 20, 2015 at 09:38:56PM +0800, QQ???? <171958...@qq.com> wrote:
> Hi. I love sqlojbect very much.
> Please forgive my poor English,
You're welcome!
> Example code:
>
> class MyUser(SQLObject):
> name=StringCol()
> mobile=StringCol()
> ??.
> depart=StringCol()
> sex =StringCol()
>
> i want limit return column,
> data=MyUser.selectBy(depart=??xxx??,items=[??name??,??sex'])
>
> only name and sex column in data.
>
> Any help would be much appreciated!
When you use high-level SQLObject interface (like SQLObject.select,
selectBy and such) the result is always a list of SQLObject instances,
instances of MyUser in your example, and every instance must have data
for all column filled in.
If you want to execute less SQLObject-aware queries use Select from
SQLBuilder: http://sqlobject.org/SQLBuilder.html#select
Oleg.
--
Oleg Broytman http://phdru.name/ p...@phdru.name
Programmers don't die, they just GOSUB without RETURN.
------------------------------------------------------------------------------
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
------------------------------------------------------------------------------
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss