Thread: [SQLObject] Patch for some sqlobject-admin bugs
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Gabe R. <ru...@go...> - 2006-05-10 18:09:17
Attachments:
sqlobject-admin-fixes1.patch
sqlobject-admin-fixes2.patch
|
Hey Oleg, I encountered some annoying bugs in sqlobject-admin and figured I would pass on the patch that fixes them. 1. on a "sqlobject-admin create" where two tables reference each other, the constraints where not being deferred to after the tables were created, thus errors were thrown that the a table did not exist. The mechanism for deferring the creation of the constraints was there, just not used. 2. on a "sqlobject-admin sql" where the class had a RelatedJoin, the intermediary classes did not have a ';' after their CREATE TABLE section, thus resulting in invalid SQL. This required more touching as I had the relevant functions returns lists of statements that are then joined by ';\n' or '\n' depending on how it's being used. Let me know if you have any questions or need changes made. -gabe |
From: Oleg B. <ph...@ma...> - 2006-05-10 18:53:10
|
On Wed, May 10, 2006 at 11:44:08AM -0600, Gabe Rudy wrote: > Hey Oleg, Hello. > I encountered some annoying bugs in sqlobject-admin and figured I would pass > on the patch that fixes them. I have never used sqlobject-admin. Never even looked into it. :) I hope Ian will look into the patch and decide what to do. > Index: sqlobject/main.py > - return '\n'.join(sql) > + return sql You touched main.py, and the change seems rather big - you made the function to return a list instead of a string. For such a change I'd like to see tests. Have you ran the test suite? Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Gabe R. <ru...@go...> - 2006-05-10 20:42:35
|
> > Index: sqlobject/main.py > > - return '\n'.join(sql) > > + return sql > > You touched main.py, and the change seems rather big - you made the > function to return a list instead of a string. For such a change I'd like > to see tests. Have you ran the test suite? They seem big, yet the only part of sqlobject that I can tell that use the functions I changed are in sqlobject-admin. I would run the test suite and compare but as it is I get 99 failures off of svn. I do get 102 failures with my changes (I tried tracking the diff's in failures but got confused). Is there something I'm missing to get the tests up and running? --gabe |
From: Oleg B. <ph...@ma...> - 2006-05-10 21:34:15
|
On Wed, May 10, 2006 at 02:41:41PM -0600, Gabe Rudy wrote: > They seem big, yet the only part of sqlobject that I can tell that use the > functions I changed are in sqlobject-admin. But they belong to the public API so after you changed them everyone would need to change her program. > I would run the test suite and compare but as it is I get 99 failures off of > svn. SQLObject test suite requires py.test. Also I can send you a dozen of shell scripts I use to run the tests. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Gabe R. <ru...@go...> - 2006-05-10 21:49:26
|
> But they belong to the public API so after you changed them everyone > would need to change her program. > That's true, I did'nt think of that. I can probably change the patch to not touch main.py, it will just be less pretty as main.py is wrong in some of it's assumptions. Ultimately, your or Ian will have to decide wether to break compatiblity for those functions. > SQLObject test suite requires py.test. Also I can send you a dozen of > shell scripts I use to run the tests. Yea, I got py.test, and it runs the suite, it's just that 50+% fails :P I'll keep an eye out for those scripts. |
From: Oleg B. <ph...@ma...> - 2006-05-10 22:22:53
|
On Wed, May 10, 2006 at 03:48:32PM -0600, Gabe Rudy wrote: > main.py is wrong in some of > it's assumptions. ??? > Ultimately, your or Ian will have to decide wether to break compatiblity for > those functions. I think it possible for SQLObject 0.8. But I'd like to see old tests fixed and new tests created for you patch. > Yea, I got py.test, and it runs the suite, it's just that 50+% fails :P I'll Oops, I am puzzled. I run the entire test sute for SQLObject 0.7-branch and 0.8 at least once a week when I test patches. > keep an eye out for those scripts. Will send them in private mail. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |