Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Mike Orr
On 8/15/07, Jose Galvez [EMAIL PROTECTED] wrote: Wow a lot to digest. I use assign_mapper which needs the session_context how do I get that with the the new setup? It was pretty easy to get with sacontext, I'm not sure how to get at it with this new setup Use Session.mapper instead of

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Jose Galvez
Ok I think I posted to soon, I needed to read the website a little more closely before firing off stupid questions. Jose Jose Galvez wrote: Wow a lot to digest. I use assign_mapper which needs the session_context how do I get that with the the new setup? It was pretty easy to get with

Re: iframe issue

2007-08-16 Thread Jose Galvez
the error is because the test1.html should not be relative to the template, but rather in your public folder Jose Alagu Madhu wrote: Hi templates/ test.mako test1.html test.mako: iframe src=test1.html / I am getting error... Error 404 .. NOT FOUND Thanks

Re: iframe issue

2007-08-16 Thread [EMAIL PROTECTED]
On Aug 16, 9:03 am, Jose Galvez [EMAIL PROTECTED] wrote: the error is because the test1.html should not be relative to the template, but rather in your public folder Jose if i place the test1.html in public foder is working,but i need in templates folder. Thanks Madhu Alagu

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Alexandre CONRAD
Jose, Jose Galvez wrote: Wow a lot to digest. I use assign_mapper which needs the session_context how do I get that with the the new setup? It was pretty easy to get with sacontext, I'm not sure how to get at it with this new setup this could be some more ressource for you: I posted my

Re: CSS/Javascript in Pylons

2007-08-16 Thread Jose Figueras
OK, but: 1. what if I use 50+ pages? I need to write 50+ if clauses 2. when I add a new page, I must to remember to add a new if clause 3. my pages def (style with CSS, behaviour with Javascript and content with HTML) are distributed in 2+ documents. This is not the better case for me.

Re: [Paste] Can't start pylons app

2007-08-16 Thread Neil Blakey-Milner
On 8/16/07, Cliff Wells [EMAIL PROTECTED] wrote: On Wed, 2007-08-15 at 19:15 +0200, Neil Blakey-Milner wrote: Or, even better, use virtual-python or workingenv, and never install moving targets into your core Python library location. Out of curiosity, what does workingenv offer over the

Re: iframe issue

2007-08-16 Thread Cezary Statkiewicz
2007/8/16, [EMAIL PROTECTED] [EMAIL PROTECTED]: On Aug 16, 9:03 am, Jose Galvez [EMAIL PROTECTED] wrote: the error is because the test1.html should not be relative to the template, but rather in your public folder Jose if i place the test1.html in public foder is working,but i need in

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Christoph Haas
On Wed, Aug 15, 2007 at 06:04:22PM -0700, Mike Orr wrote: I've updated SQLAlchemy for people in a hurry with the new SQLAlchemy 0.4 programming pattern designed by Ben, MikeB, and myself. We're no longer using SAContext but instead putting the engine, metadata, and contextual session

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Michael Bayer
On Aug 16, 5:26 am, Christoph Haas [EMAIL PROTECTED] wrote: Worse is that I can't query for objects through paster shell. I get this exception: /home/chaas/projekte/dnsdhcp/dnsdhcp/model/__init__.py in pylons_scope() 16 import thread 17 from pylons import config --- 18

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Michael Bayer
On Aug 16, 5:34 am, Vegard Svanberg [EMAIL PROTECTED] wrote: * Christoph Haas [EMAIL PROTECTED] [2007-08-16 11:26]: Oh, well, the whole project seems to be a increasingly moving target. First pylons.database is deprecated and replaced by SAContext. Then SAContext is deprected. Takes

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread jk
It looks like there are some issues with threading. I put the lines try: model.Session.configure(bind = g.sa_engine) return WSGIController.__call__(self, environ, start_response) finally: assert hasattr(model.Session, 'registry')

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Michael Bayer
So it had the attribute registry right before the remove() call, but somewhere deep inside the attribute vanished. the remove() call is actually not correct in release beta2, so ive updated the article to reference beta3 and/or the current trunk. also i changed the configure call above it

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Michael Bayer
ive released beta3 which fixes the remove() issue. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from

Re: iframe issue

2007-08-16 Thread Jose Galvez
The point is that you are calling the iframe source incorrectly. If your test1.html is a static file then it needs to be in your public folder, if its a template then you need to tie it to a controller and call the appropriate controller Jose On 8/16/07, [EMAIL PROTECTED] [EMAIL PROTECTED]

