Re: [web2py] How to perform a function in a template?

2012-01-11 Thread Bruno Rocha
You can import modules, call functions and even define functions in template, if the function returns something you want to write to the body just put a = sign. On Thu, Jan 12, 2012 at 3:37 AM, thstart wrote: *{{import urllib}}* > {{for name_first in names_first:}} > >

[web2py] Deadline exceeded error/ Downloading data in csv via application

2012-01-11 Thread Saurabh S
Hi, I am developing an online booking system. one of the functionality that i have implemented is to generate reports by gathering the data from two or more different tables. the problem that i am facing is due to large number of records (greater than thousand) , i was unable to render all the rec

[web2py] Re: crud.update comments False

2012-01-11 Thread lucas
working perfect, thanx again anthony. lucas

[web2py] Re: crud.update comments False

2012-01-11 Thread lucas
working perfect, thanx again anthony. lucas

[web2py] Re: crud.update comments False

2012-01-11 Thread lucas
working perfect, thanx again anthony. lucas

[web2py] How to perform a function in a template?

2012-01-11 Thread thstart
I need to perform a function in a template, something like this: {{for name_first in names_first:}} {{=name_first[0]}} {{*urllib.quote_plus*(name_first[0])}} {{=name_first[1]}} {{pass}} How to do that?

[web2py] web2py fails when mysql tables already exist

2012-01-11 Thread Likit
web2py has failed when the authuser table already exists. Well, ideally the auth tables are meant to persist. I thought the DAL created tables if they DON'T exist. I guess I am getting really tired of the unbearable fragility of web2py. Just pretty bush league, I guess. Here is the traceback:

[web2py] Re: How can I set alternative DAL when main DAL endpoint is not available?

2012-01-11 Thread seongjoo
It seems request.is_local serves my team's need for now. For now, the solution looks as below if request.is_local: db = DAL('sqlite://storage.sqlite') else: db = DAL(*production_db_endpoint*) Your thoughtful heads up opens up a new discussion about possible db switching problem when pr

[web2py] processing blob fields containing xml

2012-01-11 Thread Nik Go
I access a legacy table that contains a number of fields: db.define_table(source ,Field('sourceID', 'id') ,Field('name', 'string') ,Field('refNumber', 'string') ,Field('actualText', 'text') ,Field('remarks', 'text') ,Field('fields', 'blob')) The "fields" field contains an XML description of field

[web2py] Re: why won't web2py create the databases

2012-01-11 Thread Likit
I mean, why won't web2py create the tables through its famous DAL. I have created the database directly in mysql. On Jan 11, 8:44 pm, Likit wrote: > I guess I like SQL better than frameworks. SQL is a query language for > DDL and DML that is well documented and completely explicitly. > Framework

[web2py] why won't web2py create the databases

2012-01-11 Thread Likit
I guess I like SQL better than frameworks. SQL is a query language for DDL and DML that is well documented and completely explicitly. Frameworks are opaque and invent a new syntax subject to ambiguities of parens, square braces, curly braces, dotted names, sometimes tablenames being implicit, somet

Re: [web2py] Web2py binary distribution and psycopg2 driver

2012-01-11 Thread Brian M
I just did a build of trunk with Python 2.7 on Windows 7. Had to grab the windows installers for psycopg2 and py2exe. Worked just fine once I commented out ABOUT from the date_files list (line 75 in setup_exe.py) - apparently that file isn't included anymore. I don't have a PostgreSQL server

Re: [web2py] Re: Logging in web2py

2012-01-11 Thread pbreit
I've always wondered that, too. It's the one reason I don't put more functionality in modules.

[web2py] Re: How do you manage your app repo with Mercurial

2012-01-11 Thread pbreit
Since I use automation for deployment (fabric), I overwrite a 0_db.py model file.

[web2py] Re: Routes error

2012-01-11 Thread pbreit
Make sure to restart your web server and/or web2py after each edit to routes.py. What is it doing and what are you expecting?

[web2py] Re: Ryan Singer at Future of Web Apps

