accessing config variable in views

2012-09-02 Thread Anil
In my def main(global_config, **settings) I have the config = Configuration(...) variable. How would I access this config variable from my views? Some people have suggested using request.registry.settings, but I don't see it in that dictionary in my 1.3.3 version. Background: I am using pyr

passing html class variable in pyramid_simpleform

2012-08-26 Thread Anil
I am using the class FormRenderer() and calling it's renderer = FormRenderer(form) ${renderer.password("password", size=25, class="input")} When I try to add that class kw option, I get an exception: SyntaxException: (SyntaxError) invalid syntax (, line 1) (u'renderer.password("password", siz

unicode/encoding help

2010-03-17 Thread Anil
I have a page where I encode the request.params to utf-8 before processing. It works fine. This is behind paster. But soon after I push out the page to production with nginx in front of paster, I get these encoding errors: GET /ab/get?q=&tag=G%C3%83%C2%B6Do Accept: text/html,application/xhtml+xm

Re: server hosting and pylons

2010-03-11 Thread Anil
You can also check out http://Entic.net for OpenSolaris based VPS. That and a few other sites we have are powered by Pylons too. :) Thanks Anil PS: Thanks for an awesome web framework. Been using it since the past 2+ years now. On Thu, Mar 11, 2010 at 10:32 AM, gazza wrote: > > Yeh slic

mako next.body() question

2010-02-22 Thread Anil
Here is an example I have: ## base.html ${next.body()} ## layout.html <%inherit file="base.html"/> ${next.body()} ## index.html <%inherit file="layout.html"/> ## .. rest of template Of course, rendering index.html will inherit the other two files (base.html and layout

authkit "dual authentication"

2010-02-22 Thread Anil
I have an application doing HTTP basic auth. It expects email address for user name and a password. Soon after, I found out that Google Checkout notification API that we use was also doing a HTTP basic auth but sends out an "id:key" encoded authorization. The digest auth was using a custom class

SQLAlchemy mapped table's relation

2010-02-17 Thread Anil
I have a mapped table like this: mapper(User, t_user, properties = { 'plans': relation(Plan)}) Is it possible to relate the User object to a column in the Plan table with a column "status" set to "active"? Thanks -- You received this message because you are subscribed to the Google Groups "py

Re: Weird exception with formencode

2010-02-15 Thread Anil
an id/class)? Thanks On Mon, Feb 15, 2010 at 8:41 AM, Anil wrote: > I was playing around with Authkit. Then later I decided to not use it. > Removed all of the configuration changes I've done, in the environment. But > now I get this exception: > > ⇝ AssertionError: I don&#x

Weird exception with formencode

2010-02-15 Thread Anil
I was playing around with Authkit. Then later I decided to not use it. Removed all of the configuration changes I've done, in the environment. But now I get this exception: ⇝ AssertionError: I don't know about this kind of : textbox (pos: (193, 24)) Module ?:*2* in check

lighttpd and scgi

2009-06-29 Thread Anil
Couple of you helped me out on IRC regarding this (actually pointed to better solutions... thanks) but I am curious why my deployment using lighttpd and scgi doesnt work. I have a dev environment where I do not have a web server, just using paster. The same code breaks when I use lighttpd and scgi

formbuild.builder.field no button method

2008-12-04 Thread Anil
There doesn't appear to be a button method in that class. Should I just write one in HTML? --~--~-~--~~~---~--~~ 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@g

fd limit

2008-05-19 Thread Anil
Is it possible with paster (through .ini files?) to set the max file descriptors available to it? I guess otherwise I'll have to write a wrapper script and do a ulimit. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Beaker Trunk With Appengine

2008-05-16 Thread Anil
I am trying to run pylons with google app engine and everything is working perfectly locally, but when I upload the site live beaker gives me the following error. Anyone have any idea on where to start debugging? http://pastebin.com/m7fc2a3c7 --~--~-~--~~~---~--~~

h.link_to_remote help

2007-12-03 Thread Anil
${ h.link_to_remote("Download", dict(url=h.url(controller="export", action="pdf")) ) } I have a link like that. The action "pdf" generates a PDF file. Then, I want to "show" this PDF file to the browser (for download). How can I do this? I am thinking I need to send back some headers, but not su

