[TxMt] Re: Python: SQL in triple " strings scope

Jacob Rus jacobolus at gmail.com
Tue Oct 9 16:05:00 UTC 2007


Alexey Blinov wrote:
> I have something like this:
> cur.execute("""
> 	select svc.post.id_post,
> 		svc.post.id_post_zone,
> 		svc.post.post_name as post_name,
> 		svc.post_zone.zone_name as zone_name,
> 		svc.post.id_post_type,
> 		svc.post_type.post_type_name,
> 		svc.post_type.post_color
> 	from svc.post inner join svc.post_zone on svc.post.id_post_zone =
> svc.post_zone.id_post_zone
> 		inner join svc.post_type on svc.post_type.id_post_type = svc.post.id_post_type
> 			where svc.post.id_post = :id
> 		""",
> 		{'id':post}
> 	)

Off topic: have you tried any of the Python ORMs lying around?  My good 
friend keeps raving about SQLAlchemy. :)




More information about the textmate mailing list