That worked. Thanks !
Jay
On 11/16/11 5:46 PM, Michael Merickel wrote:
You will need to use the pkg_resources api from the Python stdlib.
Currently (this will be fixed in 1.3) there is no public API for
computing paths.
import pkg_resources
asset_path = 'mypackage:static/favicon.ico'
packa
You will need to use the pkg_resources api from the Python stdlib.
Currently (this will be fixed in 1.3) there is no public API for computing
paths.
import pkg_resources
asset_path = 'mypackage:static/favicon.ico'
package, file = asset_path.split(':', 1)
abs_path = pkg_resources.resource_filename
How do I get the absolute path for static assets ? The reason I need
the absolute path is to determine the last modified time of a specific
file so I can append it to my static resources like JS and CSS files.
I wrote a Mako template def like this but it fails at : here =
os.path.dirname(__file
Hello,
The Mako syntax looks right, but you're using a Chameleon file
extension on your template. With the default renderer settings,
Pyramid will attempt to render it as a Chameleon template and won't
recognize the Mako formatting. It should work if you rename the
template to listOfHosts.mako ins
I'm new to Pyramid and trying to get it to work with me, I've
installed pyramid-1.2.1 in a virtualenv and I'm trying to loop through
a simple list within a template but it seems to me that the statement
"% for item in cisList" does not initialize the "item" variable but if
I call ${cisList[0]['name
According to my tests it is, or at least the end result is savepoint
release being emitted before final commit. For this code:
sp = transaction.savepoint()
... do something
session.flush()
sp2 = transaction.savepoint()
... do something
session.flush()
# Oops, Integrit
I will say that after looking at the SQLAlchemy documentation once again,
it does say "For each begin_nested() call, a corresponding rollback() or
commit() must be issued." and even from looking at the unit tests in
zope.sqlalchemy I cannot tell where the required commit() is issued per
savepoint.
Yes it actually works if I use session.flush() instead of
transaction.commit() within the subtransaction. So I guess
transaction.commit() and transaction.abort() close the entire
transaction unlike session.commit() which when matched against
session.begin_nested() releases the savepoint but k
On Tue, 2011-11-15 at 11:44 -0600, Michael Merickel wrote:
> It's been hard to follow what has actually been tried, but I just
> wanted to point some stuff out about zope.sqlalchemy (the code for it
> is literally 1 small file and shouldn't be talked about with such a
> scary tone).
>
>
> When do