[web2py] Re: what is a simple way to display program variables

2013-11-15 Thread 黄祥
for debugging purpose, had you already use {{=response.toolbar()}} ref: http://web2py.com/books/default/chapter/29/04/the-core#response best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.g

[web2py] Re: grid layout problem

2013-11-15 Thread Mirko
Hi Stefan, how do you make the new buttons created by "links" stick close to the delete, edit, .. buttons under the same header ? Thanks! On Tuesday, October 8, 2013 2:06:13 PM UTC+2, stefaan wrote: > > Hello all, > > I noticed the following when using a grid with some "links" (custom > buttons)

[web2py] Re: add new button in GRID with same look and feel

2013-11-15 Thread Mirko
Hi Sarbjit, did you manage to have the placement of your button under the same header where the default grid buttons are ? I'm also unsuccessful here... Thanks! Mirko On Sunday, November 3, 2013 4:45:55 AM UTC+1, Sarbjit wrote: > > I have added a new button in grid using links as below :- > >

[web2py] Value is not updated in db on submitting form from grid

2013-11-15 Thread Sarbjit
My requirement was to show drop down list for a field generated using GRID by using the values defined in another table. Below is the code used: *Models:* # coding: utf8 db = DAL('sqlite://storage.sqlite') from gluon.tools import Crud, Auth auth=Auth(globals(),db) auth.define_tables(username=

[web2py] Re: add new button in GRID with same look and feel

