pylons

Pylons/Formencode With Multiple Checkboxes

Hi Stackoverflow! I ran up against a few problems with Pylons/Formencode today when it came to validating multiple checkboxes. As a bit of background I have something like this in my Mako template: <input type="checkbox" name="Project" value="1">Project 1</input> <input type="checkbox" name="Project" value="2">Project 2</input> <input ...

I want to create a "CGI script" in python that stays resident in memory and services multiple requests

I have a website that right now, runs by creating static html pages from a cron job that runs nightly. I'd like to add some search and filtering features using a CGI type script, but my script will have enough of a startup time (maybe a few seconds?) that I'd like it to stay resident and serve multiple requests. This is a side-project...

starting my own threads within python paste

I'm writing a web application using pylons and paste. I have some work I want to do after an HTTP request is finished (send some emails, write some stuff to the db, etc) that I don't want to block the HTTP request on. If I start a thread to do this work, is that OK? I always see this stuff about paste killing off hung threads, etc. Will...

Pylons importing Psycopg2 error

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Python/2.6/site-packages/psycopg2/__init__.py", line 60, in <module> from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID ImportError: dlopen(/Library/Python/2.6/site-packages/psycopg2/_psycopg.so, 2): Symbol not found: _PQbackendPID R...

ToscaWidgets CalendarDatePicker pylons

How does one set the date on the CalendarDatePicker. i.e. it defaults to current date and I want to display it with another date which I will set from my controller. I am displaying the CalendarDatePicker widget in a TableForm from tw.form. I have looked at this for a few hours and can't work out how to do this so any pointers greatly a...

SQLAlchemy: relation in mappers compile result of function rather than calling the function when the relation is queried

I have a number of mappers that look like this: mapper(Photo,photo_table, properties = { "locale": relation(PhotoContent, uselist=False, primaryjoin=and_(photo_content_table.c.photoId == photo_table.c.id, photo_content_table.c.locale == get_lang()), foreign_keys=[photo_content_table.c.photoId, photo_content_table.c.locale]) I have dep...

How to run code on Pylons startup

I have a Python 2.6 web app built on Pylons 0.9.7. The code in my controller only runs the first time a client requests it, which is fair enough, but is there any way I can run some code as soon as the server starts and is ready to accept requests, without waiting until a request is actually received? ...

sqlalchemy: AttributeError: 'tuple' object has no attribute 'insert'

I was playing around making a simple haiku site using sqlalchemy and pylons. It basically takes a haiku, writes it to a database, and displays the haiku. The problem appears when I get the data from the form and try and write it to a database, Pylons give me this error: AttributeError: 'tuple' object has no attribute 'insert' after I run...

pylons/paste config files in fastcgi (deployment)

I'm running a pylons app using fastcgi and apache2. There are two versions (different revisions from my svn repo), one for staging and one for production. I'd like them to use different paste config files. Right now, my dispatch.fcgi inside htdocs in the pylons app just uses one config file (so both stage and live use the same confi...

Why does Pylons use StackedObjectProxies instead of threading.local?

It seems like threading.local is more straightforward and more robust. ...

Pylons deployment questions

I'm a beginner with Pylons and I've mostly developed on my localhost using the built-in web server. I think it's time to start deployment for my personal blog, I have a Debian Lenny server with apache2-mpm-prefork module and mod_wsgi - I've never really used mod_wsgi or fastcgi and I hear either of these are the way to go. My questions:...

How do you serve vanilla/custom pages in an MVC based site?

Let's say you've setup your site using Pylons, Django and most of the site runs fine and according to the framework used. However, what if you had a custom section that was entirely say, composed of flat html files and its own set of images, which you didn't have time to actually incorporate using the framework and were forced to basical...

Customize login page template for Authkit with Pylons?

I'm new to both Pylons and AuthKit. I have basic authentication via AuthKit working in my application, but I don't know how to customize the template for the login page. The one included with AuthKit is very generic. I found Pylons: Mako Templates in AuthKit, but I thought there might be a more up-to-date solution. ...

Pylons and Memcached

Anyone happen to use this combination in their web application? I'm having a bit of trouble finding some sort of tutorial or guideline for configuring this. Also seeing as how I started using Pylons recently I'm not familiar so please keep the advice very newbie friendly ( I haven't even used modules like Beaker all that much ). I'm usi...

Can SQLAlchemy update the table structure ?

Hello, I am working on my first pylons + SQLAlchemy app (I'm new to both). As I change my mind on the table structure, I wish there was a similar function to metadata.create_all(), that checks if there are new columns definitions and create theme in the database. Does such a function exist ? ...

Windows with Plesk Panel installs ActiveState Python 2.5.0 - any thoughts?

I expect to run Pylons on a Windows Server 2003 and IIS 6 on a Virtual Private Server (VPS). Most work with the VPS is done through the Plesk 8.6 panel. The Plesk panel has a lot of maintenance advantages for us. However, this Plesk configuration installs ActiveState Python 2.5.0. The Parallels Plesk documents for 8.6 and version 9 insis...

python paste using global egg instead of local one

I'm using Paste to run a Pylons application. Is there a way to specify in my paste config file to use the egg from the current directory (the same dir as the config file) instead of looking in global site-packages? For example, right now the config file has: [app:main] use = egg:example This definitely looks to site-packages. This ...

Who's Online in Pylons

I currently have a Pylons application running with a basic user system set-up. I want to try and create a widget that shows the users that are currently logged on to the website. I'm not sure how I should handle this though; I'm not sure if pylons sessions being active are based on whether or not a user is actually on the web apps page o...

Pylons howto get windows user

Is it possible to get the current windows user from with in pylons? I am starting a pylons app that is going to be used from within a controlled Windows domain. Is it possible to get the logged on user? Much like I would do in ASP.NET with Page.User.Identity.Name. ...

how pylons decorator works

from decorator import decorator from pylons.decorators.util import get_pylons def allowed_roles(roles): def wrapper(func, *args, **kwargs): session = get_pylons(args).session # edit pylons session here. return func(*args, **kwargs) return decorator(wrapper) Can anyone explain how it works? ...