mako if statement

2010-01-20 Thread Matt Woolnough
I am trying to display a 'Log Out' link on a page that only is displayed when a user is logged in. When I try this link will not display when its inside the if statement. Anyone know how do? Thanks in advance, Matt -- class ItemController(BaseController): def index(self):

Re: mako if statement

2010-01-20 Thread Marcel Sander
Hi Matt, You mixed up True and False in your controller. should be class ItemController(BaseController): def index(self): identity = request.environ.get('repoze.who.identity') if identity is not None: c.name = identity['user'].username c.logout_button = T

MySQL has gone away (again)

2010-01-20 Thread grassoalvaro
Hi, i have problem with MySQL (like many others on groups and google). I have tried everything that i found, but nothing helped. This is my SQLAlchemy config: sqlalchemy.convert_unicode = true sqlalchemy.pool_size = 100 sqlalchemy.pool_recycle = 3600 sqlalchemy.url = mysql://user:passw...@127.0.

Re: MySQL has gone away (again)

2010-01-20 Thread Garland, Ken R
There are a few things which might cause this issue. Have a look at the following: *wait_timeout* *connect_timeout* *max_allowed_packet* I have no idea what your apps are trying to do in order to cause this so I'm not able to speak about that. Have a look at them to determine if any of the above

Re: MySQL has gone away (again)

2010-01-20 Thread Diana Clarke
This worked for me (using engine_from_config): from pylons import config from sqlalchemy import engine_from_config from foo.model import init_model engine = engine_from_config(config, 'sqlalchemy.') init_model(engine) Otherwise (using create_engine), make

Re: mako if statement

2010-01-20 Thread Matt Woolnough
More caffeine required tomorrow evening! Thanks Marcel. On Jan 20, 10:15 pm, Marcel Sander wrote: > Hi Matt, > > You mixed up True and False in your controller. > > should be > > class ItemController(BaseController): >     def index(self): >         identity  = request.environ.get('repoze.who.

Multiple domains with Routes

2010-01-20 Thread Jason S.
I've been experimenting with ways of handling multiple domains inside a single Pylons app (as opposed to an app for each domain). Routes has subdomain support built-in, but mapping domains to subdomains just leads to problems with generating URLs. So I wrote a bit of alpha code today to implement