Re: [FE-discuss] formencode invalid exception

2007-11-29 Thread Anil
esponsible for all encoding/decoding, according to the WSGI spec: http://www.python.org/dev/peps/pep-0333/#unicode-issues The WSGI interface only supports plain strings. - Allan On Nov 29, 2007 11:56 AM, Ian Bicking <[EMAIL PROTECTED]> wrote: > Anil wrote: > > I am using Formenco

formencode invalid exception

2007-11-29 Thread Anil
I am using Formencode and it seems that it throws an uuencoded Invalid exception and flup seems to have problems with it. I don't notice it on another server with the same code and same version of Pylons/flup. Whats the best way to fix this? If I should encode the form "error message" to utf-8, w

Re: SQLAlchemy 0.4.. reflected tables

2007-08-21 Thread Anil
y - that's why I mentioned to specify it. > > Uwe > > > On Tuesday 21 August 2007, Anil wrote: > > Yea, that did it but I thought the autoload=True should get that from > > the existing Table, and not require specification. > > > > On Aug 21, 11:42 am, &

Re: SQLAlchemy 0.4.. reflected tables

2007-08-21 Thread Anil
work. > If it's a view, you'll have to specify the primary key like such: > > user_table = Table("User", metadata, Column('uid',Integer(),primary_key=True), > autoload=True, autoload_with=config['pylons.g'].sa_engine) > > On Tuesday 21 August 2007,

SQLAlchemy 0.4.. reflected tables

2007-08-21 Thread Anil
I have my table defined as such: user_table = Table("User", metadata, autoload=True, autoload_with=config['pylons.g'].sa_engine) Which throws this exception: Module entic.controllers.access:74 in _login << # select our user user_q = model.Session.query(model.User)

Re: beaker session problem

2007-06-20 Thread Anil
rd"]) session.save() def some_func(): if pass == md5: info = { 'sdf': 'sdfsx' } return info raise some_exception On 6/21/07, Ben Bangert <[EMAIL PROTECTED]> wrote: > On Jun 20, 2007, at 7:15 AM, Anil wrote: > > > File 'C:\\Documents and > &

beaker session problem

2007-06-20 Thread Anil
File 'C:\\Documents and Settings\\anilj\\workspace\\Entic.net\\trunk\\Site\\entic\\controllers\\access.py', line 48 in check session.save() File 'c:\\python25\\lib\\site-packages\\beaker-0.7.4dev_r126-py2.5.egg\\beaker\\session.py', line 216 in save self.load() File 'c:\\python25\\lib\\site-

Re: storing SA mapped objects in beaker sessions

2007-05-28 Thread Anil
else changes something else in the background perhaps via an mysql client. :) Thanks! On 5/28/07, Alexandre CONRAD <[EMAIL PROTECTED]> wrote: > > > On 5/27/07, Anil <[EMAIL PROTECTED]> wrote: > >>user = session["user"] > >>alert = model.Alert(

storing SA mapped objects in beaker sessions

2007-05-27 Thread Anil
ect. I get this exception. : Object '' is already attached to session '13378672' (this is '12302224') Can someone give me pointers on how I can resolve this? Plus, are there any best practices for passing around SA mapped objects in beaker sessions? Thanks, Anil --~--~-

Re: 'Address already in use' error

2007-05-27 Thread Anil
There must be other python/paster processes running somewhere. Do a "ps -aux | grep python" and kill them, as appropriate. On 5/27/07, Dave <[EMAIL PROTECTED]> wrote: > > I've been developing a pylons app for a while now locally under OS X > and all seems fine, but recently I've started getting

Re: Session ID

2007-05-24 Thread Anil
Are you talking about session.id? On 5/23/07, Mike Orr <[EMAIL PROTECTED]> wrote: > > How do I get the session ID of the current transaction? > > -- > Mike Orr <[EMAIL PROTECTED]> > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: lighttpd+fastcgi config files?

2007-02-22 Thread Anil
2, "check-local" => "disable" ) ) ) Pylons configuration file, production.ini: ... [server:main] use = egg:Paste#http #Use Fastcgi threaded [server:main] use = egg:PasteScript#flup_scgi_thread host = 127.0.0.1 port = 4000 ... You can't use sockets for scgi. I h

