[web2py] Re: .ics file name

2013-10-10 Thread Annet
Thanks for your replies. I solved the problem by moving the code to generate the file name and response.headers to the controller: filename='hour_' + name.replace(" ","_") + '_' + row.dayOfWeek.byday + '_' + row.openingHours.startDate.strftime("%d-%m-%Y") response.headers['Content-Disposition

[web2py] use of onvalidation in sqlform.grid ?

2013-10-10 Thread Tim Richardson
I can't get onvalidation working in SQLFORM.grid (trunk from a couple of days ago) I have never used it with any object, so I probably don't get it. I have this: def validate_callback(form): print form.vars #breakpoint here return True and this is in my controller grid1 = SQLFORM

Re: [web2py] missing 'index' in url with routes.py?

2013-10-10 Thread Apple Mason
Thanks Jonathan, I ended just pointing the default function to a main() and from there I redirected to my index() in my controller. On Thursday, October 10, 2013 5:47:22 PM UTC-4, Jonathan Lundell wrote: > > On 9 Oct 2013, at 9:11 PM, Apple Mason > > wrote: > > I'm trying to shorten the url fro

[web2py] Database models don't import when using IPython 1.0.0 with web2py 2.7 (interactive shell)

2013-10-10 Thread Mark Li
I recently upgraded to the new version of web2py from 2.5 (on Pythonanywhere); everything seems to work fine except for the interactive shell. Using the command "python web2py.py -M -S appname" worked fine with 2.5, but now it doesn't seem to import the database models. I get the error "name '

[web2py] Re: SQLTABLE and foreign key fields

2013-10-10 Thread Massimo Di Pierro
yes. shame on me. On Thursday, 10 October 2013 15:32:11 UTC-5, James Thompson wrote: > > Thanks. > I assume also that: > db.define_table('dog',Field('name'),Field('owner','reference dog')) > should be: > db.define_table('dog',Field('name'),Field('owner','reference person')) > ? > > On Thursday, Oc

[web2py] Mini crawler/indexer for your pages (not web2py)

2013-10-10 Thread Massimo Di Pierro
I wrote this today. Perhaps it can be used to some of you: https://gist.github.com/mdipierro/6624cb39851ca750bb2b -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issu

[web2py] Re: IMAP: Insert email to Sent folder

2013-10-10 Thread Alan Etkin
> > I'm try encode "utf-8", but it didn't work for me... > I reproduce the problem unless you provide an example file and the code involved. Would you please file an issue at the project page about this? http://code.google.com/p/web2py/issues -- Resources: - http://web2py.com - http://web2py.

[web2py] Fix Field names when exporting from SQLFORM.grid

2013-10-10 Thread Nicolas Palacios
Hi, when I export from a grid to CVS, the result have this name for every field header: . How can I change it and get that was exported with the field's label for every field header? Thanks Nico -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/we

[web2py] Re: SQLTABLE and foreign key fields

2013-10-10 Thread James Thompson
Thanks. I assume also that: db.define_table('dog',Field('name'),Field('owner','reference dog')) should be: db.define_table('dog',Field('name'),Field('owner','reference person')) ? On Thursday, October 10, 2013 5:37:16 AM UTC-10, Massimo Di Pierro wrote: > > Oops. A typo. I fixed it in the previous

[web2py] Re: onselect ajax...

2013-10-10 Thread Derek
You probably have a line in the echo.html file {{extend 'layout.html'}}. Remove that. On Thursday, October 10, 2013 11:22:58 AM UTC-7, Avi A wrote: > > > def echo(): > value = request.post_vars.f_item_category > filtered_sub = db(db.t_sub_categories.f_category_id == > value).select(db.t_

Re: [web2py] missing 'index' in url with routes.py?

2013-10-10 Thread Jonathan Lundell
On 9 Oct 2013, at 9:11 PM, Apple Mason wrote: > I'm trying to shorten the url from something like: > > www.example.com/myapp/default/index?page=1 > > to > > www.example/com/index?page=1 > > I'm using pagination on the index page, so that's why you see the ?page=1 > > My routes.py is pretty s

Re: [web2py] resizing inputbox without javacsript

2013-10-10 Thread Andreas Wienes
Hello Ricardo, this works like a charm. :-) Thanks a lot! Where can I look up such information? I didn't found it in the web2py book. Best regards Andreas Am Donnerstag, 10. Oktober 2013 21:58:42 UTC+2 schrieb Ricardo Pedroso: > > On Thu, Oct 10, 2013 at 5:50 PM, Andreas Wienes > > > wrote:

[web2py] Re: thread._local' object has no ANY attribute

2013-10-10 Thread Matheus Cardoso
Massimo, I am running from tests code. Some acceptance tests with Selenium. Something like this: class TestStockist(TestModuleSetup): def test_create_stock_register(self): #item is a mock object with some unique id and some description stocki

Re: [web2py] resizing inputbox without javacsript

2013-10-10 Thread Ricardo Pedroso
On Thu, Oct 10, 2013 at 5:50 PM, Andreas Wienes wrote: > > Because I'm not very familar in using JavaScript and don't like the idea > to use it for formating more than one inputbox, I hope there is another > cleaner and easier way doing this. Maybe with parameters like > {{=register_form.custom.

[web2py] Re: Blank screen from app/admin/edit button

2013-10-10 Thread Paolo Caruccio
Maybe the issue is due to bad ajax caching in opera. @Dave S Please replace the function "load_file(url)" in "admin/static/js/ajax_editors_js" file with: function load_file(url) { jQuery.ajax({ type: "GET", contentType: 'application/json', cache: false, dataType: 'json', u

Re: [web2py] Re: Virtual Fields showing with SQLFORM.grid

2013-10-10 Thread Richard Vézina
This thread is old, I didn't read it carefully, but you should consider that SQLFORM.grid() API may have change and information is not up to date... I know that virtualfield in .grid() have been the object of many thread on the list since that time... Hope it helps. Richard On Thu, Oct 10, 2013

[web2py] Re: Load with ajax doesn't work since upgrade > 1.6

2013-10-10 Thread Niphlod
is jquery.js preceding web2py.js in your layout.html ? On Thursday, October 10, 2013 8:27:04 AM UTC+2, Michael Helbling wrote: > > > Yes, i already copied the web2py.js, appadmin controller and views from > the latest welcome app to all my apps. > Without copying the web2py.js, no load worked. B

[web2py] Re: onselect ajax...

2013-10-10 Thread Avi A
Also if deleting the content of echo.load it still renders the same. On Thursday, October 10, 2013 9:55:01 PM UTC+3, Avi A wrote: > > Doing this will get the same results: > def echo(): > value = request.post_vars.f_item_category > filtered_sub = db(db.t_sub_categories.f_category_id == >

[web2py] Re: onselect ajax...

2013-10-10 Thread Avi A
Doing this will get the same results: def echo(): value = request.post_vars.f_item_category filtered_sub = db(db.t_sub_categories.f_category_id == value).select(db.t_sub_categories.ALL,orderby=db.t_sub_categories.f_sub_category_name, cache=(cache.ram,10),cacheable=True) return filte

[web2py] Re: onselect ajax...

2013-10-10 Thread Avi A
I have replaced echo.html with echo.load and now it only renders the table without the layout.html. On Thursday, October 10, 2013 9:22:58 PM UTC+3, Avi A wrote: > > > def echo(): > value = request.post_vars.f_item_category > filtered_sub = db(db.t_sub_categories.f_category_id == > value)

[web2py] Re: Update sqlform.grid query from external click

2013-10-10 Thread Tim Richardson
A web2py component will make the grid controlled by ajax, which means you can reload it from your page with javascript when some event happens, and that reloading is done the ajax way, without reloading the entire page. And there's more. Read about components in the book. -- Resources: - http:

[web2py] Re: thread._local' object has no ANY attribute

2013-10-10 Thread Massimo Di Pierro
Where is the object Stockist instantiated? and where is register_product_input called? On Thursday, 10 October 2013 11:31:59 UTC-5, Matheus Cardoso wrote: > > Here is the more complete code from a modulo of mine: > > import unittest > import sys > import os > from os import path > > sys.path.appe

[web2py] Re: onselect ajax...

2013-10-10 Thread Avi A
def echo(): value = request.post_vars.f_item_category filtered_sub = db(db.t_sub_categories.f_category_id == value).select(db.t_sub_categories.ALL,orderby=db.t_sub_categories.f_sub_category_name, cache=(cache.ram,10),cacheable=True) return dict(filtered_sub = filtered_sub) echo.h

[web2py] Re: onselect ajax...

2013-10-10 Thread Avi A
Exactly Starting now... On Thursday, October 10, 2013 8:02:40 PM UTC+3, Derek wrote: > > Any luck? > > On Tuesday, October 8, 2013 6:29:03 AM UTC-7, Avi A wrote: >> >> Still stuck with that... >> Thanks. >> >> On Saturday, October 5, 2013 5:29:37 PM UTC+3, Avi A wrote: >>> >>> def echo(): >>>

[web2py] Re: No row buttons in SQLFORM.grid using groupby

2013-10-10 Thread Derek
If you are grouping then you can't access a specific ID. You'd just be getting aggregates back. On Thursday, October 10, 2013 10:13:56 AM UTC-7, Luis Furtado wrote: > > If I call SQLFORM.grid with "groupby" I get a table with no row buttons > ("view" in this case). > Those buttons show up if I l

[web2py] Re: Does your Response Flash get in the way?

2013-10-10 Thread Derek
It depends on what your complaint with flash is... On Thursday, October 10, 2013 10:27:48 AM UTC-7, Andreas Wienes wrote: > > Is Annet's solution still the best way handling flash messages? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/we

[web2py] Re: Does your Response Flash get in the way?

2013-10-10 Thread Andreas Wienes
Is Annet's solution still the best way handling flash messages? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are

Re: [web2py] Re: Load with ajax doesn't work since upgrade > 1.6

2013-10-10 Thread José Luis Redrejo
I have the same problem since 2.6.1 and, also, after copying those files without sucess I've got it working replacing the file gluon/compileapp.py with the one from version 2.5.1. You can get that web2py version from http://web2py.com/examples/static/2.5.1/web2py_src.zip. I haven't had time to inve

[web2py] Re: How to update an image with web2py onclick

2013-10-10 Thread Derek
Onclick will be a javascript function. You may want to look at the 'ajax()' function included with web2py. On Monday, October 7, 2013 5:55:25 AM UTC-7, Vladimir Bratov wrote: > > I have an image > > > > within my .html. Within the same .html I want to have a text input field > and a button tha

[web2py] No row buttons in SQLFORM.grid using groupby

2013-10-10 Thread Luis Furtado
If I call SQLFORM.grid with "groupby" I get a table with no row buttons ("view" in this case). Those buttons show up if I leave "groupby" out. But then I get duplicate records. Notice that I'm joining three tables; g=SQLFORM.grid( ((db.empresa.id == db.emp_prod.emp ) &

[web2py] Re: onselect ajax...

2013-10-10 Thread Derek
Any luck? On Tuesday, October 8, 2013 6:29:03 AM UTC-7, Avi A wrote: > > Still stuck with that... > Thanks. > > On Saturday, October 5, 2013 5:29:37 PM UTC+3, Avi A wrote: >> >> def echo(): >> value = request.post_vars.f_item_category >> filtered_sub = db(db.t_sub_categories.f_category_id

[web2py] Re: unable to run latest version from source code

2013-10-10 Thread Derek
Make sure you have the right version for your 64-bit python! There is 64-bit win32 (yes, I know it sounds idiotic). On Wednesday, October 9, 2013 7:27:26 PM UTC-7, jarrodwilcox wrote: > > Massimo, Derek > > Thanks for replies! > > This is a new installation of latest web2py version. I have h

[web2py] resizing inputbox without javacsript

2013-10-10 Thread Andreas Wienes
I know this has been asked serveral times before, but I couldn't find a working solution for me. I use the auth.login() and auth.register() forms to build a login screen similar to twitter. I'm doing this with the following lines of code: {{=login_form.custom.begin}} {{=login_form.custom.wi

[web2py] Re: thread._local' object has no ANY attribute

2013-10-10 Thread Matheus Cardoso
Here is the more complete code from a modulo of mine: import unittest import sys import os from os import path sys.path.append('../../../') # we need this to use web2py's modules from gluon import * class Stockist(object): def __init__(self): #some instance variable initi

[web2py] Re: DAL error

2013-10-10 Thread Niphlod
http://initd.org/psycopg/docs/connection.html protocol_version¶ A read-only integer representing frontend/backend protocol being used. Currently Psycopg supports only protocol 3, which allows connection to PostgreSQL ser

[web2py] Re: thread._local' object has no ANY attribute

2013-10-10 Thread Massimo Di Pierro
Can you show us more of the module file? On Thursday, 10 October 2013 09:25:39 UTC-5, Matheus Cardoso wrote: > > Hi guys, > > Sorry if the following question was already answered, but I could not > find nothing like this in this list, stack or in others lists. Here is the > thing: I wrote some

[web2py] Re: mandrill SMTP

2013-10-10 Thread Niphlod
awesome. python-mandrill uses mandrill API, not their SMTP service. you're trying to send mail using web2py's interface to SMTP, so the fact that the API works fine isn't really a proof. Triple check your username:password settings ... Il giorno giovedì 10 ottobre 2013 16:54:42 UTC+2, Mirek Zvo

[web2py] Re: SQLTABLE and foreign key fields

2013-10-10 Thread Massimo Di Pierro
Oops. A typo. I fixed it in the previous message. On Wednesday, 9 October 2013 21:41:46 UTC-5, James Thompson wrote: > > I'm a little confused by: > >db.dog.owner.represent = None > >SQLFORM.grid(db.dog.represent==db.person.id) > > Why would we use db.dog.represent==db.person.id > rather than db.d

[web2py] Re: Update sqlform.grid query from external click

2013-10-10 Thread Niphlod
use components, luke! Il giorno giovedì 10 ottobre 2013 17:07:04 UTC+2, Gael Princivalle ha scritto: > > Hello. > > I've a page with a lateral accordion menu, and a sqlform.grid. > Can I update the sqlform.grid query clicking on one of my lateral menu > item ? > > Of course Id' like to make it w

[web2py] Re: Tracking the date/time of a field change.

2013-10-10 Thread James Thompson
I looked at record versioning, but, if I use something like: db.mytable._before_update then when the _before_update function is called, no changes have been made to the database yet. So to get the old value of the field, it seems like I need to read the current database row that is about to be u

[web2py] Using WrapBootstrap theme with Web2Py - possible?

2013-10-10 Thread Timothy Swieter
I am pondering a web app design. I've tinkered around for several years with web coding, but I don't claim to be good at any of it so I am excited to get into Web2Py because it is approachable in that it covers a lot of the deeper issues like security. For my design, I was looking at using a

[web2py] Re: Load with ajax doesn't work since upgrade > 1.6

2013-10-10 Thread Michael Helbling
Yes, i already copied the web2py.js, appadmin controller and views from the latest welcome app to all my apps. Without copying the web2py.js, no load worked. But even with the latest web2py.js, not all loads are working. that's my problem and i don't know why some load doesn't work. In version

[web2py] DAL error

2013-10-10 Thread Rod Watkins
My log shows the following error--I believe it may due to psycopg2. Traceback (most recent call last): File "C:\projects\web2py\gluon\dal.py", line 7538, in __init__ self._adapter = ADAPTERS[self._dbname](**kwargs) File "C:\projects\web2py\gluon\dal.py", line 2713, in __init__ if do_co

[web2py] Column ordering in SAQLFORM.grid

2013-10-10 Thread libertil
Hi, I am quite new to web2py so this might be a silly question I searched manual, forum and the web but I wasn't able to find solution. I am making a simple SQLFORM.grid based on an model. What happens is that I cannot control the column order. It seems that the columns in the grid appear in di

[web2py] Re: SQLTABLE and foreign key fields

2013-10-10 Thread James Thompson
I'm a little confused by: >db.dog.owner.represent = None >SQLFORM.grid(db.dog.represent==db.person.id) Why would we use db.dog.represent==db.person.id rather than db.dog.owner==db.person.id here? Thanks. On Wednesday, October 9, 2013 3:20:08 PM UTC-10, Massimo Di Pierro wrote: > > It depends.

[web2py] Re: Virtual Fields showing with SQLFORM.grid

2013-10-10 Thread Hadi Sunyoto
Sorry to reply on old post, I tried using what Anthony suggested in stackoverflow, it works ok, but when i try to VIEW or EDIT, the "link" is there next to EDIT (in VIEW) or VIEW (in EDIT) with no header whatsoever. Possible bug ? Version 2.7.2-stable+timestamp.2013.10.07.13.52.24 on Windows -

[web2py] Update sqlform.grid query from external click

2013-10-10 Thread Gael Princivalle
Hello. I've a page with a lateral accordion menu, and a sqlform.grid. Can I update the sqlform.grid query clicking on one of my lateral menu item ? Of course Id' like to make it without a page reload. Thanks. My db: db.define_table('models', Field('code', unique=True), Fiel

Re: [web2py] Logging http audit

2013-10-10 Thread Ricardo Pedroso
On Thu, Oct 10, 2013 at 12:35 PM, Arnon Marcus wrote: > Thank you very much Richardo (!) > > I would really like to use your solution, and have access to the current > fully-processed request, response and session objects. > Unfortunately, though, we are using a very old version of web2py (1.89.5)

[web2py] Re: mandrill SMTP

2013-10-10 Thread Mirek Zvolský
>> Niphlod >> really more a question on mandrill than web2py. > > Maybe, more question about Mandrill. But I am curious, if I can use web2py mailer, to send mails to Mandrill SMTP. >> > http://help.mandrill.com/entries/23744737-Where-do-I-find-my-SMTP-credentials- > > I have no problem with cred

Re: [web2py] Constraint or Validator for two fields

2013-10-10 Thread Vinicius Assef
You can use the "onvalidation" argument: http://web2py.com/books/default/chapter/29/07/forms-and-validators#onvalidation On Thu, Oct 10, 2013 at 10:51 AM, Johann Spies wrote: > When using this form, how can I build a validator (or use some other way) > that ensure that the form will not be accept

[web2py] Invalid login

2013-10-10 Thread raferbop
#Controller Functions def form_a(): form = SQLFORM(db.person) if form.process(session=None).accepted: session.flash = 'form accepted' redirect(URL('index')) elif form.errors: response.flash = 'form has errors' else: response.flash = 'please fill out

[web2py] thread._local' object has no ANY attribute

2013-10-10 Thread Matheus Cardoso
Hi guys, Sorry if the following question was already answered, but I could not find nothing like this in this list, stack or in others lists. Here is the thing: I wrote some tests that already was working. I got back to the code, after some time, and then: 'thread._local' object has no attribu

[web2py] Re: Constraint or Validator for two fields

2013-10-10 Thread Anthony
> db.questions.question_number.requires = IS_NOT_IN_DB( > db(db.questions.question_number ==request.vars.question_number), > 'survey_id') > The above should be the validator for db.questions.survey_id, not for db.questions.question_number. It's saying the survey_id should be unique amon

[web2py] li_class on Menu doesn't work

2013-10-10 Thread Diogo Munaro
Hey guys, I have a menu with 3 elements. When I try it: {{=MENU(response.contextmenu,_ class="catalogo_topo_menu",li_class='textcenter',li_first="textcenter",li_last="textcenter")}} only li_first and li_last work... The first and last items ares filled with the class, but the middle item doesn'

[web2py] Constraint or Validator for two fields

2013-10-10 Thread Johann Spies
When using this form, how can I build a validator (or use some other way) that ensure that the form will not be accepted if the combination of survey_id and question_number is not already in the table? form = SQLFORM.factory( Field('survey_id', db.survey, default = survey_id),

Re: [web2py] Logging http audit

2013-10-10 Thread Arnon Marcus
Thank you very much Richardo (!) I would really like to use your solution, and have access to the *current *fully-processed *request*, *response *and *session *objects. Unfortunately, though, we are using a very old version of web2py (1.89.5), which does not have the "current" variable in "gluo

Re: [web2py] Re: Web2py on apache2 is slow

2013-10-10 Thread Michele Comitini
Hello Jayakumar, I would be grateful if you could post some code to show the problem. Both PHP and Python. Thanks 2013/10/10 Jayakumar Bellie > I have both LAMP and web2py installed in the same machine. > > I have the same logic to read a file. > > It looks web2py is slower than PHP 5.4.9 >

Re: [web2py] Re: Web2py on apache2 is slow

2013-10-10 Thread Jayakumar Bellie
I have both LAMP and web2py installed in the same machine. I have the same logic to read a file. It looks web2py is slower than PHP 5.4.9 On Saturday, October 5, 2013 9:44:59 PM UTC+5:30, Ricardo Pedroso wrote: > > On Sat, Oct 5, 2013 at 12:36 AM, Derek > > wrote: > > > Yes, Python will be sl

[web2py] Re: CAS Auth redirect loop

2013-10-10 Thread Mirko
Hi all, being on a LAN and behind a proxy, I solved this with: export https_proxy="" export http_proxy="" (on a linux box) Cas auth is working like a charm after that :) Hope it helps, Mirko On Wednesday, August 17, 2011 8:36:45 PM UTC+2, Bruno Codeman wrote: > > Hi again, everyone. Does a