2013-11-15 Thread Sarbjit
Hi Mirko, I am not able to figure out a way so far :( But I feel the best way is to create a new header and add existing buttons (Add/Delete/View) in them along with other buttons. But I still need to figure out how this can be done i.e. passing the correct arguments (signature) etc. -Sarbjit

[web2py] Re: add new button in GRID with same look and feel

2013-11-15 Thread Mirko
Just figured out how to do that : links=[ {'header':'...','body':lambda row: ...}, lambda row: TAG.button(T('Accept'),_type="button",_onclick='alert("%s")' %row.id) ] the second item of links list goes with the delete/view/edit buttons... Hope it helps, Mirko On Friday, November 15

Re: [web2py] Managing temporary tables

2013-11-15 Thread Johann Spies
On 14/11/2013 16:52, Richard Vézina wrote: Johann, what about creating a postgres view with you query and then just interface it as table in web2py... Of course you will not be able to do any of CRUD, but you can select/consult you data. I do that for many usage, for instance get a subset of memb

Re: [web2py] Re: grid layout problem

2013-11-15 Thread Stefaan Himpe
Hi Mirko, short answer: I have no idea really, it just came out like that, but here's what I did that might influence the result: 1. I think these are the relevant options I passed to my grid: ui='web2py', ... buttons_placem

Re: [web2py] Re: Managing temporary tables

2013-11-15 Thread Johann Spies
On 14/11/2013 23:03, Niphlod wrote: If strictly needed, I'd go with a fixed table ... something like user_id ref_id 1 2 1 10 1 16 Thanks Nipnlod. I am already using this technique in another part in the app. Maybe I must rethink it for the present situation. It wi

[web2py] Re: add new button in GRID with same look and feel

2013-11-15 Thread Sarbjit
Thanks !! On Friday, November 15, 2013 2:20:44 PM UTC+5:30, Mirko wrote: > > Just figured out how to do that : > > links=[ > {'header':'...','body':lambda row: ...}, > lambda row: TAG.button(T('Accept'),_type="button",_onclick= > 'alert("%s")'%row.id) > ] > > the second item of links

Re: [web2py] Re: grid layout problem

2013-11-15 Thread Mirko
Hi Stefaan, just find the answer and posted it here : https://groups.google.com/d/msg/web2py/LhuZvOAv_K4/Y11Ap1QCEYwJ Hope it helps, Mirko On Friday, November 15, 2013 10:01:24 AM UTC+1, stefaan wrote: > > Hi Mirko, > > short answer: I have no idea really, it just came out like that, but > here'

[web2py] Re: Using MEMDB with Scheduler

2013-11-15 Thread Niphlod
memdb is not a transactional db, so there's no way it will work. On Thursday, November 14, 2013 9:00:50 PM UTC+1, Joel Rathgaber wrote: > > That's too bad. Is there a reason for it, or just haven't found any use > for it yet? > -- Resources: - http://web2py.com - http://web2py.com/book (Do

[web2py] grid links appearing in details

2013-11-15 Thread Mirko
Hi all, I have grid "links" appearing in details, on the same row than the 'back' and 'edit' buttons. How can I make them not display ? Thanks ! Mirko -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.

[web2py] Re: web2py and phonegap

2013-11-15 Thread Leonel Câmara
Integrate in what way? I have used web2py to provide data to applications in phonegap and it's pretty easy. Usually I create a rest api returning mostly json (generic.json works pretty well) and use distal https://code.google.com/p/distal/ to render stuff on the phones. If you want aut

Re: [web2py] Error uploading 60 character named .pptx file

2013-11-15 Thread Rahul
Hi All, Thanks! Limedrop, your suggestion resolves the issue. Thanks! Loic, Niphlod, Ricardo and All for your valuable suggestions and responses. Thanks Web2py has #1 community. Cheers! Rahul On Friday, November 15, 2013 2:49:22 AM UTC+5:30, Limedrop wrote: > > Actually, the web2py set

[web2py] Re: Value is not updated in db on submitting form from grid

2013-11-15 Thread Anthony
Instead, why don't you try: db.define_table('ItemOwners', Field('ItemName', requires=IS_IN_DB(db, 'ItemRecords.ItemName'))) Anthony On Friday, November 15, 2013 3:35:17 AM UTC-5, Sarbjit wrote: > > > My requirement was to show drop down list for a field generated using GRID > by using the v

[web2py] Re: Problems upgrading from 2.7.2 to 2.7.4 on Mac OS X 10.9 (Mavericks)

2013-11-15 Thread TC
Got it to work. Went into System Preferences - Security & Privacy under the General tab and selected Allow apps downloaded from: Anywhere. I only needed to do this on my MacBook Air when I got the "damaged file" message. On my MacBook Pro it refused to open the application from an unidentif

[web2py] Re: call function with parameter from views

2013-11-15 Thread User
I think by default, functions with arguments are not exposed. From: http://stackoverflow.com/questions/3003449/web2py-controllers-with-parameters "web2py specifically detects valid controller functions as those functions that have no arguments" On Thursday, November 14, 2013 9:03:34 PM UTC-5,

[web2py] Using web2py on travis-ci.org

2013-11-15 Thread Duke Leto
Howdy web2py-users, I am attempting to get a web2py project to run a test suite on travis-ci.org, but I am running into troubles. In particular, web2py does not seem to produce output of any kind and does not bind to any port that I ask it to. You can see an example of this here, under Python 2

[web2py] how to preselect multiple options in SELECT helper

2013-11-15 Thread Shreyas Pandya
please see the question on stack overflow http://stackoverflow.com/questions/1852/how-to-preselect-options-in-select-helper-in-web2py reproduced here for convenience when creating multiple select input with SELECT, OPTION helpers, I want to preselect some options, I tried following OPTION(

[web2py] Re: serious memdb issue

2013-11-15 Thread Massimo Di Pierro
Do you use MEMDB? It could be an issue. On Thursday, 14 November 2013 13:58:56 UTC-6, Joel Rathgaber wrote: > > Does this only apply to GAE use? We use memcache for sessions but not GAE. > > Thanks, > --Joel. > > On Wednesday, November 13, 2013 6:19:14 PM UTC-6, Massimo Di Pierro wrote: >> >> A s

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2013-11-15 Thread PeterL
Hi Kevin, I realize this is an old thread, but if you're still around, I just wanted to confirm whether this script is capable of extracting and creating foreign-keys with the "reference" keyword? I'm thinking not, since it did not give me any after I ran it, but perhaps there's an option I'm

[web2py] Re: web2py ajax failing when behind reverse proxy

2013-11-15 Thread Massimo Di Pierro
I opened a ticket about. Clearly storing URLs in data attributes gets ignored by Proxies. On Thursday, 14 November 2013 17:46:42 UTC-6, DeanK wrote: > > I'm having trouble with a web2py site sitting behind an Apache2 reverse > proxy that uses web2py's built in ajax capability. The main domain s

[web2py] Re: Different code at web2py.com/examples/static/epydoc vs code.google.com/p/web2py/source/browse?

2013-11-15 Thread Massimo Di Pierro
Something is wrong with the epydoc. Will check. On Thursday, 14 November 2013 19:19:43 UTC-6, User wrote: > > Why is the source code for the navbar function > > http://web2py.com/examples/static/epydoc/web2py.gluon.tools-pysrc.html#Auth.navbar > different than the code for > http://code.google.co

[web2py] web2py vs asp

2013-11-15 Thread Richard
Hello, Someone send my this : http://vschart.com/compare/web2py/vs/asp-net-mvc-framework It seems to miss info for web2py at the end though :) Richard -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.goo

[web2py] Re: grid links appearing in details

2013-11-15 Thread 黄祥
had you already try to set links=None? ref: http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM.grid-signature best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.go

[web2py] Re: grid links appearing in details

2013-11-15 Thread Mirko
Yes, but they disappear from the grid as well... On Friday, November 15, 2013 4:21:15 PM UTC+1, 黄祥 wrote: > > had you already try to set links=None? > > ref: > > http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM.grid-signature > > best regards, > stifan > -- Resources: -

[web2py] Re: web2py ajax failing when behind reverse proxy

2013-11-15 Thread Anthony
Does it work if you add the following to your proxy_html.conf file: ProxyHTMLLinks div data-w2p_remote See http://httpd.apache.org/docs/current/mod/mod_proxy_html.html#proxyhtmllinks and http://apache.webthing.com/svn/apache/filters/proxy_html/proxy_html.conf. Anthony On Thursd

[web2py] Re: grid links appearing in details

2013-11-15 Thread Anthony
You can do something like: links='view' not in request.args Anthony On Friday, November 15, 2013 10:43:36 AM UTC-5, Mirko wrote: > > Yes, but they disappear from the grid as well... > > On Friday, November 15, 2013 4:21:15 PM UTC+1, 黄祥 wrote: >> >> had you already try to set links=None? >> >> re

[web2py] Re: web2py ajax failing when behind reverse proxy

2013-11-15 Thread DeanK
Awesome. I was trying to use mod_substitute to replace the url in the data tag but things weren't loading right. Anthony's suggestions worked. I'm going to do some more extensive testing, but at first glance it looks like that did the trick. Thanks! On Friday, November 15, 2013 10:44:34 A

[web2py] Re: grid links appearing in details

2013-11-15 Thread Mirko
lol, it does that also in edit... I have another grid for which I don't see this behaviour, I have to figure out why... btw, I'm using 2.5.1 On Friday, November 15, 2013 4:52:07 PM UTC+1, Anthony wrote: > > You can do something like: > > links='view' not in request.args > > Anthony > > On Friday,

[web2py] Re: web2py ajax failing when behind reverse proxy

2013-11-15 Thread Anthony
Also, note that if you call redirect(..., client_side=True), web2py will send the redirect URL in a special "web2py-redirect-location" HTTP header, which will be read by the JS code in web2py.js. Also, when web2py makes an Ajax call to load a component, it passes the URL of the parent page in a

[web2py] A helper and delete argument

2013-11-15 Thread Mirko
Hi all, when I try to use the example from the book below, ( the-views#Built-in-helpers ) {{=A('click me', callback=URL('myaction'), delete='tr")}} the behavior is: * delete warning popup appear * html table row i

[web2py] Reset password based on username instead of email

2013-11-15 Thread DeanK
So I have a somewhat unique situation where multiple different users will be creating separate accounts with unique usernames, using the SAME email address. I figured I could make this happen by using custom auth tables like this: ## Manually set up Auth tables so you can have non-unique email

[web2py] Re: mongodb upload field raising exception "data must be an instance of str"

2013-11-15 Thread Alan Etkin
> > I suppose it is ok but should be tested. Please file an issue at > http://code.google.com/p/web2py/issues > http://code.google.com/p/web2py/issues/detail?id=1777 -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - ht

Re: [web2py] Re: Web2py freezing on live deployment!

2013-11-15 Thread Andrew Buchan
Hi Derek, the install on Apache is running fine and the ajax issue it threw up I was able to fix as described above. So my problem is solved, but thanks for checking in again. I found that after updating to the latest version of web2py, it was easy to get apache running following the deployment rec

[web2py] Re: How to view the referenced table field name and not their id

2013-11-15 Thread Dave S
The short way of saying this is "one person can have many dogs". I skimmed back through the book, and the example in 7.2.6 is closest, but it isn't adding a dog, just listing a dog already known, so there is just one owner to find (it's given as a link).

[web2py] Re: A helper and delete argument

2013-11-15 Thread Niphlod
please move to web2py > 2.6.0, possibly 2.7.3 or trunk... it has better handling of ajax events in case of errors (i.e. if the row isn't deleted for whatever reason and 'myaction' returns not a "successful" status, the table row doesn't get deleted) On Friday, November 15, 2013 5:39:20 PM UTC+1

Re: [web2py] Re: Web2py freezing on live deployment!

2013-11-15 Thread Derek
That's cool, I was just asking about the side project of Niphlod's to look at the pytds so that we could finally have a pure python database adapter. With a pure python adapter, gevent could properly use greenlets to make database queries, thus there would be no blocking on the queries. On Frid

[web2py] Re: Different code at web2py.com/examples/static/epydoc vs code.google.com/p/web2py/source/browse?

2013-11-15 Thread Niphlod
@massimo: there's still the roadmap to take the api docs to the next level using sphynx (should have happened with 2.7.0 but somehow we skipped it). Let me know when there will be a "feature freeze" and/or some time between releases to get it working (as of right now, docstrings are a total di

[web2py] Re: how to preselect multiple options in SELECT helper

2013-11-15 Thread Niphlod
nope... when a select has "preselections" the markup is If you want to do it "the hard way" (i.e. without SQLFORM.factory), you need set the "preselection" with OPTION(v, _value=v, _selected='') On Friday, November 15, 2013 12:33:13 PM UTC+1, Shreyas Pandya wrote: > > please s

[web2py] Does web2py have an ajax username availablity validator?

2013-11-15 Thread User
On my user registration form I'd like to add an ajax username availability control similar to how twitter does. After each character you type on twitter registration you get either "Username is available." or "This username is already taken!" Does web2py have something like this already? I kn

[web2py] requires=IS_IN_SET translation

2013-11-15 Thread Ruud Schroen
Is it possible to translate the strings in the requires=IS_IN_SET? -- 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 a

[web2py] Re: serious memdb issue

2013-11-15 Thread Joel Rathgaber
We do use MEMDB with the memcache client for sessions. Do you know when this bug was introduced? We are still running 2.5.1 in production, but were looking to upgrade soon. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code)

