[web2py] Re: Apache, Wsgi problem

2011-02-10 Thread Michael Toomim
Great!! I also had threads=25 and changed this to threads=1 processes=5, so it makes sense that I was encountering the same problem. It sounds like something in web2py might not be thread-safe. The next time I run a production test I will report if this fixes the problem. On Feb 10, 2:38 pm,

[web2py] Re: Authorization to create/update an item

2011-02-10 Thread villas
It sounds like you need to study more the Access Control chapter of the book. You don't necessarily need to create a new controller, but whether you choose to do so or not is due to your own requirements. Once you have studied the built-in authorisation system in a little more depth, all should

[web2py] Cache.disk() expiring unexpectedly

2011-02-10 Thread Dane
I'm trying to use cache.disk to cache a large TABLE object indefinitely. It seems to work fine at first, but then expires after a couple minutes. I'm setting it like this: cache.disk.clear('^%s$' % cache_key) cache.disk(cache_key, lambda:grid, None) *(I also tried 10**10 instead of None for

[web2py] Re: Cache.disk() expiring unexpectedly

2011-02-10 Thread Dane
This is in my development environment on Windows 7 by the way. On Feb 10, 7:17 am, Dane dane.schnei...@gmail.com wrote: I'm trying to use cache.disk to cache a large TABLE object indefinitely. It seems to work fine at first, but then expires after a couple minutes. I'm setting it like this:

[web2py] custom form without using database?

2011-02-10 Thread Panupat
I'm trying to put different input fields into different html elements. In the book only mentioned how to use custom form with pre-defined database. db.define_table('image', Field('name'), Field('file', 'upload')) {{=form.custom.begin}} {{=form.custom.widget.name}} If I am creating

[web2py] Re: PyPy faster than C ...

2011-02-10 Thread villas
Cool indeed! But please remember NOT to mention any of this to your partner on Valentine's night!

Re: [web2py] custom form without using database?

2011-02-10 Thread Bruno Rocha
form = FORM() form.element().append(LABEL(_for='name',_value='Name')) form.element().append(INPUT(_type='text',_name='name')) print form form action= enctype=multipart/form-data method=postlabel for=name value=Name/labelinput name=name type=text //form --- Bruno Rocha

Re: [web2py] custom form without using database?

2011-02-10 Thread Panupat Chongstitwattana
What I meant was breaking the form down to pieces and put them at the appropriate places. Like, tr td 'Name :' comes here /td td INPUT _name comes here/td /tr tr td 'Password :'/td td INPUT _password /td etc. On Thu, Feb 10, 2011 at 7:37 PM, Bruno Rocha rochacbr...@gmail.com wrote: form =

Re: [web2py] custom form without using database?

2011-02-10 Thread David J.
Side Question; How can you add validators this way? On 2/10/11 7:37 AM, Bruno Rocha wrote: form = FORM() form.element().append(LABEL(_for='name',_value='Name')) form.element().append(INPUT(_type='text',_name='name')) print form form action= enctype=multipart/form-data method=postlabel

[web2py] Re: custom form without using database?

2011-02-10 Thread villas
See the Forms and Validators section of the book. You have total flexibility if you want to go to the trouble of building your own form. Check out the Custom Forms section of that chapter. On Feb 10, 12:45 pm, Panupat Chongstitwattana panup...@gmail.com wrote: What I meant was breaking the

[web2py] Re: custom form without using database?

2011-02-10 Thread Panupat
Villas - I have read the book. The form.custom only works with SQLFORM and crud. I cannot use that same method with FORM. Looks like there are some other properties of the form I can output in the view... so far I found {{=form.formname}} - which just give me the word default {{=form[0]}} 1 2 3

Re: [web2py] Re: custom form without using database?

2011-02-10 Thread Bruno Rocha
I almost always use forms in this following way: *#Create a DIV to WRAP it all* div = DIV(FORM()) print div divform action= enctype=multipart/form-data method=post/form/div *#Take the elements of the wrapper using DOM* print

[web2py] Re: Apache, Wsgi problem

2011-02-10 Thread Massimo Di Pierro
This is a very important test. I believe web2py to be thread safe and in fact we thread.lock every access to shared objects even if operations are atomic, yet I will review it in detail. Massimo On Feb 10, 12:38 am, VP vtp2...@gmail.com wrote: Alright people short answer:  I think I figured

[web2py] Re: custom form without using database?

2011-02-10 Thread Panupat
Thanks Bruno. That looks very promising I'm trying it out now :) I got mine working too but it's very amature dir to find what's there and add bits and pieces of them into the view. /sigh. On Feb 10, 8:22 pm, Bruno Rocha rochacbr...@gmail.com wrote: I almost always use forms in this

Re: [web2py] Re: custom form without using database?

2011-02-10 Thread Bruno Rocha
Anyone know what properties I can call to get the hidden fields? Using SQLFORM you have form.hidden_fields() but using FORM you need to use Server side DOM and Parsing # *# Create a form with hidden elements* form =

[web2py] Re: custom form without using database?

2011-02-10 Thread Dane
What about widgets? IS_IN_DB() for example. Is there a way to get those working with a regular FORM without using SQLFORM? On Feb 10, 8:22 am, Bruno Rocha rochacbr...@gmail.com wrote: I almost always use forms in this following way: *#Create a

Re: [web2py] Re: custom form without using database?

2011-02-10 Thread Panupat Chongstitwattana
Thanks Bruno the DIV(FORM()) trick is really nice. Too bad there's no dd, dt, dl which is what I usually use for form layouts. I guess I can always manually append them in. On Thu, Feb 10, 2011 at 8:32 PM, Bruno Rocha rochacbr...@gmail.com wrote: Anyone know what properties I can call to get

Re: [web2py] Re: custom form without using database?

2011-02-10 Thread Bruno Rocha
You can use TAG.dd() , TAG.dl() here is a working MVC example for a customized contact form, which sends an email http://pastebin.com/jTbGQNZk -- Bruno Rocha http://about.me/rochacbruno/bio

[web2py] Re: Apache, Wsgi problem

2011-02-10 Thread Massimo Di Pierro
I offer $300 to whoever can identify within 3 weeks and without ambiguity the cause of this problem. The bounty applies even if the problem turns out to be not in web2py but in one of the Python modules, in Apache or in the mod_wsgi implementation. It does not apply if the problem is due to known

[web2py] Re: Cache.disk() expiring unexpectedly

2011-02-10 Thread Massimo Di Pierro
The problem is here: cached = cache.disk(cache_key, lambda:None) The expiration time is not set by the initial call but it is set but each retrieve call. It is the retrieve call above that decided whether the stored value should be considered expired or not. Since you are not specifying a time

[web2py] Re: Web2py and Sencha (Extjs)

2011-02-10 Thread stargate
Well Sencha Touch its pretty bloated and can be slow at times for loading on a mobile device. Your best bet is to look at http://www.phonegap.com/ On Feb 9, 8:09 pm, mikech mp.ch...@gmail.com wrote: Has anyone looked at the recent Extjs developements or Sencha Touch?  I'm nowhere ready to do

Re: [web2py] Re: Book needs to be updated

2011-02-10 Thread Richard Vézina
Yes I agree... I remove all my bookmarks and put them in Bookmarks... ;-) Do you know if Chrome has profile like firefox? And how to boot Chrome with an other profile?? I realise also that for most of screenshots already in book the navigator windows was shrinked when needed so there is no need