formencode

2007-08-16 Thread Jose Galvez
I'm trying to use formencode to validate a simple form. The question I have is: How can I make a field conditionally required? This is what I have, I have a pull down, with an other option. What I want to do is if other is selected then have a textbox become visible and be required, but only

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Jose Galvez
Well for me, I think in my production stuff I'll stick with sacontext and sqlalchemy 3x until this sorts out a little. Having said that I will play with the new stuff in a separate workingenv to get a taste of how things are going to work in the near future. What would be really nice is if

Re: iframe issue

2007-08-16 Thread Philip Jenvey
On Aug 16, 2007, at 11:14 AM, Jose Galvez wrote: The point is that you are calling the iframe source incorrectly. If your test1.html is a static file then it needs to be in your public folder, if its a template then you need to tie it to a controller and call the appropriate

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Michael Bayer
+1 on a pylons-sqlalchemy template since if youre *really* in a hurry, thats the best --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Mike Orr
First, apologies for the mistakes in the tutorial. I'm going to convert my own application today, so that will be a practical test. But I did say to check back in 24 hours in case there are corrections. Let's make that 48 hours from now, to take care of any remaining beasties. On 8/16/07,

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Christoph Haas
On Thu, Aug 16, 2007 at 01:55:26PM -0700, Mike Orr wrote: First, apologies for the mistakes in the tutorial. I'm going to convert my own application today, so that will be a practical test. But I did say to check back in 24 hours in case there are corrections. Let's make that 48 hours from

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Mike Orr
On 8/16/07, Christoph Haas [EMAIL PROTECTED] wrote: There is one problem left for me now. The code in lib/base.py doesn't seem to do its job properly: File '/home/chaas/projekte/dnsdhcp/dnsdhcp/lib/base.py', line 43 in __call__ model.Session.remove() File

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread xlyz
update to beta3 plz I'm not able to install it it creates an empty directory # easy_install SQLAlchemy-0.4.0beta3.tar.gz Processing SQLAlchemy-0.4.0beta3.tar.gz Running SQLAlchemy-0.4.0beta3/setup.py -q bdist_egg --dist-dir

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread xlyz
Il giorno ven, 17/08/2007 alle 01.49 +0200, xlyz ha scritto: update to beta3 plz I'm not able to install it it creates an empty directory /usr/lib/python2.5/site-packages/SQLAlchemy-0.4.0beta3-py2.5.egg never mind. it's not a directory, but a zipped file /me hides in a corner

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread xlyz
You may want to check the article again in 24 hours in case SQLAlchemy experts have corrected any errors. One thing I'm adding right now is the pylons_scope function. I'm not an expert, but in your model you need to add: import pylons or you get: type 'exceptions.NameError': name 'pylons'

Re: [Paste] Can't start pylons app

2007-08-16 Thread Mike Orr
On 8/15/07, Christoph Haas [EMAIL PROTECTED] wrote: Morale: never install eggs on a Debian-based system. Use workingenv when trying out a new version of Pylons, so that you can delete the entire environment easily. It's also great for developing an application and trying them out under several

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread xlyz
Il giorno ven, 17/08/2007 alle 02.34 +0200, xlyz ha scritto: You may want to check the article again in 24 hours in case SQLAlchemy experts have corrected any errors. One thing I'm adding right now is the pylons_scope function. I'm not an expert, but in your model you need to add:

turning binary data into a file.

2007-08-16 Thread SamDonaldson
Guys, I have one short question and this relates to the FieldStorage Pylons file object in the way it represents a posted image. Does anybody know what the 'file' attribute's type is in the object on which read/write/close is invoked? I'm trying to do the following: I'm reading in binary data

Re: turning binary data into a file.

2007-08-16 Thread Jose Galvez
have you tried buf = urllib.urlopener().read() f = file('/somefile.jpg', 'wb') f.write(buf) f.close() Jose SamDonaldson wrote: Guys, I have one short question and this relates to the FieldStorage Pylons file object in the way it represents a posted image. Does anybody know what the

Re: turning binary data into a file.

2007-08-16 Thread SamDonaldson
Actually, what I'd like to be able to do is not physically create a file. I'd like to just hold that buf as a file object in memory on which the read/write api's can get applied. In other words, I don't want a somefile.jpg on my filesystem. I want to pass that buffer as a file object on to