[web2py] Re: Database insert of time field in web2py not working?

2013-11-15 Thread User
Does this need the original validator to have been defined as a list to work? Is there a difference between db.table.field.requires = first_validator and db.table.field.requires = [first_validator] Does your append code work in either case? If there is a difference, when you declare a field

[web2py] Re: grid links appearing in details

2013-11-15 Thread 黄祥
yes, i think you can achieve it with add the 'edit' check args on it. e.g. show_links = 'view' not in request.args or 'edit' not in request.args links = show_links best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (S

[web2py] exact syntax for compute example

2013-11-15 Thread Alex Glaros
Can anyone please type exact syntax for computed field "personDisplayName" below? auth.settings.extra_fields['auth_user']= [ Field('personMiddleName','string', label='Middle name'), Field('personDisplayName', compute=lambda r: r[first_name] [last_name]) ] (I realize field is redundant

[web2py] Re: requires=IS_IN_SET translation

2013-11-15 Thread 黄祥
yes, can, but be carefull if you have the conditional logic to check value of that field and your site support multilanguage. e.g. db.supplier.gender.requires = IS_IN_SET([T('Male'), T('Female')]) if you have a conditional logic to check the value of that field, and your site support multilangua

[web2py] Re: call function with parameter from views

2013-11-15 Thread 黄祥
thank you so much for your link. i just need to add request.vars on the function in controller. e.g. *controllers/default.py* def revert(): ids = request.vars.ids for id in ids: detail = db(db.rent_detail.id == id).select().first() db.revert_detail.insert(rent_no = detail.rent_no, due_date = detai

[web2py] Re: exact syntax for compute example

2013-11-15 Thread 黄祥
hm, i think what you need is represent in the field constructor. e.g. not tested Field('personDisplayName', represent = lambda personDisplayName, field: '%s %s' % (field.first_name, field.last_name)) best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation)

[web2py] Re: exact syntax for compute example

2013-11-15 Thread Alex Glaros
Hi Stifan, I have a special situation where represent can't work with the business logic. Has to be a compute. Any hints for the "compute" syntax? thanks, Alex On Friday, November 15, 2013 5:09:03 PM UTC-8, 黄祥 wrote: > > hm, i think what you need is represent in the field constructor. > e.g.

[web2py] Re: Does web2py have an ajax username availablity validator?

2013-11-15 Thread 黄祥
i think you must created it by yourself, for checking the username availability with ajax. the default web2py is check it is_not_in_db during onsubmit form. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Re: exact syntax for compute example

2013-11-15 Thread 黄祥
i think in compute you must put the row on it (both first_name and last_name) and not sure it can handle string: e.g. not tested Field('personDisplayName', compute=lambda r: r[first_name] r[last_name]) another suggestion why not use default? or maybe after_insert callback to update the persondis

[web2py] Re: Database insert of time field in web2py not working?

2013-11-15 Thread 黄祥
> > Does this need the original validator to have been defined as a list to > work? > it depend, wheter you need 1 validator or more than 1 validator, if more than 1 validator please use list of validators []. > db.table.field.requires = first_validator > use it if you only need 1 validator

[web2py] Re: exact syntax for compute example

2013-11-15 Thread Alex Glaros
which ones of those will only work on new record and which ones will work on existing records? On Friday, November 15, 2013 5:27:58 PM UTC-8, 黄祥 wrote: > > i think in compute you must put the row on it (both first_name and > last_name) and not sure it can handle string: > e.g. not tested > Field

[web2py] Re: exact syntax for compute example

2013-11-15 Thread Alex Glaros
can't get any of the syntax to work, any hints from this attempt below? (have simplified and removed concatenation) Field('personDisplayName', default=lambda r: r'%(first_name)%s') On Friday, November 15, 2013 5:52:03 PM UTC-8, Alex Glaros wrote: > > which ones of those will only work on new r

[web2py] Re: exact syntax for compute example

2013-11-15 Thread 黄祥
default can work both for new insert and update existing. ref: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer form validation function can work both for new insert and update existing. ref: http://web2py.com/books/default/chapter/29/07/forms-and-validators callback c

[web2py] Re: exact syntax for compute example

2013-11-15 Thread 黄祥
not tested Field('personDisplayName', default = lambda personDisplayName, field: '%s %s' % (field.first_name, field.last_name) ) best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.

Re: [web2py] Re: exact syntax for compute example

2013-11-15 Thread Alex Glaros
it's getting better but received () takes exactly 2 arguments (0 given) On Fri, Nov 15, 2013 at 6:03 PM, 黄祥 wrote: > not tested > Field('personDisplayName', default = lambda personDisplayName, field: '%s > %s' % (field.first_name, field.last_name) ) > > best regards, > stifan > > -- > Resource

[web2py] Strange Issue with Executesql

2013-11-15 Thread Josh Myers
Hey all, I am running web2py version 2.4.6 and python 2.7.4. I am using executesql to run raw ms sql queries, but I am having a problem with them consistently yielding results. I am still in test right now as I develop the app and I am running queries on a local database. I do not know if

[web2py] Re: Strange Issue with Executesql

2013-11-15 Thread Tim Richardson
Could you try with a more recent version? I have not noticed problems with executesql with mssql. Just to make sure, I ran a select * on a table with 130K records several times in a row (from python web2py.py -M -S an_app) and it worked fine. DB is sqlserver express 2005. python 2.7.something w

[web2py] Re: Value is not updated in db on submitting form from grid

2013-11-15 Thread Sarbjit
Thanks Anthony for feedback. I am facing problem with this approach, since my ItemRecords could have multiple records with same name (In my actual application, there are different fields and it is logical to have same name in multiple records with different other values). Can I make them uniqu

[web2py] Re: Value is not updated in db on submitting form from grid

2013-11-15 Thread 黄祥
> > Can I make them unique, that's what I was trying to do with my code. > for make a field unique, please add unique = True on field constructor and put IS_NOT_IN_DB validator for that field. ref: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Record-representati