sqlobject-discuss Mailing List for SQLObject (Page 381)
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
|
Dec
|
From: Jeremy A. <ta...@wa...> - 2004-05-31 14:55:15
|
khansaman guaiacum nonstarter barnyard maidenhair reredos tridental talbotype aquifer romanorum adnate |
From: Peter G. <pe...@fs...> - 2004-05-31 14:23:26
|
> is anybody even interested in using SQLObject with DB2? We're upgrading our IBM DB2 8.1 database to PostgreSQL 7.4, but the old system is still running DB2. It's unfortunate that we run DB2 at all (I'm very unhappy with it) and one of the more painful things is the lack of good DB2 Python support. It would be most welcome to have a nice Python interface to DB2 since we are hacking PERL at the moment. /Peter |
From: <c...@de...> - 2004-05-31 08:06:29
|
hi, a fiew days ago i hacked together a DB2 version of DBConnection plus the related changes in Col.py and Converters.py. The DBConnection file is getting kinda long (ca. 1700 lines) perhaps its time to split the db specific parts out into seperate files. unfortinatly DB2 has a concept of tablespaces eg FooTbls.Foo, this means i have had to override several _SO_ functions from the DBAPI class. so now to the point: do you want a patch-set against the 0.5.2 release or the subversion tree? is it even worth patching considering that there will probably be major changes under the hood for the .6 release? is anybody even interested in using SQLObject with DB2? Please cc me as im not on the sqlobject-discuss list. kind regards, christoph |
From: Ian B. <ia...@co...> - 2004-05-31 02:22:06
|
On May 30, 2004, at 5:52 PM, Michel Thadeu wrote: > I have just another question, i using SQLObject 0.5, is there a > repository with 0.6 (with my ppp connect will be very hard to update > debian and install a subversion client)? No, I'm afraid there's only access through Subversion. -- Ian Bicking | ia...@co... | http://blog.ianbicking.org |
From: <mic...@ya...> - 2004-05-30 22:52:50
|
--- Ian Bicking <ia...@co...> escreveu: > On May 29, 2004, at 10:53 PM, Michel Thadeu wrote: > > Hi againg guys! > > > > I wondered with SQLObject :) It's cool... > > I have tried out and had another 2 questions: > > > > How is the best way to use SQLObject over a html schema? I using > > webware and I think I can't pass the object throught requests, so I > > must pass the id and get from Table the row matching the id. > > > > I done something like this: > > > > Table.select(Table.q.id==someid) > > > > But is there a method like ByAlternateID? or is a easier way to do? > The > > list index is a choice: Table.select()[someid]? > > If you are using the Subversion (0.6) version, it's > Table.get(someid), > or in 0.5.x it's Table(someid). Ah, thanks! > > Another question is in a join: > > > > I have 2 tables: > > > > class City: > > name=StringCol(length=100) > > state=ForeignKey('State') > > > > class State: > > name=StringCol(length=100) > > cities=MultipleJoin('City') > > > > I want to do something like: > > > > select city.name from city inner join state on > city.state_id=state.id > > where city.name like '%somename%' and state.id=1; > > > > I try: > > > > [i for i in City.select((City.q.name.contains('something')) & > > (State.q.id=1))] > > > > with no sucess... > > City.select(City.q.name.contains('something') & (City.q.stateID==1)). > > Ian Sparks posted about a similar but slightly more complicated join > just a couple days ago, and there's another example in that thread. Ok, I'll check! I solved like this: City.select('''name ilike '%something%' and state_id=1''') thanks for the help! I have just another question, i using SQLObject 0.5, is there a repository with 0.6 (with my ppp connect will be very hard to update debian and install a subversion client)? Thanks for all help Ian! > -- > Ian Bicking | ia...@co... | http://blog.ianbicking.org > ===== -- Michel Thadeu Sabchuk Curitiba/PR ______________________________________________________________________ Participe da pesquisa global sobre o Yahoo! Mail: http://br.surveys.yahoo.com/global_mail_survey_br |
From: Ian B. <ia...@co...> - 2004-05-30 07:20:58
|
On May 29, 2004, at 10:53 PM, Michel Thadeu wrote: > Hi againg guys! > > I wondered with SQLObject :) It's cool... > I have tried out and had another 2 questions: > > How is the best way to use SQLObject over a html schema? I using > webware and I think I can't pass the object throught requests, so I > must pass the id and get from Table the row matching the id. > > I done something like this: > > Table.select(Table.q.id==someid) > > But is there a method like ByAlternateID? or is a easier way to do? The > list index is a choice: Table.select()[someid]? If you are using the Subversion (0.6) version, it's Table.get(someid), or in 0.5.x it's Table(someid). > Another question is in a join: > > I have 2 tables: > > class City: > name=StringCol(length=100) > state=ForeignKey('State') > > class State: > name=StringCol(length=100) > cities=MultipleJoin('City') > > I want to do something like: > > select city.name from city inner join state on city.state_id=state.id > where city.name like '%somename%' and state.id=1; > > I try: > > [i for i in City.select((City.q.name.contains('something')) & > (State.q.id=1))] > > with no sucess... City.select(City.q.name.contains('something') & (City.q.stateID==1)). Ian Sparks posted about a similar but slightly more complicated join just a couple days ago, and there's another example in that thread. -- Ian Bicking | ia...@co... | http://blog.ianbicking.org |
From: <mic...@ya...> - 2004-05-30 03:53:56
|
Hi againg guys! I wondered with SQLObject :) It's cool... I have tried out and had another 2 questions: How is the best way to use SQLObject over a html schema? I using webware and I think I can't pass the object throught requests, so I must pass the id and get from Table the row matching the id. I done something like this: Table.select(Table.q.id==someid) But is there a method like ByAlternateID? or is a easier way to do? The list index is a choice: Table.select()[someid]? Another question is in a join: I have 2 tables: class City: name=StringCol(length=100) state=ForeignKey('State') class State: name=StringCol(length=100) cities=MultipleJoin('City') I want to do something like: select city.name from city inner join state on city.state_id=state.id where city.name like '%somename%' and state.id=1; I try: [i for i in City.select((City.q.name.contains('something')) & (State.q.id=1))] with no sucess... what can I do? I can select all cities from a specified state but I couldn't choose the city matching the name... thanks for all help! ===== -- Michel Thadeu Sabchuk Curitiba/PR ______________________________________________________________________ Participe da pesquisa global sobre o Yahoo! Mail: http://br.surveys.yahoo.com/global_mail_survey_br |
From: Ian B. <ia...@co...> - 2004-05-28 19:33:55
|
Michel Thadeu wrote: > Hi guys! > > I using SQLObject and enjoying but, how can I delete a row (i think del > row is a good idea but I can be wrong)? Person.get(1).destroySelf() > method(name='Another Name') > method({'name':'Another else Name'}) Instead do: method(**{'name': 'Another else Name'}) The ** unpacks the dictionary into keyword arguments. This works anywhere in Python. (Just * unpacks a tuple into positional arguments) Ian |
From: <mic...@ya...> - 2004-05-28 19:10:32
|
Hi guys! I using SQLObject and enjoying but, how can I delete a row (i think del row is a good idea but I can be wrong)? I have a sugestion on the column definition: ... Class Person(SQLObject): name=StringCol(length=100) p=Person(name='Some name') dictionary={'name':'Another Name'} q=Person(dictionary) # this code won´t work ... I think you are using something like this in the method: ... def method(cnf={}, **kw): default={'name':'My Name'} default.update(kw) default.update(cnf) print default ... I don´t know how to explain with words (sorry my poor english), but using the code above I can do: ... method(name='Another Name') method({'name':'Another else Name'}) method() ... This is usefull when I have a lot of values with keys in a dictionary... I don´t know of this is used this time, but I try and can´t do Person({'name':'Some Name'})... Thanks for attention and sorry again about my poor english! ===== -- Michel Thadeu Sabchuk Curitiba/PR ______________________________________________________________________ Participe da pesquisa global sobre o Yahoo! Mail: http://br.surveys.yahoo.com/global_mail_survey_br |
From: alexander s. <al...@an...> - 2004-05-28 18:44:20
|
jws...@ra... wrote, at 28.05.2004 20:30: > I'm considering using mod_python + spyce + sqlobject, but mod_python > apparently needs to have python built without threading. Is that a > deal-breaker for SO? AFAIK mod_python v3 can use threaded python. you just need to load the threads library in apache if it was built without threads. on FreeBSD, this is done by adding the following lines to /usr/local/sbin/envvars: LD_PRELOAD=/usr/lib/libc_r.so # or libpthread.so export LD_PRELOAD best wishes, alex. |
From: Nick <ni...@dd...> - 2004-05-28 18:23:30
|
Ian Bicking wrote: > You'll have to be careful about caching, since SQLObject can't maintain > cache consistency on its own in a multi-process environment. You'll > either have to turn caching off, or use .sync/.expire to avoid stale > caches. Calling expire at the end of each request (or the beginning, I suppose) should take care of any persistency problems in mod_python, fastcgi, etc. At least it did for me. Nick |
From: Ian B. <ia...@co...> - 2004-05-28 18:06:09
|
jws...@ra... wrote: > I'm considering using mod_python + spyce + sqlobject, but mod_python > apparently needs to have python built without threading. Is that a > deal-breaker for SO? Not really a problem. SQLObject is threadsafe (or at least tries to me ;), which is merely irrelevant if you aren't using threads. There may be problems though because the threading module won't be present. You might need to use a fake threading module of some sort, maybe just like: # threading.py class Lock: def acquire(self): pass def release(self): pass This way SQLObject can pretend to lock sections of code. You'll have to be careful about caching, since SQLObject can't maintain cache consistency on its own in a multi-process environment. You'll either have to turn caching off, or use .sync/.expire to avoid stale caches. Anyway, tell us how it goes. Ian |
From: <jws...@ra...> - 2004-05-28 17:30:41
|
I'm considering using mod_python + spyce + sqlobject, but mod_python apparently needs to have python built without threading. Is that a deal-breaker for SO? |
From: Ian S. <Ian...@et...> - 2004-05-28 17:28:38
|
Ian Sparks wrote: > AFAIK SQLObject can't do complex joins. to which Ian Bicking wrote: > >Ah, and that is where you are wrong! > >TimeOffRequests.select(AND(TimeOffRequests.q.cUserID =3D=3D = Users.q.cID, > Users.q.Dept =3D=3D 12)) I stand corrected and humbled! Thanks. -----Original Message----- From: Ian Bicking [mailto:ia...@co...] Sent: Friday, May 28, 2004 12:21 PM To: Ian Sparks Cc: Sqlobject-Discuss@Lists. Sourceforge. Net (E-mail) Subject: Re: [SQLObject] Passthrough SQL. Ian Sparks wrote: > Before I start digging into the source code does the following > ability already exist in SQLObject and, if not, does anyone else want > it. >=20 > AFAIK SQLObject can't do complex joins. For instance, I might want to > do a query like : >=20 > SELECT TimeOfRequests.* FROM TimeOffRequests INNER JOIN Users ON > TimeOffRequests.cUserID =3D Users.cID WHERE Users.Dept =3D 12 Ah, and that is where you are wrong! TimeOffRequests.select(AND(TimeOffRequests.q.cUserID =3D=3D Users.q.cID, Users.q.Dept =3D=3D 12)) You can also do: TimeOffRequests.select("TimeOffRequests.cUserID =3D Users.cID AND=20 Users.Dept =3D 12", clauseTables=3D['Users']) I imagine there are probably more complex queries that won't work, but=20 one at a time... Ian |
From: Luke O. <lu...@me...> - 2004-05-28 17:21:04
|
At one time I thought we had discussed the possibility of adding additional WHERE conditions to joins? Maybe something to consider anew. A little offtopic from Ian Sparks' example, but on one-to-many joins something like: aUser.timeOffRequests.select(TimeOffRequests.q.startDate > aDate) (only those requests after aDate for that user) and on many-to-many (eg Users<->Meetings): aUser.meetings.select(Meetings.q.organizer == aUser) (those meetings the user organized) (could also be directly a method of SO, aObj.joinNameWhere() or something. but I think I prefer it being a method of the join.) I'll take a look at the implementation if there's interest, I know it would have helped me in the past (instead of manually doing a select with the join column id). Looks like it may require beefing up joins though, along the lines of the SelectResults class. Thoughts? Quoting Ian Bicking <ia...@co...>: > Ian Sparks wrote: >> Before I start digging into the source code does the following >> ability already exist in SQLObject and, if not, does anyone else want >> it. >> >> AFAIK SQLObject can't do complex joins. For instance, I might want to >> do a query like : >> >> SELECT TimeOfRequests.* FROM TimeOffRequests INNER JOIN Users ON >> TimeOffRequests.cUserID = Users.cID WHERE Users.Dept = 12 > > Ah, and that is where you are wrong! > > TimeOffRequests.select(AND(TimeOffRequests.q.cUserID == Users.q.cID, > Users.q.Dept == 12)) > |
From: Ian B. <ia...@co...> - 2004-05-28 16:21:29
|
Ian Sparks wrote: > Before I start digging into the source code does the following > ability already exist in SQLObject and, if not, does anyone else want > it. > > AFAIK SQLObject can't do complex joins. For instance, I might want to > do a query like : > > SELECT TimeOfRequests.* FROM TimeOffRequests INNER JOIN Users ON > TimeOffRequests.cUserID = Users.cID WHERE Users.Dept = 12 Ah, and that is where you are wrong! TimeOffRequests.select(AND(TimeOffRequests.q.cUserID == Users.q.cID, Users.q.Dept == 12)) You can also do: TimeOffRequests.select("TimeOffRequests.cUserID = Users.cID AND Users.Dept = 12", clauseTables=['Users']) I imagine there are probably more complex queries that won't work, but one at a time... Ian |
From: Ian S. <Ian...@et...> - 2004-05-28 15:50:04
|
Before I start digging into the source code does the following ability = already exist in SQLObject and, if not, does anyone else want it. AFAIK SQLObject can't do complex joins. For instance, I might want to do = a query like : SELECT TimeOfRequests.* FROM TimeOffRequests INNER JOIN Users ON = TimeOffRequests.cUserID =3D Users.cID WHERE Users.Dept =3D 12 The result will be a set of "A" objects so I'd like SO to treat them as = such. So if SQLObject doesn't already support it what I'd like to be = able to do is : timeOffReqs =3D TimeOffRequests.get(passThrough=3D"SELECT TOR.* FROM = TimeOffRequests TOR INNER JOIN Users U ON TOR.cUserID =3D U.cID WHERE = U.Dept =3D 12") Obviously, I've just broken the portability of my code so if there were = a more SO-ish way of doing it I'd gladly take the education.=20 However, in some DB's like Firebird you can get SQL results from a = StoredProc or a view or something and this pass-through capability could = prove useful. Thoughts? |
From: Philippe N. <sw...@fr...> - 2004-05-26 16:01:00
|
On Wed, May 26, 2004 at 10:49:36AM -0500, Ian Bicking wrote: > > Huh, I tried to copy the maintainer but I don't see it on that email. > Anyway, the package is in the unstable Debian repository, python-sqlobject. > Ok just found it. http://mentors.debian.net/debian/dists/unstable/main/binary-all/python-sqlobject/ But it seems the package hasn't been uploaded to the official. Philippe |
From: Ian B. <ia...@co...> - 2004-05-26 15:54:18
|
Okay, I made this change (using os.path.sep) just for Firebird.=20 Generally /'s are supposed to be okay, and I'd rather stick with a=20 canonical form, so I don't want to change this for all databases (though=20 if it comes up for another database I might do it for all databases... I=20 guess the only one which might have a problem would be SQLite). Ian Sparks wrote: >>From scouring the source (is connectionForURI documented anywhere?) I d= iscover that the connectionForURI method takes an argument string somethi= ng like : >=20 > connectionForURI("<DB_TYPE>://<USERID>:<password>@<HOST>/<PATH>) >=20 > so for a Firebird connection : >=20 > connectionForURI("firebird://SYSDBA:masterkey@localhost/data/somewhere/= my_db.gdb") >=20 > but this seems broken on Windows if I want to connect to a DB on my D: = drive : >=20 > connectionForURI("firebird://SYSDBA:masterkey@localhost/D:/my_db.gdb") >=20 > I get some error about an "undefined service d/tcp.." from kinterbasdb = because its trying to open /D:/my_db.gdb and, naturally, gets confused >=20 > I believe that the following (naive) patch against dbconnection.py will= fix if inserted at line 95 : >=20 > if path.find(':') !=3D -1: > start,rest =3D path.split(':') > start =3D start.replace('\\','') > start =3D start.replace('/','') > path =3D start + ':' + rest >=20 > There is probably a better way but this fixes it for me. >=20 > Be good if something with the same effect could make it into 0.6 SVN. T= hank you. >=20 >=20 >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g= .=20 > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id149&alloc_id=8166&op=3Dclick > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss --=20 Ian Bicking / ia...@co... / http://blog.ianbicking.org |
From: Ian B. <ia...@co...> - 2004-05-26 15:51:04
|
Philippe Normand wrote: > Do you have the package somewhere ? Who's its maintainer ? At best I can > adapt it for 0.6, at worse I can make a package from scratch :) Huh, I tried to copy the maintainer but I don't see it on that email. Anyway, the package is in the unstable Debian repository, python-sqlobject. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
From: Ian B. <ia...@co...> - 2004-05-26 15:49:08
|
ludwig zeininger wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > hi > > just upgraded from 0.5.2 to the svn version. > > code like this: > > class Sub(SQLObject): > ... > > class Person(Sub): > _fromDatabase = True At this point your Person class doesn't have a _connection attribute for some reason. I'm not sure exactly why. (Since Person._connection is None, and the class gets setup right away, you get this exception) > which used to work in 0.5.2, now produces: > > Traceback (most recent call last): > File "test.py", line 31, in ? > class Person(Sub): > File "/usr/lib/python2.3/site-packages/sqlobject/main.py", line 159, in > __new__ > newClass.addColumnsFromDatabase() > File "/usr/lib/python2.3/site-packages/sqlobject/main.py", line 460, in > addColumnsFromDatabase > for columnDef in cls._connection.columnsFromSchema(cls._table, cls): > AttributeError: 'NoneType' object has no attribute 'columnsFromSchema' -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
From: Ian B. <ia...@co...> - 2004-05-26 15:46:21
|
Cary Fitzhugh wrote: > What is the proper way to put data into this column? > > As a string? What format? > > I'm using mySQL. mxDateTime, python 2.3's datetime, and the st_time in python 2.2's (?) time module should all work (in python 2.2 the time tuples because their own objects which just look like tuples, which SQLObject detects and formats appropriately). mxDateTime is probably preferred, as most database drivers return mxDateTime objects if they have the option. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
From: Eduardo E. <eel...@na...> - 2004-05-25 16:23:21
|
I use this import sqlobject import mx.DateTime class MySQLObject (SQLObject) mydate = DateTimeCol() o = MySQLObject.get(1) o.mydate = now() The mx package you get it from www.egenix.com Hope this helps. Ed. Cary Fitzhugh wrote: > What is the proper way to put data into this column? > > As a string? What format? > > I'm using mySQL. > > Thanks. > > _________________________________________________________________ > MSN Toolbar provides one-click access to Hotmail from any Web page – > FREE download! > http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/ > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click |
From: Philippe N. <sw...@fr...> - 2004-05-25 14:54:34
|
On Wed, May 19, 2004 at 10:51:48AM -0500, Ian Bicking wrote: > Philippe Normand wrote: > >Hi, > > > >Would anybody be interested in a sqlobject Debian package ? And which > >version, 0.5.x or 0.6 ? > > There's already a package, but I think it was made around 0.3 and hasn't > been updated. I've copied that author. I think 0.6 would be best. > I've been bad -- I should really release 0.5.3, and call the trunk 0.6 > and release it properly. Do you have the package somewhere ? Who's its maintainer ? At best I can adapt it for 0.6, at worse I can make a package from scratch :) Philippe |
From: Ian S. <Ian...@et...> - 2004-05-25 14:23:02
|
I've been trying to use Firebird with the SVN version of SQLObject. As a = result I have a couple of fixes to submit. All can easily be added to = col.py : Line 476: (class SOEnumCol) : def _firebirdType(self): """For enum columns firebird needs <typedef> <extraSQL> CHECK... but extraSQL isn't going to get added until firebirdCreateSQL = so we=20 return a tuple of <typedef>,<check> so that CreateSQL can = insert its extraSQL between them. """ length =3D max(map(len, self.enumValues)) enumValues =3D ', '.join([sqlbuilder.sqlrepr(v, 'firebird') for = v in self.enumValues]) checkConstraint =3D "CHECK (%s in (%s))" % (self.dbName, = enumValues) #NB. Return a tuple, not a string here return "VARCHAR(%i)" % (length), checkConstraint Line 218 : def firebirdCreateSQL(self): # Ian Sparks pointed out that fb is picky about the order # of the NOT NULL clause in a create statement. So, we handle # them differently for Enum columns. if not isinstance(self, SOEnumCol): return ' '.join([self.dbName, self._firebirdType()] + = self._extraSQL()) else: ##firebird SoEnumColumn returns a tuple return ' '.join([self.dbName] + [self._firebirdType()[0]] + = self._extraSQL() + [self._firebirdType()[1]]) Line 505 (class SODateTimeCol) : def _firebirdType(self): return 'TIMESTAMP' Line 527 (class SODateCol) : def _firebirdType(self): return 'DATE' All the firebird tests (that passed before) still pass. A note about the = tests : Some of them use python 2.3 specific code like sum(). Maybe = SQLObject now requires Python 2.3+ ? |