[web2py] web2py layouts

2011-02-10 Thread stargate
I tried installing the Simpletex layout but i try to view it and it says invalid controller (default/index). So i am not sure what are the steps to installing these sample layouts.

Re: [web2py] Re: Apache, Wsgi problem

2011-02-10 Thread Jonathan Lundell
Good work. You mentioned that you're using Debian Lenny. What version of Python? 2.5.2? And what version of psycopg2? On Feb 9, 2011, at 10:38 PM, VP wrote: Alright people short answer: I think I figured this out (at least with my configuration) After testing various

[web2py] Re: custom form without using database?

2011-02-10 Thread Panupat
How do I add css class,id or java onClick etc to the tags? On Feb 10, 8:44 pm, Bruno Rocha rochacbr...@gmail.com wrote: You can use TAG.dd() , TAG.dl() here is a working MVC example for a customized contact form, which sends an email http://pastebin.com/jTbGQNZk -- Bruno

[web2py] Re: custom form without using database?

2011-02-10 Thread villas
On Feb 10, 1:16 pm, Panupat panup...@gmail.com wrote: Villas - I have read the book. The form.custom only works with SQLFORM and crud. I cannot use that same method with FORM. Hi Panupat, I reread your original post again and I notice that your initial comment was: In the book only mentioned

