another issue that has been annoying me. I switched from sqlite to
MySQL, but suddenly a search by alternate ID fails, i.e my test code:
for t in Test.select():
try:
t2 = Test.byName(default_test_name)
log.debug('OK')
except:
log.debug('ERROR')
if t.name == default_test_name:
log.debug('FOUND')
would print:
ERROR
FOUND
switching back to sqlite, it works fine. The alternateID field has not
been modified since creation.
Obviously this is not a blocking issue, I can simply do a select, but I
was wondering if it is a known bug. I did not find a similar issue on
Track.
Regards,
JM
Thanks,
David
Are you think reserved keyword collision? Because that's what I am :-)
-Rob
> Can we please see your class declaration? This particular feature
> works fine for me, so we're missing something here...
>
Sorry I missed your message... it would be good if google groups
notified people when someone replies to their topic (also, "My Topics"
is empty, instead, they appear in "My Profile".. wtf?)
So, my class declaration is:
class Test(SQLObject):
name = UnicodeCol(length=64, alternateID=True)
...
Search "byName" works fine if I run with sqlite, but not with MySQL.
Thanks,
JM
> Are you think reserved keyword collision? Because that's what I am :-)
>
> -Rob
Rob, thanks for your comment.
Do you mean it would be a name clash with the "Test" class name?
I thought this too and since then I renamed my class "WoeTest", but
still the same problem.
~JM
>Sorry I missed your message... it would be good if google groups
notified people when someone replies to their topic
Take a look at the "Email updates to me" link at the top of the thread.
Try taking your code out of the try...except block. Do a tg-admin
shell and enter:
t = Test.byName('myname')
and post the traceback here.
Thanks! :-)
> Try taking your code out of the try...except block. Do a tg-admin
> shell and enter:
>
> t = Test.byName('myname')
>
> and post the traceback here.
Cool, that solves my problem! I notied that I do a select byName with
an unicode string. This works with sqlite but fails with MySQL:
TypeError: decoding Unicode is not supported
This is the 2nd annoying SqlObject Bug I'm hitting, just by doing
simple things. I can't wait for TG to dump this useless interface
~JM
Use a real database server. We can't dump MySQL :-)
--
Jorge Godoy <jgo...@gmail.com>
Or use SQLAlchemy and keep your database server.
--
Lee McFadden
blog: http://www.splee.co.uk
work: http://fireflisystems.com