Re: [Zope] MySQL queries in Python

2006-08-01 Thread John Barham
import MySQLdb This is probably redundant. import string request = container.REQUEST session = request.SESSION result = (context.aq_parent).selects.select_from_table() print result Assuming you want the person's name printed, change this line to: print result[0].name Think of the

[Zope] Using PUT_factory for objects outside of ZODB

2006-03-07 Thread John Barham
I want to be able to intercept PUT requests to Zope to store objects outside of the ZODB by storing the body of the PUT request in an SQL database. I've written a PUT_factory external method that calls the function PUT_ParameterFile defined below: == [...boilerplate Zope imports...]

[Zope] Programmatically flushing entries from RAM cache?

2005-12-14 Thread John Barham
Is it possible to flush a path w/ a specific argument from a RAM cache from a Python script? Here's my situation: I have a script FolderExists() that takes a single path argument and, after running an SQL query, returns True or False if the folder path exists or not in the database. Since the