[web2py] Re: web2py layouts

2011-02-10 Thread Massimo Di Pierro
Are you using http://web2py.com/layouts? Do you have a problem with this one only? On Feb 10, 9:54 am, stargate kyoukh...@gmail.com wrote: I tried installing the Simpletex layout but i try to view it and it says invalid controller (default/index).  So i am not sure what are the steps to

Re: [web2py] Re: custom form without using database?

2011-02-10 Thread Panupat Chongstitwattana
Hi Villas I'm sorry, I see what you meant now. I wasn't aware of the factory feature before :) On Thu, Feb 10, 2011 at 11:52 PM, villas villa...@gmail.com wrote: On Feb 10, 1:16 pm, Panupat panup...@gmail.com wrote: Villas - I have read the book. The form.custom only works with SQLFORM and

[web2py] Re: custom form without using database?

2011-02-10 Thread villas
Hi Panupat, No problem, web2py has so many useful features they are sometimes overlooked - especially by me! Anyhow I hope it will at least reduce some of the complexity for you :) -D On Feb 10, 5:11 pm, Panupat Chongstitwattana panup...@gmail.com wrote: Hi Villas I'm sorry, I see what you

[web2py] GAE and oauth LinkedIn

2011-02-10 Thread Carl
Has anyone successfully got this running on dev_appserver and GAE?

[web2py] Re: jQuery Tools

2011-02-10 Thread Carlos
Hi Bruno, What should I do in my web2py app in order to integrate jQuery Tools?. Should I make specific changes or adding it to response.files is enough?. I was also reviewing jQuery UI, but jQuery Tools seems to be more 'professional' looking. Based on your experience, which one is most

[web2py] Re: web2py layouts

2011-02-10 Thread stargate
Its most of them I have downloaded and tired. If you have step by step instructions i could be doing something wrong. Thanks On Feb 10, 12:10 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Are you usinghttp://web2py.com/layouts?Do you have a problem with this one only? On Feb 10,

Re: [web2py] Re: Book needs to be updated