2012-01-11 Thread Simon Ashley
Interesting ... We are working on a rewrite of an existing system from another environment. (50 tables, 200 screens and reports) Like paper sketches, they always work well. Using (trialing) Enterprise Architect (EA) and using that to setup table and user interactions. (as well as providing proj

[web2py] Re: How to get name of linking field from two table names

2012-01-11 Thread monotasker
Great! Thanks!

Re: [web2py] webserver hash collision DoS

2012-01-11 Thread Bruno Rocha
This is akready being discussed in web2py-developers list On Wed, Jan 11, 2012 at 8:41 PM, G. Clifford Williams < g...@notadiscussion.com> wrote: > I haven't seen anyone mention this so I thought I'd bring it up for > web2py in general and rocket specifically. > > http://www.ocert.org/advisories/

[web2py] webserver hash collision DoS

2012-01-11 Thread G. Clifford Williams
I haven't seen anyone mention this so I thought I'd bring it up for web2py in general and rocket specifically. http://www.ocert.org/advisories/ocert-2011-003.html The above URL speaks of an attack that's been well known for a number of years and someone has recently gotten around to demonstrating

[web2py] Re: Cookbook online ?

2012-01-11 Thread Omi Chiba
Pre-Ordered now ! On Jan 5, 2:31 pm, Omi Chiba wrote: > OK, I will consider purchasing one. > > On Jan 4, 9:55 pm, Massimo Di Pierro > wrote: > > > > > > > > > I believe they will sell it in PDF. They have copyright. I have no > > saying on the matter. > > > On Jan 4, 9:50 am,OmiChiba wrote: >

[web2py] Re: sessions2trash.py "global name 'db' is not defined"

2012-01-11 Thread Chris
That did it, not sure why I missed it. Thanks much. On Jan 11, 3:23 pm, Jonathan Lundell wrote: > On Jan 11, 2012, at 11:49 AM, Chris wrote: > > > > > > > > > > > I am getting an error when I run the following script in my web2py > > directory: > > > # python web2py.py -S init -R scripts/sessions

Re: [web2py] sessions2trash.py "global name 'db' is not defined"

2012-01-11 Thread Jonathan Lundell
On Jan 11, 2012, at 11:49 AM, Chris wrote: > I am getting an error when I run the following script in my web2py > directory: > > # python web2py.py -S init -R scripts/sessions2trash.py > web2py Web Framework > Created by Massimo Di Pierro, Copyright 2007-2011 > Version 1.99.2 (2011-09-26 06:55:33

[web2py] sessions2trash.py "global name 'db' is not defined"

2012-01-11 Thread Chris
Hello, I am getting an error when I run the following script in my web2py directory: # python web2py.py -S init -R scripts/sessions2trash.py web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2011 Version 1.99.2 (2011-09-26 06:55:33) stable Database drivers available: SQLite3, Post

[web2py] sessions2trash.py "global name 'db' is not defined"

2012-01-11 Thread Chris
Hello, (this may be a repost, having some technical trouble) I was trying to run sessions2trash and getting the following error: # python web2py.py -S init -R scripts/sessions2trash.py web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2011 Version 1.99.2 (2011-09-26 06:55:33) sta

[web2py] Re: Web2py binary distribution and psycopg2 driver

2012-01-11 Thread Massimo Di Pierro
we will include pg8000 in web2py in the next version On Jan 11, 12:27 pm, Mariano Reingart wrote: > For python 2.5 you need at least: > > bz2.pyd > library.zip > MSVCR71.dll > psycopg2._psycopg.pyd > python25.dll > test.exe > unicodedata.pyd > w9xpopen.exe > > NOTE the psycopg2._psycopg.pyd bina

Re: [web2py] Web2py binary distribution and psycopg2 driver

2012-01-11 Thread Mariano Reingart
For python 2.5 you need at least: bz2.pyd library.zip MSVCR71.dll psycopg2._psycopg.pyd python25.dll test.exe unicodedata.pyd w9xpopen.exe NOTE the psycopg2._psycopg.pyd binary dll Also, MSVCR71.dll surely will change for other versions of python, and you'll be need manifests and/or other runtime

Re: [web2py] Intercept file download

2012-01-11 Thread Angelo Compagnucci
Yes, you are right, the approach is messy. So the best way could be something like a module. The image URL is passed as an argument, the module crunch the image and returns the correct URL. So in code you have to write something like: IMG(_src=responsive(URL('static','image.img')),_alt='test')

Re: [web2py] Intercept file download

2012-01-11 Thread Anthony
On Wednesday, January 11, 2012 12:16:50 PM UTC-5, AngeloC wrote: > > Thanks Anthony, > > Ok, this way I have to play anyway with urls. I'll try another approach. > There is a way to rewrite the page after rendering, just before the page > will be sent to the browser? > html = response.render

[web2py] Re: LOAD, javascript and a loading gif

2012-01-11 Thread Anthony
Two errors. I forgot to remove the tag -- it isn't needed in response.js because the returned JS is eval'ed. Also, in your code, you have request.js, but it should be response.js, so try: response.js = '''$(function() {$(".replacewloading").click(function() {$(this).parent().html('

Re: [web2py] Intercept file download

2012-01-11 Thread Angelo Compagnucci
Thanks Anthony, Ok, this way I have to play anyway with urls. I'll try another approach. There is a way to rewrite the page after rendering, just before the page will be sent to the browser? This way we can analyze img urls, resize images accordingly, and rewrite the new ones. What do you tink?

[web2py] Re: How can I set alternative DAL when main DAL endpoint is not available?

2012-01-11 Thread Anthony
Sure, request.is_local indicates if the request is local (though I think will give a false positive if the site is running behind a proxy server). Anthony On Wednesday, January 11, 2012 11:44:05 AM UTC-5, seongjoo wrote: > > It would be great if there is a way to check whether request is origina

Re: [web2py] Intercept file download

2012-01-11 Thread Anthony
On Wednesday, January 11, 2012 11:49:18 AM UTC-5, AngeloC wrote: > > Thanks Bruno, > > These not solve my problem! To use thumbor, I have to prepare links using > a special syntax, that is what I want to avoid. If I wanted to change links > I would have done using responsive design tecniques and

[web2py] Re: LOAD, javascript and a loading gif

2012-01-11 Thread Liam
web2py 1.99.4 plugin controller: def overview(): if len(request.args) > 0 and request.args[0] == 'refresh': import time time.sleep(4) body = H2('Component header') refresh = DIV(A('Refresh', _class='button replacewloading', _href=URL(c='plugin_test', f='overview.load',

Re: [web2py] Intercept file download

2012-01-11 Thread Angelo Compagnucci
Thanks Bruno, These not solve my problem! To use thumbor, I have to prepare links using a special syntax, that is what I want to avoid. If I wanted to change links I would have done using responsive design tecniques and my own webserver! @Antony: I know sencha and it adopts an approch like the on

[web2py] Re: How can I set alternative DAL when main DAL endpoint is not available?

2012-01-11 Thread seongjoo
It would be great if there is a way to check whether request is originated from local (127.0.0.1) and then set DAL's endpoint to local. Would it be possible, and if it is then, is it recommended to do so?

Re: [web2py] Intercept file download

2012-01-11 Thread Anthony
There's also this service: http://www.sencha.com/learn/how-to-use-src-sencha-io/ On Wednesday, January 11, 2012 11:24:23 AM UTC-5, rochacbruno wrote: > > > > On Wed, Jan 11, 2012 at 2:23 PM, Bruno Rocha wrote: > >> https://github.com/globocom/thumbor > > > and > > https://github.com/globocom/mug

Re: [web2py] Intercept file download

2012-01-11 Thread Bruno Rocha
On Wed, Jan 11, 2012 at 2:23 PM, Bruno Rocha wrote: > https://github.com/globocom/thumbor and https://github.com/globocom/mugshot

Re: [web2py] Intercept file download

2012-01-11 Thread Bruno Rocha
https://github.com/globocom/thumbor On Wed, Jan 11, 2012 at 2:16 PM, Angelo Compagnucci < angelo.compagnu...@gmail.com> wrote: > Hi guys, > > For a web application, I have to implement a sort of responsive design for > images. There are tons of solution online, but they requires to use some > sor

[web2py] Intercept file download

2012-01-11 Thread Angelo Compagnucci
Hi guys, For a web application, I have to implement a sort of responsive design for images. There are tons of solution online, but they requires to use some sort of javascript and custom html to work (insert special tags or classes in code). I don't like the approch because it make the code unmain

Re: [web2py] Bug in languages.py

2012-01-11 Thread Jonathan Lundell
On Jan 11, 2012, at 7:54 AM, Anders Roos wrote: > I have discovered a bug where I got read errors for language files (ERROR: > Syntax error in /home/... .../languages/en-gb.py). After some debugging I > found out that the cause is that the file is being read while it is half > written by anoth

[web2py] EOFError loading errors

2012-01-11 Thread Clayton
When attempting to view list of errors via the admin application(admin/ errors/), I get an internal error (EOFError) opening the picked error message: File /home/www-data/web2py/applications/admin/controllers/default.py in errors at line 1082 fullpath = os.path.join(errors_path, fn)

Re: [web2py] Routes error

2012-01-11 Thread Alexandre Andrade
I had the same problem. I only made it work using router.example.py and renamed it to routes.py 2012/1/11 Web2Py Freak > Dear all , > > i am trying to use routes.py , but its not working , i even tryed to > change the default app and it didnt work , why ? > -- Atenciosamente Alexandre

[web2py] Bug in languages.py

2012-01-11 Thread Anders Roos
Hello, I have discovered a bug where I got read errors for language files (ERROR: Syntax error in /home/... .../languages/en-gb.py). After some debugging I found out that the cause is that the file is being read while it is half written by another thread (or process). There is a lock for it, b

Re: [web2py] Web2py binary distribution and psycopg2 driver

2012-01-11 Thread Alexandre Andrade
I remember the postgresql driver usually works with the source distribuition of web2py on windows. I think a way u get it working is use the source web2py on windows, and use py2exe or similar to create a executable. Alexandre Andrade 2012/1/10 Álvaro J. Iradier > Hi, > > I was trying to dist

Re: [web2py] plugin badmin

2012-01-11 Thread Alexandre Andrade
I understand the diferences between grid and smartgrid. thank you anyway for reply. What mean to ask is the diference between them and badmin, in https://github.com/elcio/badmin Alexandre Andrade 2012/1/10 Jim Steil > The other big difference is that you can pass a query (in place of the

Re: [web2py] Register User issue -- Blank password

2012-01-11 Thread Anthony
Are you using a custom auth_user table? With the default table, the password field has a CRYPT validator with the minimum password length set to auth.settings.password_min_length, which defaults to 4. Anthony On Wednesday, January 11, 2012 4:19:40 AM UTC-5, Viren Patel wrote: > > Even i tried w

[web2py] Re: LOAD, javascript and a loading gif

2012-01-11 Thread Anthony
On Wednesday, January 11, 2012 3:53:24 AM UTC-5, Liam wrote: > > Sorry, that was a typo. > > Even something as simple as response.js = 'alert("Here");' or response.js > = 'alert("Here");' doesn't seem to work, although it > does if included in the view. > Can you show the code you tried? I tried

[web2py] Re: How can I set alternative DAL when main DAL endpoint is not available?

2012-01-11 Thread Massimo Di Pierro
The DAL can be into an if statement. In principle you can test outside whether the connection is available. How would you check it efficiently without wait? On Jan 11, 2:35 am, seongjoo wrote: > The solution is an elegant one, however, there is an issue I want to > discuss further after applying

[web2py] Re: How to get name of linking field from two table names

2012-01-11 Thread Anthony
[f for f in db.B.fields if db.B[f].type == 'reference A'][0] Anthony On Wednesday, January 11, 2012 8:54:08 AM UTC-5, monotasker wrote: > > I have a function in which I have two table names 'db.A' and 'db.B'. There > is a field in db.A that links to the id field of db.B. But I don't know > what

Re: [web2py] Re: Auth user custom update

2012-01-11 Thread Thiago Magro
Worked! Thank you very much Anthony! On Wed, Jan 11, 2012 at 11:54 AM, Anthony wrote: > After processing the form, try: > > auth.user.update(form.vars) > > auth.user is just a (dictionary-like) Storage object, so you can update it > like any dictionary. Note, if form.vars includes some variab

[web2py] Re: Auth user custom update

2012-01-11 Thread Anthony
After processing the form, try: auth.user.update(form.vars) auth.user is just a (dictionary-like) Storage object, so you can update it like any dictionary. Note, if form.vars includes some variables that are not part of the auth_user table (and therefore shouldn't be added to auth.user), you c

[web2py] How to get name of linking field from two table names

2012-01-11 Thread monotasker
I have a function in which I have two table names 'db.A' and 'db.B'. There is a field in db.A that links to the id field of db.B. But I don't know what that linking field is called in db.A. Is there a way to find this out programmatically? (This is the last nut to crack before I can release the

[web2py] Re: Routes error

2012-01-11 Thread lyn2py
routes.py needs to be in the same location as routes.example.py When you change routes.py you need to click on "reload routes" in admin or restart the server. On Jan 11, 8:16 pm, Web2Py Freak wrote: > Dear all , > > i am trying to use routes.py  , but its not working , i even tryed to > change

[web2py] Auth user custom update

2012-01-11 Thread Magrelo
Hello all, Ive created a custom form to change some auth.user informations. After I submit this form how can I update auth.user? For example, on the form I changed the first_name, submited and it change de db, but the user session keeps the old first_name value. I have to logout and login to see

[web2py] Routes error

2012-01-11 Thread Web2Py Freak
Dear all , i am trying to use routes.py , but its not working , i even tryed to change the default app and it didnt work , why ?

[web2py] Re: Web2py binary distribution and psycopg2 driver

2012-01-11 Thread Álvaro J . Iradier
Thanks for your comments. Do you remember how you did it? I can make it work correctly when using the source version of web2py, and I install psycopg under the python installation (c:\python27). However, when trying the binary distribution, I have tried extracting the files from the psycopg versi

[web2py] Re: Web2py binary distribution and psycopg2 driver

2012-01-11 Thread Alan Etkin
I think i installed one of the listed binary files listed here without problems: http://stickpeople.com/projects/python/win-psycopg/ Regards On 10 ene, 17:14, Álvaro J. Iradier wrote: > Hi, > > I was trying to distribute an application with web2py binary for > windows, but I required the Postgre

Re: [web2py] Web2py binary distribution and psycopg2 driver

2012-01-11 Thread Mariano Reingart
On Tue, Jan 10, 2012 at 5:14 PM, Álvaro J. Iradier wrote: > Hi, > > I was trying to distribute an application with web2py binary for > windows, but I required the PostgreSQL driver. So I copied the > psycopg2 files to site-packages in the web2py binary folder. > > If I start a shell from an applic

Re: [web2py] Register User issue -- Blank password

2012-01-11 Thread VIREN PATEL
Even i tried with version 1.99.3 still it registers successfully and also able to login with that user with blank password On Wed, Jan 11, 2012 at 2:38 PM, Albert Abril wrote: > I tryed in Version 1.99.3 and it's working ok. When I put a blank > password there's a "Too short" message. > > > 2012/

Re: [web2py] Register User issue -- Blank password

2012-01-11 Thread Albert Abril
I tryed in Version 1.99.3 and it's working ok. When I put a blank password there's a "Too short" message. 2012/1/11 VIREN PATEL > Hi, > > > In register screen if i do not provide password and verify-password still > the user does gets registered. > > also able to login with that user. any soluti

[web2py] Re: LOAD, javascript and a loading gif

2012-01-11 Thread Liam
Sorry, that was a typo. Even something as simple as response.js = 'alert("Here");' or response.js = 'alert("Here");' doesn't seem to work, although it does if included in the view.

[web2py] Re: AttributeError: 'Rows' object has no attribute '_db'

2012-01-11 Thread Rahul
Thanks Anthony, That works! I've changed other queries giving me this error and it works fine now. Thanks a million. :) Sincerely, Rahul D. On Jan 10, 7:46 pm, Anthony wrote: > On Monday, January 9, 2012 11:54:08 PM UTC-5, Rahul wrote: > > > I did not get it... > > What would be an equivalent qu

[web2py] Re: How can I set alternative DAL when main DAL endpoint is not available?

2012-01-11 Thread seongjoo
The solution is an elegant one, however, there is an issue I want to discuss further after applying it. When the solution is applied, it works but with some trouble that might compromise testability. Since it will try to connect the production db and throws 'OperationalError' after trying to co