[sqlalchemy] Backport for 0.4 on Python 2.4?

2007-09-23 Thread voltron

I have to use PGArray fields, but I think this is only available using
SQlalchemy 0.4. Easy_install only installs 0.4 when it detects Python
2.5. Is there some sort of backport available?


Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: Backport for 0.4 on Python 2.4?

2007-09-23 Thread Michael Bayer

download the 0.4 distro directly and use setup.py to install it.  im  
not sure what easy_install issue youre having (i only run py 2.4 here).


On Sep 23, 2007, at 4:59 PM, voltron wrote:


 I have to use PGArray fields, but I think this is only available using
 SQlalchemy 0.4. Easy_install only installs 0.4 when it detects Python
 2.5. Is there some sort of backport available?


 Thanks


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: Generate dynamic tables and classes from external definitions

2007-09-23 Thread Michael Bayer


On Sep 22, 2007, at 5:17 PM, Frederik wrote:


 Hi!

 I have an XML file that provides the information needed for table
 creation (column names, types, etc.). Is there any easy way in
 SQLAlchemy to dynamically build Table objects from this information?
 So if I get something like

 [{'name': 'firstname', 'type': 'string', 'length': 40}, {'name':
 'lastname', 'type': 'string', 'length': 40}]

 from the XML file, I want something like

 mytable = Table('mytable', metadata,
 Column('firstname', types.String(40)),
 Column('lastname', types.String(40))
 )

 to be generated.
 (oversimplified, I omitted stuff like primary_key, etc.)

 A simple way would be to generate a code string from the information
 and execute it with exec, but I'd like to know if there's a better way
 to do this in SQLAlchemy.

Table is a class constructor, the Column entries are *args sent to  
the constructor.  just create Column objects on the flyi.e.

types = {'string':String, 'int':Integer}

res = []
for rec in xmlrecords:
res.append(Column(rec['name'], types[rec['type']], ...))

t = Table(*res)

build on this as necessary to get the type arguments in, primary key  
flags, etc.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: Backport for 0.4 on Python 2.4?

2007-09-23 Thread voltron

Installing it manually worked. I dont think its an Easy_install issue,
it stated something about dependencies and 0.3.10 being the right
version for Python 2.4

On Sep 23, 11:06 pm, Michael Bayer [EMAIL PROTECTED] wrote:
 download the 0.4 distro directly and use setup.py to install it.  im
 not sure what easy_install issue youre having (i only run py 2.4 here).

 On Sep 23, 2007, at 4:59 PM, voltron wrote:



  I have to use PGArray fields, but I think this is only available using
  SQlalchemy 0.4. Easy_install only installs 0.4 when it detects Python
  2.5. Is there some sort of backport available?

  Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: Backport for 0.4 on Python 2.4?

2007-09-23 Thread Michael Bayer

yes thats because 0.3.10 is the current release version.  0.4 is  
hidden on the public cheeseshop listing so that people dont install  
a beta version as a production install.


On Sep 23, 2007, at 5:26 PM, voltron wrote:


 Installing it manually worked. I dont think its an Easy_install issue,
 it stated something about dependencies and 0.3.10 being the right
 version for Python 2.4

 On Sep 23, 11:06 pm, Michael Bayer [EMAIL PROTECTED] wrote:
 download the 0.4 distro directly and use setup.py to install it.  im
 not sure what easy_install issue youre having (i only run py 2.4  
 here).

 On Sep 23, 2007, at 4:59 PM, voltron wrote:



 I have to use PGArray fields, but I think this is only available  
 using
 SQlalchemy 0.4. Easy_install only installs 0.4 when it detects  
 Python
 2.5. Is there some sort of backport available?

 Thanks


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] r3507 breaks here

2007-09-23 Thread sdobrev

hi.
r3506 is still ok, while r3507 gives this:
result: [] expected: [35]
SAMPLE: 2006-09-11 00:00:00 2006-09-12 00:00:00 2006-09-14 00:00:00 
[35]
'trans exact, valids between _2' FROM test_range TimedRangeTestCase
--
Traceback (most recent call last):
  ...
  File test_timed_dbcook.py, line 142, in _get_range_val
q = me.val.get_obj_history_in_range( me.val.OBJ_ID, timeFrom, 
timeTo).all()
  File /home/az/src/hor-trunk/sqlalchemy/orm/query.py, line 571, in 
all
return list(self)
  File /home/az/src/hor-trunk/sqlalchemy/orm/query.py, line 619, in 
__iter__
return self._execute_and_instances(statement)
  File /home/az/src/hor-trunk/sqlalchemy/orm/query.py, line 624, in 
_execute_and_instances
return iter(self.instances(result))
  File /home/az/src/hor-trunk/sqlalchemy/orm/query.py, line 680, in 
instances
self.select_mapper._instance(context, row, result)
  File /home/az/src/dbcook/sqlalchemy/orm/mapper.py, line 1436, in 
_instance
self.populate_instance(context, instance, row, **flags)
  File /home/az/src/dbcook/sqlalchemy/orm/mapper.py, line 1496, in 
populate_instance
(newpop, existingpop, post_proc) = 
prop.create_row_processor(selectcontext, self, row)
ValueError: need more than 2 values to unpack

the result query is somewhat awwful, but it works before that:

-- TEST trans exact, valids between _2* SA: INFO 
SELECT PolymBase.disabled AS PolymBase_disabled, PolymBase.val 
AS PolymBase_val, PolymBase.time_valid 
AS PolymBase_time_valid, PolymBase.time_trans 
AS PolymBase_time_trans, PolymBase.obj_id 
AS PolymBase_obj_id, PolymBase.atype 
AS PolymBase_atype, PolymBase.db_id 
AS PolymBase_db_id, PolymLeaf.db_id AS PolymLeaf_db_id
FROM (
SELECT max(PolymBase.db_id) AS db_id, PolymBase.time_trans AS 
time_trans, PolymBase.time_valid AS time_valid
FROM PolymBase JOIN (
SELECT max(PolymBase.time_trans) AS 
time_trans, PolymBase.time_valid AS time_valid
FROM PolymBase
WHERE PolymBase.time_trans = ? AND PolymBase.time_valid 
= ? AND PolymBase.time_valid = ? AND PolymBase.obj_id = ? 
AND PolymBase.atype = ?
GROUP BY PolymBase.time_valid
) AS t1 ON PolymBase.time_valid = t1.time_valid 
AND PolymBase.time_trans = t1.time_trans
WHERE PolymBase.obj_id = ? AND PolymBase.atype = ?
GROUP BY PolymBase.time_valid, PolymBase.time_trans
) AS timedr, PolymBase JOIN PolymLeaf ON PolymLeaf.db_id 
= PolymBase.db_id
WHERE PolymBase.db_id = timedr.db_id AND NOT PolymBase.disabled 
ORDER BY PolymBase.time_valid
* SA: INFO [11, 12, 14, 1, 'PolymLeaf', 1, 'PolymLeaf']


any idea? i mau try prepare some stripped testcase but it'll take 
time...
if u wanna try, svn co then run make in 
https://dbcook.svn.sourceforge.net/svnroot/dbcook/trunk/dbcook/misc/timed2/test/
or do
PYTHONPATH=..:../../../..:../../..:$(PYTHONPATH) python 
test_timed_dbcook.py 

svil

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---