2011-02-10 Thread Anthony
On Thursday, February 10, 2011 9:50:27 AM UTC-5, Richard wrote: Yes I agree... I remove all my bookmarks and put them in Bookmarks... ;-) Actually, the easiest and cleanest thing to do is go to the settings menu, select Tools, and uncheck the Always show bookmarks bar option (or just hit

[web2py] Re: Apache, Wsgi problem

2011-02-10 Thread VP
The modules I used are all standard via installation with apt-get. Python is 2.5.2, and psycopg2 is 2.0.7 On Feb 10, 9:58 am, Jonathan Lundell jlund...@pobox.com wrote: Good work. You mentioned that you're using Debian Lenny. What version of Python? 2.5.2? And what version of psycopg2? On

Re: [web2py] Re: Apache, Wsgi problem

2011-02-10 Thread Jonathan Lundell
On Feb 10, 2011, at 11:18 AM, VP vtp2...@gmail.com wrote: The modules I used are all standard via installation with apt-get. Python is 2.5.2, and psycopg2 is 2.0.7 Upgrade psycopg2 to at least 2.0.8 and see if that doesn't fix the fault. On Feb 10, 9:58 am, Jonathan Lundell

[web2py] GAE and sending email

2011-02-10 Thread Gary Bee
I am successfully sending an email from my web2py app hosted on GAE: mail.send(to=['webs...@rtplanb.com'],reply_to=form.vars.email, subject=form.vars.Name+' from '+form.vars.Organisation +' Website Enquiry ', message=form.vars.email+' wrote '+form.vars.Enquiry) My

[web2py] change_password form

2011-02-10 Thread David J.
I noticed that the change password form is not obeying the formstyle value in gluon tools.py If you see the change_password() function you see form = form_factory( Field('old_password', 'password', label=self.messages.old_password,

Re: [web2py] GAE and oauth LinkedIn

2011-02-10 Thread Michele Comitini
I did not test it on GAE but should work http://code.google.com/r/michelecomitini-facebookaccess/source/browse/#hg%2Fapplications%2FlinkedInOauth mic 2011/2/10 Carl m...@carlroach.com: Has anyone successfully got this running on dev_appserver and GAE?

[web2py] Re: Authorization to create/update an item

2011-02-10 Thread pbreit
Probably true that I don't understand the auth stuff very well. Do I use groups? Is that why each user has it's own unique group? Do I assign a write permission for a group on a specific and thus only that logged-in-user can edit the record? There's some documentation like that when using CRUD

[web2py] Re: custom form without using database?

2011-02-10 Thread pbreit
Why do you use all the underscores? Is it because those variables are reserved words? Does it make the variables private or something?

Re: [web2py] Re: custom form without using database?

2011-02-10 Thread rochacbruno
I use __ because I like to return locals() instead of a dict() Em 10/02/2011, às 18:53, pbreit pbreitenb...@gmail.com escreveu: Why do you use all the underscores? Is it because those variables are reserved words? Does it make the variables private or something?

[web2py] Re: Use web2py to run trac anywhere (portable trac)

2011-02-10 Thread Salvor Hardin
On Feb 9, 1:26 pm, pbreit pbreitenb...@gmail.com wrote: Try PortablePython:http://www.portablepython.com/ portablepython project looked dead, which is why I turned to web2py. web2py was suggested on stackoverflow.com as an alternative to portablepython, py2exe, etc. FWIW, I decided to run

[web2py] Re: Use web2py to run trac anywhere (portable trac)

2011-02-10 Thread pbreit
Web2py comes with a built-in webserver and SQLite but it's really designed to run the web2py Python web framework, not random Python packages.

Re: [web2py] Test if client has javascript

2011-02-10 Thread ma...@rockiger.com
Thanks for the clarification.

[web2py] Re: Test if client has javascript

2011-02-10 Thread ma...@rockiger.com
Thanks for the tip. But I doubt that this is faster than making the database-request, imo.

[web2py] Re: Cache.disk() expiring unexpectedly

2011-02-10 Thread Dane
Thanks, make sense. This could use a bit better explanation in the book. On Feb 10, 9:23 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: The problem is here: cached = cache.disk(cache_key, lambda:None) The expiration time is not set by the initial call but it is set but each

[web2py] Re: web2py layouts

2011-02-10 Thread Massimo Di Pierro
Now I understand. These are plugins, not apps. You need an existing app and apply them from the design page of the existing app as plugins (form is at the bottom). They do not contain any login (models/controllers). On Feb 10, 12:56 pm, stargate kyoukh...@gmail.com wrote: Its most of them I have

[web2py] Re: Use web2py to run trac anywhere (portable trac)

2011-02-10 Thread Massimo Di Pierro
You can use any normal python package with web2py. The binary distribution works as well as portable python did (no more, no less). On Feb 10, 3:32 pm, pbreit pbreitenb...@gmail.com wrote: Web2py comes with a built-in webserver and SQLite but it's really designed to run the web2py Python web

[web2py] WSGI + shared host

2011-02-10 Thread Nico
Hey peeps ! I have simple question Since web2py doesnt need any installation and i want to run it on my shared host... how can i set it up... I contacted my host, they moved my acc on another server where they support wsgi and they asked me for the path... i told them, the path to the script

[web2py] Web2py SOAP

2011-02-10 Thread Oskari
Hi! I'm building a SOAP interface with web2py. How can I return an array with that? I'm guessing its something like: @service.soap(test,args={},returns={'response':array} but that isn't recognised as a type. Any ideas?

[web2py] Howto populate table with data

2011-02-10 Thread Sascha Peilicke
Hi guys, I'd like to know how to best populate a table with a given set of default values. I could add them manually via the shell, but I'd like it to be done when the table is created. Let's consider the following table: db.define_table('tag', Field('name'), format='%(name)s') And

Re: [web2py] Howto populate table with data

2011-02-10 Thread Marin Pranjic
Add this after define_table for t in TAGS: ... db.tag.insert(name = t) run once and then comment / delete the lines. On Thu, Feb 10, 2011 at 10:57 PM, Sascha Peilicke sasc...@gmx.de wrote: Hi guys, I'd like to know how to best populate a table with a given set of default values. I could

[web2py] Re: integration of jquery's ui themes into web2py's default layout/css?

2011-02-10 Thread Carlos
Hi Massimo, As far as I've tested, the following css must be applied after loading both css files (web2py's default + jqueryui's smoothness): .ui-widget, .ui-widget-content, .ui-widget-header, .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font:13px/1.231

Re: [web2py] Run the ultra-marathon along with web2py

2011-02-10 Thread Vinicius Assef
Thank you, man. ;-) On Wed, Feb 9, 2011 at 3:20 PM, Bruno Rocha rochacbr...@gmail.com wrote: @viniciusban wrote an excellent post about web2py, I reddited (waiting comments) http://www.reddit.com/r/Python/comments/fi4an/run_the_ultramarathon_along_with_web2py/ -- Bruno Rocha

Re: [web2py] Re: auth.signature

2011-02-10 Thread Vinicius Assef
Another suggestion. Let's keep consistence. If you have 'created_on' and 'created_by', what about 'updated_on' and 'updated_by'? -- Vinicius Assef. On Tue, Feb 8, 2011 at 6:39 PM, villas villa...@gmail.com wrote: For those intrigued and cannot update to trunk right now, it creates some

Re: [web2py] Howto populate table with data

2011-02-10 Thread Vinicius Assef
Try something like this: http://pastebin.com/6yWksPAU On Thu, Feb 10, 2011 at 9:36 PM, Marin Pranjic marin.pran...@gmail.com wrote: Add this after define_table for t in TAGS: ... db.tag.insert(name = t) run once and then comment / delete the lines. On Thu, Feb 10, 2011 at 10:57 PM,

[web2py] Re: Web2py and Sencha (Extjs)

2011-02-10 Thread mikech
Thanks for bringing that to my attention. Have you used it with web2py?

[web2py] Re: Web2py and Sencha (Extjs)

2011-02-10 Thread mikech
Sadly only on Apple at the moment

Re: [web2py] URL anchor breaks routes

2011-02-10 Thread Plumo
so let's say I have mapped /init/default/about to /about Then: URL(r=request, c='default', f='about', anchor='company') will produce: /init/default/about#company instead of: /about#company

[web2py] Re: Authorization to create/update an item

2011-02-10 Thread villas
Unfortunately you cannot avoid having to bury your head in the Authorization section of the book for a while :-) The auth system can work at different levels. I guess most developers find a way of allocating permissions to groups. Then they put their users into those groups. The permissions

Re: [web2py] Howto populate table with data

2011-02-10 Thread rochacbruno
note that db.commit() is needed only in shell or external modules. Under web2py environment it is implícit executed. It can be simplified as: [db.tag.insert(name=t) for t in TAGS if not db(db.tag).count()] (guess it works, not tested) Em 10/02/2011, às 22:41, Vinicius Assef

Re: [web2py] Howto populate table with data

2011-02-10 Thread Bruno Rocha
Forget my last example, This is the working code: [ db.tag.insert(name=t) for t in TAGS if db(db.tag).count() = len(TAGS) ] The code that @vinicius posted works prefectly too -- Bruno Rocha http://about.me/rochacbruno/bio

Re: [web2py] URL anchor breaks routes

2011-02-10 Thread Jonathan Lundell
On Feb 10, 2011, at 5:16 PM, Plumo wrote: so let's say I have mapped /init/default/about to /about Then: URL(r=request, c='default', f='about', anchor='company') will produce: /init/default/about#company instead of: /about#company Post your routes_out, please.

Re: [web2py] URL anchor breaks routes

2011-02-10 Thread Jonathan Lundell
On Feb 10, 2011, at 6:27 PM, Jonathan Lundell wrote: On Feb 10, 2011, at 5:16 PM, Plumo wrote: so let's say I have mapped /init/default/about to /about Then: URL(r=request, c='default', f='about', anchor='company') will produce: /init/default/about#company instead of: /about#company

Re: [web2py] Web2py SOAP

2011-02-10 Thread Mariano Reingart
Do you mean xsd:struct? It is not currently supported, but there are workarounds. Look at this: http://code.google.com/p/pysimplesoap/issues/detail?id=4 I have to review and implement some patches, if you are interested in testing this let me know (if you can, comment on the ticket your

[web2py] changing default page?

2011-02-10 Thread Panupat
I'm sorry for this very simple questions but I can't seem to find the answer. How do I change the default page from welcome/default/index to my own applications?

[web2py] how does the default login page work?

2011-02-10 Thread Panupat
Trying to learn how it works. I can't seem to find the layout or any code associated to it. Which files should I look at?

Re: [web2py] how does the default login page work?

2011-02-10 Thread rochacbruno
The layout is defined in views/default/user.html Em 11/02/2011, às 01:13, Panupat panup...@gmail.com escreveu: Trying to learn how it works. I can't seem to find the layout or any code associated to it. Which files should I look at?

Re: [web2py] changing default page?

2011-02-10 Thread rochacbruno
The simple way is renaming your app to 'init' Or you can use autoroutes or create your own route definition in routes.py Enabling routes.py you can simply change the default_application to your app Take a look at routes in /book or rename your app folder to 'init' Em 11/02/2011, às 01:11,

Re: [web2py] changing default page?

2011-02-10 Thread Vinicius Assef
Name your application init, but read this: http://web2py.com/book/default/chapter/04#Routes-on-Error On Fri, Feb 11, 2011 at 1:11 AM, Panupat panup...@gmail.com wrote: I'm sorry for this very simple questions but I can't seem to find the answer. How do I change the default page from

[web2py] JSON in templates

2011-02-10 Thread Dane
Hi, Is there any easy way to embed JSON directly into templates? I've been trying a bunch of different methods and nothing seems to work due to quote escaping. I'd rather not create a separate controller function or loop through JSON structure myself just to output a simple object. Ideas? This

[web2py] Re: JSON in templates

2011-02-10 Thread Dane
On a more general note, it seems like tighter and tighter integration with the client and javascript, potentially even to the point of making it a first class citizen like db, would perhaps be one of the best directions web2py could go in my eyes. On Feb 10, 11:14 pm, Dane

Re: [web2py] how does the default login page work?

2011-02-10 Thread pbreit
Most of the functionality is deep in gluon/tools.py: http://code.google.com/p/web2py/source/browse/gluon/tools.py

[web2py] authenticate against Active Directory - need some direction.

2011-02-10 Thread Panupat
Hi everyone. In my application I need to authenticate users against windows active directory using user name and password. The user's group is also determined by the active directory group. So far I was able to do so using a the ldap class directory and use lsearch to compare the group. Can the

Re: [web2py] Howto populate table with data

2011-02-10 Thread Sascha Peilicke
On Friday 11 February 2011 03:10:01 Bruno Rocha wrote: Forget my last example, This is the working code: [ db.tag.insert(name=t) for t in TAGS if db(db.tag).count() = len(TAGS) ] The code that @vinicius posted works prefectly too Thank you guys! -- Mit freundlichen Grüßen, Sascha