sqlobject-discuss Mailing List for SQLObject (Page 28)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
(2) |
Mar
(43) |
Apr
(204) |
May
(208) |
Jun
(102) |
Jul
(113) |
Aug
(63) |
Sep
(88) |
Oct
(85) |
Nov
(95) |
Dec
(62) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(38) |
Feb
(93) |
Mar
(125) |
Apr
(89) |
May
(66) |
Jun
(65) |
Jul
(53) |
Aug
(65) |
Sep
(79) |
Oct
(60) |
Nov
(171) |
Dec
(176) |
| 2005 |
Jan
(264) |
Feb
(260) |
Mar
(145) |
Apr
(153) |
May
(192) |
Jun
(166) |
Jul
(265) |
Aug
(340) |
Sep
(300) |
Oct
(469) |
Nov
(316) |
Dec
(235) |
| 2006 |
Jan
(236) |
Feb
(156) |
Mar
(229) |
Apr
(221) |
May
(257) |
Jun
(161) |
Jul
(97) |
Aug
(169) |
Sep
(159) |
Oct
(400) |
Nov
(136) |
Dec
(134) |
| 2007 |
Jan
(152) |
Feb
(101) |
Mar
(115) |
Apr
(120) |
May
(129) |
Jun
(82) |
Jul
(118) |
Aug
(82) |
Sep
(30) |
Oct
(101) |
Nov
(137) |
Dec
(53) |
| 2008 |
Jan
(83) |
Feb
(139) |
Mar
(55) |
Apr
(69) |
May
(82) |
Jun
(31) |
Jul
(66) |
Aug
(30) |
Sep
(21) |
Oct
(37) |
Nov
(41) |
Dec
(65) |
| 2009 |
Jan
(69) |
Feb
(46) |
Mar
(22) |
Apr
(20) |
May
(39) |
Jun
(30) |
Jul
(36) |
Aug
(58) |
Sep
(38) |
Oct
(20) |
Nov
(10) |
Dec
(11) |
| 2010 |
Jan
(24) |
Feb
(63) |
Mar
(22) |
Apr
(72) |
May
(8) |
Jun
(13) |
Jul
(35) |
Aug
(23) |
Sep
(12) |
Oct
(26) |
Nov
(11) |
Dec
(30) |
| 2011 |
Jan
(15) |
Feb
(44) |
Mar
(36) |
Apr
(26) |
May
(27) |
Jun
(10) |
Jul
(28) |
Aug
(12) |
Sep
|
Oct
|
Nov
(17) |
Dec
(16) |
| 2012 |
Jan
(12) |
Feb
(31) |
Mar
(23) |
Apr
(14) |
May
(10) |
Jun
(26) |
Jul
|
Aug
(2) |
Sep
(2) |
Oct
(1) |
Nov
|
Dec
(6) |
| 2013 |
Jan
(4) |
Feb
(5) |
Mar
|
Apr
(4) |
May
(13) |
Jun
(7) |
Jul
(5) |
Aug
(15) |
Sep
(25) |
Oct
(18) |
Nov
(7) |
Dec
(3) |
| 2014 |
Jan
(1) |
Feb
(5) |
Mar
|
Apr
(3) |
May
(3) |
Jun
(2) |
Jul
(4) |
Aug
(5) |
Sep
|
Oct
(11) |
Nov
|
Dec
(62) |
| 2015 |
Jan
(8) |
Feb
(3) |
Mar
(15) |
Apr
|
May
|
Jun
(6) |
Jul
|
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
(19) |
| 2016 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(4) |
May
(3) |
Jun
(7) |
Jul
(14) |
Aug
(13) |
Sep
(6) |
Oct
(2) |
Nov
(3) |
Dec
|
| 2017 |
Jan
(6) |
Feb
(14) |
Mar
(2) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(4) |
Nov
(3) |
Dec
|
| 2018 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
(44) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
| 2021 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
|
| 2024 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2025 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(2) |
|
From: Gregor H. <gh...@gr...> - 2011-04-07 11:53:39
|
Hi, it doesn't seem to be possible to define an index like this: CREATE INDEX location_trgm_idx ON location USING gist (address gist_trgm_ops); http://www.postgresql.org/docs/current/static/pgtrgm.html After a quick look at index.py it should be possible to patch it to accept a new parameter for example "using" and insert it into the sql creation in: def sqliteCreateIndexSQL(self, soClass): [...] ret = 'CREATE %s %s_%s ON %s (%s)' % \ (uniqueOrIndex, self.soClass.sqlmeta.table, self.name, self.soClass.sqlmeta.table, ', '.join(spec)) return ret should get something like: def sqliteCreateIndexSQL(self, soClass): [...] ret = 'CREATE %s %s_%s ON %s %s (%s)' % \ (uniqueOrIndex, self.soClass.sqlmeta.table, self.name, self.soClass.sqlmeta.table, self.using, ', '.join(spec) ) return ret I don't know if this is a postgresql specific thing or not and should therefore only be inserted for postgresql. Is such a patch welcomed? -- Greg |
|
From: luis c. <lo....@gm...> - 2011-04-06 16:31:17
|
What is the appropriate way to connect to a SQL Server database using Windows Authentication? I've attempted using a connection string like this: conn_string = mssql://HOSTNAME/Test This results in: adodbapi.adodbapi.DatabaseError: (-2147352567, 'Exception occurred.', (0, u'Micr osoft OLE DB Provider for SQL Server', u"Login failed for user 'None'.", None, 0 , -2147217843), None) I know the DB server is running, I am able to connect to it using Elixir / SQL Alchemy ... Please help |
|
From: Mark <mar...@gm...> - 2011-04-02 19:41:45
|
I've got 100,000 users running my app which stores their data locally. I'm now releasing cell phone apps and need to sync the data through a web server. Each user would have on average 10,000 rows of item: string item_name int days_since_last_update int item_value What will happen about 50 times a day is the server will receive a list of 5 items to update their values ( if current day is greater than that row's days_since_last_update+2 ) ... So given item names: A, B, C, D, E whats the most efficient way to get those 5 items and then update their values if the current_day is greater than that items days_since_last_update? Also each row is actually about 200 bytes. Thats 2mb per user or 200gb for the database? Do I need to be concerned about performance of my MySQL database? The only other operation would be returning a query of all the rows for that user with days_since_last_update greater than some_value.. |
|
From: Daniel F. <fet...@go...> - 2011-03-29 19:34:58
|
> Hi, all! I am on vacation till 11 of April. Have fun! We promise we will be nice to each other :) Cheers, Daniel > Oleg. > -- > Oleg Broytman http://phdru.name/ ph...@ph... > Programmers don't die, they just GOSUB without RETURN. > > ------------------------------------------------------------------------------ > Enable your software for Intel(R) Active Management Technology to meet the > growing manageability and security demands of your customers. Businesses > are taking advantage of Intel(R) vPro (TM) technology - will your software > be a part of the solution? Download the Intel(R) Manageability Checker > today! http://p.sf.net/sfu/intel-dev2devmar > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss > -- Psss, psss, put it down! - http://www.cafepress.com/putitdown |
|
From: Oleg B. <ph...@ph...> - 2011-03-29 13:46:21
|
Hi, all! I am on vacation till 11 of April.
Oleg.
--
Oleg Broytman http://phdru.name/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|
|
From: Oleg B. <ph...@ph...> - 2011-03-28 19:56:32
|
On Mon, Mar 28, 2011 at 01:49:17PM -0600, Pгoм???тн?????s 0x01 wrote: > Hi all, > > First, I would like to say that I think SQLObject is one of the better ORM > wrappers I have looked at, and I really like how you all have made it feel > really natural within Python. Welcome! > I've been reading through the documentation and I was wondering if there was > any examples of how one could do a many-to-many relationship such that the > intermediate table had additional attributes? I saw this hinted at in the > documentation, but I guess I missed a relevant example. http://sqlobject.org/FAQ.html#how-can-i-define-my-own-intermediate-table-in-my-many-to-many-relationship Oleg. -- Oleg Broytman http://phdru.name/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
|
From: Pгoмᴇтнᴇυs 0. <pro...@gm...> - 2011-03-28 19:49:23
|
Hi all, First, I would like to say that I think SQLObject is one of the better ORM wrappers I have looked at, and I really like how you all have made it feel really natural within Python. I've been reading through the documentation and I was wondering if there was any examples of how one could do a many-to-many relationship such that the intermediate table had additional attributes? I saw this hinted at in the documentation, but I guess I missed a relevant example. For instance, going back to to the example in the documentation (see: http://sqlobject.org/SQLObject.html#many-to-many-relationships ) -- how would the DateTime column be added to the intermediate table? Or even a 'comment' StringCol? (So that the date of role-adding could be put in, as well as a "reason") Thanks in advance! |
|
From: Oleg B. <ph...@ph...> - 2011-03-28 18:22:46
|
On Mon, Mar 28, 2011 at 07:55:49PM +0200, Daniel Fetchinson wrote:
> > Congratulations!
> >
> > I'd like to thank you Oleg for working on this project and giving it your
> > time. It does not go unappreciated :)
> >
> > Cheers,
> > Imri
>
> I'd like to second that!
> Thanks a million, Oleg!
> I use sqlobject a lot and without all your work my projects would not
> be possible.
>
> Cheers,
> Daniel
Thank you very much!
Oleg.
--
Oleg Broytman http://phdru.name/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|
|
From: Daniel F. <fet...@go...> - 2011-03-28 17:55:57
|
> Congratulations! > > I'd like to thank you Oleg for working on this project and giving it your > time. It does not go unappreciated :) > > Cheers, > Imri I'd like to second that! Thanks a million, Oleg! I use sqlobject a lot and without all your work my projects would not be possible. Cheers, Daniel >> Hello! >> >> I'm really happy to announce SQLObject version 1.0.0! >> >> >> What is SQLObject >> ================= >> >> SQLObject is an object-relational mapper. Your database tables are >> described >> as classes, and rows are instances of those classes. SQLObject is meant >> to >> be >> easy to use and quick to get started with. >> >> SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite, >> Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB). >> >> >> Where is SQLObject >> ================== >> >> Site: >> http://sqlobject.org >> >> Development: >> http://sqlobject.org/devel/ >> >> Mailing list: >> https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss >> >> Archives: >> http://news.gmane.org/gmane.comp.python.sqlobject >> >> Download: >> http://cheeseshop.python.org/pypi/SQLObject/1.0.0 >> >> News and changes: >> http://sqlobject.org/News.html >> >> >> What's New >> ========== >> >> Features & Interface >> -------------------- >> >> * Major API change: DB URI parser was changed to use urllib.split*() and >> unquote(). This means any username/password/path are allowed in DB >> URIs if they are properly %-encoded, and DB URIs are automatically >> unquoted. >> >> * A new module ``__version__.py`` was added. New variables ``version`` >> (string) and ``version_info`` (5-tuple: major, minor, micro, release >> level, serial) are imported into ``sqlobject`` namespace. >> >> * In SQLite, id columns are made AUTOINCREMENT. >> >> * Parameter ``backend`` in DB URI is no longer supported, use parameter >> ``driver``. >> >> For a more complete list, please see the news: >> http://sqlobject.org/News.html >> >> Oleg. >> -- >> Oleg Broytman http://phdru.name/ ph...@ph... >> Programmers don't die, they just GOSUB without RETURN. >> >> >> ------------------------------------------------------------------------------ >> Enable your software for Intel(R) Active Management Technology to meet the >> growing manageability and security demands of your customers. Businesses >> are taking advantage of Intel(R) vPro (TM) technology - will your software >> be a part of the solution? Download the Intel(R) Manageability Checker >> today! http://p.sf.net/sfu/intel-dev2devmar >> _______________________________________________ >> sqlobject-discuss mailing list >> sql...@li... >> https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss >> > -- Psss, psss, put it down! - http://www.cafepress.com/putitdown |
|
From: Oleg B. <ph...@ph...> - 2011-03-28 14:19:22
|
On Mon, Mar 28, 2011 at 04:11:02PM +0200, Imri Goldberg wrote:
> Congratulations!
>
> I'd like to thank you Oleg for working on this project and giving it your
> time. It does not go unappreciated :)
>
> Cheers,
> Imri
Thank you very much!
Oleg.
--
Oleg Broytman http://phdru.name/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|
|
From: Imri G. <lor...@gm...> - 2011-03-28 14:11:08
|
Congratulations! I'd like to thank you Oleg for working on this project and giving it your time. It does not go unappreciated :) Cheers, Imri -- Imri Goldberg -------------------------------------- http://plnnr.com/ - automatic trip planning http://www.algorithm.co.il/blogs/ -------------------------------------- -- insert signature here ---- On Mon, Mar 28, 2011 at 3:26 PM, Oleg Broytman <ph...@ph...> wrote: > Hello! > > I'm really happy to announce SQLObject version 1.0.0! > > > What is SQLObject > ================= > > SQLObject is an object-relational mapper. Your database tables are > described > as classes, and rows are instances of those classes. SQLObject is meant to > be > easy to use and quick to get started with. > > SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite, > Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB). > > > Where is SQLObject > ================== > > Site: > http://sqlobject.org > > Development: > http://sqlobject.org/devel/ > > Mailing list: > https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss > > Archives: > http://news.gmane.org/gmane.comp.python.sqlobject > > Download: > http://cheeseshop.python.org/pypi/SQLObject/1.0.0 > > News and changes: > http://sqlobject.org/News.html > > > What's New > ========== > > Features & Interface > -------------------- > > * Major API change: DB URI parser was changed to use urllib.split*() and > unquote(). This means any username/password/path are allowed in DB > URIs if they are properly %-encoded, and DB URIs are automatically > unquoted. > > * A new module ``__version__.py`` was added. New variables ``version`` > (string) and ``version_info`` (5-tuple: major, minor, micro, release > level, serial) are imported into ``sqlobject`` namespace. > > * In SQLite, id columns are made AUTOINCREMENT. > > * Parameter ``backend`` in DB URI is no longer supported, use parameter > ``driver``. > > For a more complete list, please see the news: > http://sqlobject.org/News.html > > Oleg. > -- > Oleg Broytman http://phdru.name/ ph...@ph... > Programmers don't die, they just GOSUB without RETURN. > > > ------------------------------------------------------------------------------ > Enable your software for Intel(R) Active Management Technology to meet the > growing manageability and security demands of your customers. Businesses > are taking advantage of Intel(R) vPro (TM) technology - will your software > be a part of the solution? Download the Intel(R) Manageability Checker > today! http://p.sf.net/sfu/intel-dev2devmar > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss > |
|
From: Oleg B. <ph...@ph...> - 2011-03-28 13:27:06
|
Hello! I'm really happy to announce SQLObject version 1.0.0! What is SQLObject ================= SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started with. SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite, Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB). Where is SQLObject ================== Site: http://sqlobject.org Development: http://sqlobject.org/devel/ Mailing list: https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss Archives: http://news.gmane.org/gmane.comp.python.sqlobject Download: http://cheeseshop.python.org/pypi/SQLObject/1.0.0 News and changes: http://sqlobject.org/News.html What's New ========== Features & Interface -------------------- * Major API change: DB URI parser was changed to use urllib.split*() and unquote(). This means any username/password/path are allowed in DB URIs if they are properly %-encoded, and DB URIs are automatically unquoted. * A new module ``__version__.py`` was added. New variables ``version`` (string) and ``version_info`` (5-tuple: major, minor, micro, release level, serial) are imported into ``sqlobject`` namespace. * In SQLite, id columns are made AUTOINCREMENT. * Parameter ``backend`` in DB URI is no longer supported, use parameter ``driver``. For a more complete list, please see the news: http://sqlobject.org/News.html Oleg. -- Oleg Broytman http://phdru.name/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
|
From: Oleg B. <ph...@ph...> - 2011-03-24 14:23:20
|
On Tue, Mar 22, 2011 at 12:01:54PM +0300, Oleg Broytman wrote: > query = list_.queryForSelect() > query.ops['items'] = [list_.sourceClass.q.id] I added a test and committed in the revsion 4371: http://sourceforge.net/mailarchive/forum.php?thread_name=E1Q2l8p-0002iI-Nr%40webwareforpython.org&forum_name=sqlobject-cvs Thank you! Oleg. -- Oleg Broytman http://phdru.name/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
|
From: Oleg B. <ph...@ph...> - 2011-03-22 16:46:57
|
Hello! I'm pleased to announce version 1.0.0b2, the second beta of the upcoming release of branch 1.0 of SQLObject. What is SQLObject ================= SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started with. SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite, Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB). Where is SQLObject ================== Site: http://sqlobject.org Development: http://sqlobject.org/devel/ Mailing list: https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss Archives: http://news.gmane.org/gmane.comp.python.sqlobject Download: http://cheeseshop.python.org/pypi/SQLObject/1.0.0b2dev-r4370 News and changes: http://sqlobject.org/News.html What's New ========== Features & Interface -------------------- * A new module ``__version__.py`` was added. New variables ``version`` (string) and ``version_info`` (5-tuple: major, minor, micro, release level, serial) are imported into ``sqlobject`` namespace. For a more complete list, please see the news: http://sqlobject.org/News.html Oleg. -- Oleg Broytman http://phdru.name/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
|
From: Oleg B. <ph...@ph...> - 2011-03-22 16:41:26
|
Hello! I'm pleased to announce version 0.15.1, a bugfix release of branch 0.15 of SQLObject. What is SQLObject ================= SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started with. SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite, Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB). Where is SQLObject ================== Site: http://sqlobject.org Development: http://sqlobject.org/devel/ Mailing list: https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss Archives: http://news.gmane.org/gmane.comp.python.sqlobject Download: http://cheeseshop.python.org/pypi/SQLObject/0.15.1 News and changes: http://sqlobject.org/News.html What's New ========== * A bug was fixed in MSSQLConnection. * A minor bug was fixed in sqlbuilder.Union. For a more complete list, please see the news: http://sqlobject.org/News.html Oleg. -- Oleg Broytman http://phdru.name/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
|
From: Oleg B. <ph...@ph...> - 2011-03-22 09:39:02
|
On Tue, Mar 22, 2011 at 10:26:22AM +0100, Gregor Horvath wrote:
> But I would prefer to make an optional argument 'columns' to
> queryForSelect, because it is not obvious that the columns / items can
> be changed after initialisation.
>
> so it would be
>
> list_ = list_.queryForSelect(columns=[list_.sourceClass.q.id])
Hmm... I don't like this approach, at least at the first glance. I
have to think about it, but now I'd rather split queryForSelect into two
functions. Something like this:
def queryForSelect(self):
columns = [self.sourceClass.q.id] + [getattr(self.sourceClass.q, x.name) for x in self.sourceClass.sqlmeta.columnList]
return self.makeQuery(columns)
def makeQuery(self, columns):
query = sqlbuilder.Select(columns,
...
Oleg.
--
Oleg Broytman http://phdru.name/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|
|
From: Gregor H. <gh...@gr...> - 2011-03-22 09:26:36
|
Hi,
On Tue, 22 Mar 2011 12:01:54 +0300
Oleg Broytman <ph...@ph...> wrote:
> Hi!
>
> On Tue, Mar 22, 2011 at 09:27:04AM +0100, Gregor Horvath wrote:
> > def IN_(item, list_):
> > if isinstance(list_, SelectResults):
> > list_ = Select([list_.sourceClass.q.id],
> > where=list_.clause,
> > join=list_.ops.get('join', NoDefault),
> > distinct=list_.ops.get('distinct',False),
> > lazyColumns=list_.ops.get('lazyColumns',
> > False), start=list_.ops.get('start', 0),
> > end=list_.ops.get('end', None),
> > orderBy=list_.ops.get('dbOrderBy',
> > NoDefault), reversed=list_.ops.get('reversed', False),
> > staticTables=list_.tables,
> > forUpdate=list_.ops.get('forUpdate', False))
>
> Isn't this just
>
> query = list_.queryForSelect()
> query.ops['items'] = [list_.sourceClass.q.id]
>
>
Thank You. Yes this is equivalent and more compact.
But I would prefer to make an optional argument 'columns' to
queryForSelect, because it is not obvious that the columns / items can
be changed after initialisation.
so it would be
list_ = list_.queryForSelect(columns=[list_.sourceClass.q.id])
--
Gregor
|
|
From: Oleg B. <ph...@ph...> - 2011-03-22 09:02:05
|
Hi!
On Tue, Mar 22, 2011 at 09:27:04AM +0100, Gregor Horvath wrote:
> def IN_(item, list_):
> if isinstance(list_, SelectResults):
> list_ = Select([list_.sourceClass.q.id],
> where=list_.clause,
> join=list_.ops.get('join', NoDefault),
> distinct=list_.ops.get('distinct',False),
> lazyColumns=list_.ops.get('lazyColumns', False),
> start=list_.ops.get('start', 0),
> end=list_.ops.get('end', None),
> orderBy=list_.ops.get('dbOrderBy', NoDefault),
> reversed=list_.ops.get('reversed', False),
> staticTables=list_.tables,
> forUpdate=list_.ops.get('forUpdate', False))
Isn't this just
query = list_.queryForSelect()
query.ops['items'] = [list_.sourceClass.q.id]
?
> return IN(item, query)
Oleg.
--
Oleg Broytman http://phdru.name/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|
|
From: Gregor H. <gh...@gr...> - 2011-03-22 08:27:26
|
Hi,
I've made an enhanced sqlbuilder IN Operator for my own purpose and
would like to ask if there is any interest in a patch for the
sqlbuilder IN operator.
It's enhancement is the ability to deal with SelectResults in addition
to the standard sqlbuilder.Select. The motivation is the need to
create subqueries using previously acquired SelectResults.
def IN_(item, list_):
if isinstance(list_, SelectResults):
list_ = Select([list_.sourceClass.q.id],
where=list_.clause,
join=list_.ops.get('join', NoDefault),
distinct=list_.ops.get('distinct',False),
lazyColumns=list_.ops.get('lazyColumns', False),
start=list_.ops.get('start', 0),
end=list_.ops.get('end', None),
orderBy=list_.ops.get('dbOrderBy', NoDefault),
reversed=list_.ops.get('reversed', False),
staticTables=list_.tables,
forUpdate=list_.ops.get('forUpdate', False))
return IN(item, list_)
--
Greg
|
|
From: Joe L. <joe...@gm...> - 2011-03-17 16:49:31
|
Great! Thank you.
On Thu, Mar 17, 2011 at 12:20 PM, Oleg Broytman <ph...@ph...> wrote:
> On Wed, Mar 16, 2011 at 11:08:52PM +0300, Oleg Broytman wrote:
> > On Wed, Mar 16, 2011 at 02:33:48PM -0400, Joe Lanese wrote:
> > > I just came across the exact same problem using the mssql connection
> > > (mssqlconnection.py). More specifically the problem occured when I
> tried to
> > > access the first returned row of a selectResults (ie. selResults[0]).
> I
> > > tried the same solution below in the mssqlconnection.py file, and it
> solved
> > > the problem.
> > >
> > > Can this fix also be applied to the official mssql support?
> > >
> > > > On Fri, Dec 18, 2009 at 01:19:25AM +0100, Petr Jake?? wrote:
> > > > Index: firebirdconnection.py
> > > > ===================================================================
> > > > --- firebirdconnection.py (revision 4047)
> > > > +++ firebirdconnection.py (working copy)
> > > > @@ -10,6 +10,8 @@
> > > > dbName = 'firebird'
> > > > schemes = [dbName]
> > > >
> > > > + limit_re = re.compile('^\s*(select )(.*)', re.IGNORECASE)
> >
> > Thank you, I'll apply the patch tomorrow. New releases will be
> > released in a few days.
>
> Applied and committed in the revisions 4358-4360 (branches 0.15, 1.0
> and the trunk; I've stopped maintaining branch 0.14 as I am releasing
> version 1.0 RSN.)
>
> Oleg.
> --
> Oleg Broytman http://phdru.name/ ph...@ph...
> Programmers don't die, they just GOSUB without RETURN.
>
>
> ------------------------------------------------------------------------------
> Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit
> for your organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> _______________________________________________
> sqlobject-discuss mailing list
> sql...@li...
> https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
>
|
|
From: Oleg B. <ph...@ph...> - 2011-03-17 16:21:04
|
On Wed, Mar 16, 2011 at 11:08:52PM +0300, Oleg Broytman wrote:
> On Wed, Mar 16, 2011 at 02:33:48PM -0400, Joe Lanese wrote:
> > I just came across the exact same problem using the mssql connection
> > (mssqlconnection.py). More specifically the problem occured when I tried to
> > access the first returned row of a selectResults (ie. selResults[0]). I
> > tried the same solution below in the mssqlconnection.py file, and it solved
> > the problem.
> >
> > Can this fix also be applied to the official mssql support?
> >
> > > On Fri, Dec 18, 2009 at 01:19:25AM +0100, Petr Jake?? wrote:
> > > Index: firebirdconnection.py
> > > ===================================================================
> > > --- firebirdconnection.py (revision 4047)
> > > +++ firebirdconnection.py (working copy)
> > > @@ -10,6 +10,8 @@
> > > dbName = 'firebird'
> > > schemes = [dbName]
> > >
> > > + limit_re = re.compile('^\s*(select )(.*)', re.IGNORECASE)
>
> Thank you, I'll apply the patch tomorrow. New releases will be
> released in a few days.
Applied and committed in the revisions 4358-4360 (branches 0.15, 1.0
and the trunk; I've stopped maintaining branch 0.14 as I am releasing
version 1.0 RSN.)
Oleg.
--
Oleg Broytman http://phdru.name/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|
|
From: Oleg B. <ph...@ph...> - 2011-03-16 20:09:03
|
On Wed, Mar 16, 2011 at 02:33:48PM -0400, Joe Lanese wrote:
> I just came across the exact same problem using the mssql connection
> (mssqlconnection.py). More specifically the problem occured when I tried to
> access the first returned row of a selectResults (ie. selResults[0]). I
> tried the same solution below in the mssqlconnection.py file, and it solved
> the problem.
>
> Can this fix also be applied to the official mssql support?
>
> > On Fri, Dec 18, 2009 at 01:19:25AM +0100, Petr Jake?? wrote:
> > Index: firebirdconnection.py
> > ===================================================================
> > --- firebirdconnection.py (revision 4047)
> > +++ firebirdconnection.py (working copy)
> > @@ -10,6 +10,8 @@
> > dbName = 'firebird'
> > schemes = [dbName]
> >
> > + limit_re = re.compile('^\s*(select )(.*)', re.IGNORECASE)
Thank you, I'll apply the patch tomorrow. New releases will be
released in a few days.
Oleg.
--
Oleg Broytman http://phdru.name/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|
|
From: Joe L. <joe...@gm...> - 2011-03-16 18:34:00
|
Hi,
I just came across the exact same problem using the mssql connection
(mssqlconnection.py). More specifically the problem occured when I tried to
access the first returned row of a selectResults (ie. selResults[0]). I
tried the same solution below in the mssqlconnection.py file, and it solved
the problem.
Can this fix also be applied to the official mssql support?
Thanks,
Joe
On Sun, Dec 20, 2009 at 10:41 AM, Oleg Broytman <ph...@ph...> wrote:
> Hi!
>
> On Fri, Dec 18, 2009 at 01:19:25AM +0100, Petr Jake?? wrote:
> > File
> >
> "/usr/lib/python2.5/site-packages/SQLObject-0.10.1-py2.5.egg/sqlobject/firebird/firebirdconnection.py",
> > line 120, in _queryAddLimitOffset
> > match = cls.limit_re.match(query)
> > AttributeError: class FirebirdConnection has no attribute 'limit_re'
>
> This is the patch that I think fixes the problem:
>
> Index: firebirdconnection.py
> ===================================================================
> --- firebirdconnection.py (revision 4047)
> +++ firebirdconnection.py (working copy)
> @@ -10,6 +10,8 @@
> dbName = 'firebird'
> schemes = [dbName]
>
> + limit_re = re.compile('^\s*(select )(.*)', re.IGNORECASE)
> +
> def __init__(self, host, db, user='sysdba',
> password='masterkey', autoCommit=1,
> dialect=None, role=None, charset=None, **kw):
> @@ -18,8 +20,6 @@
> import kinterbasdb
> self.module = kinterbasdb
>
> - self.limit_re = re.compile('^\s*(select )(.*)', re.IGNORECASE)
> -
> self.host = host
> self.db = db
> self.user = user
>
> Oleg.
> --
> Oleg Broytman http://phd.pp.ru/ ph...@ph...
> Programmers don't die, they just GOSUB without RETURN.
>
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and
> easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> sqlobject-discuss mailing list
> sql...@li...
> https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
>
|
|
From: Oleg B. <ph...@ph...> - 2011-03-14 15:39:32
|
On Mon, Mar 14, 2011 at 11:40:24AM +0000, Timothy W. Grove wrote:
> If I have an old database which contains an intermediate table generated
> by code such as 'videos = RelatedJoin("ExplanatoryVideos")' , and the
> class has been changed to no longer require a 'many-to-many'
> relationship, can this intermediate table be deleted through SQLObject
> to update the old database?
Table.dropJoinTables() drops all intermediate tables. If you want to
drop only a specific table, you ought to copy some code from
.dropJoinTables() to find out what table you want to drop - and drop it.
Oleg.
--
Oleg Broytman http://phdru.name/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|
|
From: Timothy W. G. <tim...@si...> - 2011-03-14 11:40:48
|
If I have an old database which contains an intermediate table generated
by code such as 'videos = RelatedJoin("ExplanatoryVideos")' , and the
class has been changed to no longer require a 'many-to-many'
relationship, can this intermediate table be deleted through SQLObject
to update the old database?
Tim
|