lighttpd+fastcgi config files?

2007-02-21 Thread Anil
Can someone post some sample configuration files for lighttpd+fastcgi implementation? I need to do some urgent benchmarking and I couldn't get something going from some of the documentation. Thanks, Anil --~--~-~--~~~---~--~~ You received this message becaus

updating select box dynamically

2006-12-25 Thread Anil
I receive some weird error when doing this... <% h.submit_to_remote('button', 'Create', update="someThing", complete=h.remote_function( update="users", url=h.url(controller='run', action='ok', id='users') ), url=h.url(controller='api', ac

file uploads with h?

2006-12-17 Thread Anil
How do you do them? i started to do it but i don't think i am doing it correctly. I am uploading a file from a windows client to pylons server running in Unix. <% h.file_field("import_file") %> <% h.submit_to_remote('button', 'Import', html={'class':"button2"}, update="something",

Re: formbuild and AJAX calls

2006-12-15 Thread Anil
On 12/15/06, Philip Jenvey <[EMAIL PROTECTED]> wrote: > > > On Dec 13, 2006, at 8:29 PM, Anil wrote: > > > > > I am using the _remote calls to update a div element with a formbuild > > form. With what I have, the form gets rendered correctly in the div &g

formbuild and AJAX calls

2006-12-13 Thread Anil
I am using the _remote calls to update a div element with a formbuild form. With what I have, the form gets rendered correctly in the div element "Canvas", but once I submit the form or if the form has errors, the template opens up in a new web page... the errors don't show up in the Canvas div el

specifying style to submit_to_remote

2006-11-19 Thread Anil
How do I specify a style to a remote button, lets say a class "button"? This didn't work: <% h.submit_to_remote('button', 'Delete', class="button", confirm='Are you sure?', url=h.url(controller='/api', action='delete')) %> Thanks. --~--~-~--~~~---~--~~ You rece

DOM with pylons/python

2006-11-14 Thread Anil
How would I accomplish something like this, hope its straightforward: <%method loadUserList> <%python> """ Do a lot of database data retreival/parsing. Once that is done, I want to use this data and post it back into the doc.getElementById('users') element, how do I do that using pylons/

Re: problem with formbuild

2006-10-27 Thread Anil
Yea, I've dug around with pdb and I found out what the problem was. I had this form: <% c.form.layout.field(field='text', caption='Mail', name='mail') %> <% c.form.layout.field(field='password', caption='Password', name='password') %> But the schema was: class FormSchema(formenc

Re: problem with formbuild

2006-10-27 Thread Anil
> > If you enter invalid data in the form the code you have written will > correctly return the response that formbuild.handle() generates so the > print line is never executed. If you enter valid data then 'good' would > be printed as expected. The problem is that 'good' is never printed, even w

problem with formbuild

2006-10-27 Thread Anil
I am using FormBuild using handle() method as described in the example in http://formbuild.org/docs/pylons.html. Once the form validation is complete, the next actions are not performed: # build the form results, errors, response = formbuild.handle( schema=model.forms

Re: confusion with FormBuild

2006-09-27 Thread Anil
FYI, I've noticed some oddity where the forms are filled in (from the same computer) even when the page is *not* re-POSTED. I do'nt know if that was intended behavior. I haven't had time to look to debug it. (with python 2.3) On 9/27/06, dykang <[EMAIL PROTECTED]> wrote: > > James, > > Thanks f

Re: Form Handling Documentation and FormBuild Announcement

2006-09-21 Thread Anil
I've noticed this too. I noticed this happended after going from 0.9.2 to 0.9.3. (was it pulled from the site now?) On 9/21/06, Daniel Lyons <[EMAIL PROTECTED]> wrote: > Hello again, > > On 9/20/06, Daniel Lyons <[EMAIL PROTECTED]> wrote: > > I've gone through the FormBuild tutorial and I've got