[web2py] auth.settings.login_onaccept and request.vars_next

2014-10-31 Thread Annet
I have the follwoing auth settings: auth.settings.login_next = URL('default', 'index') auth.settings.login_onaccept = lambda form: on_login() When the user visits: www.domain.com/my/group/confirm_connect/8/3 without being logged in he is redirected to: www.domain.com/my/default/user/login a

[web2py] Minor suggestion for web editor

2014-10-31 Thread António Ramos
Hello i find myself a lot of times using the web editor for minor corrections There is already the "Exposes: " line above the code but does not allow to follow directly to editing the controller. Is is asking too much for this litle improvement? I have to scrooll hundreds of lines looking for m

[web2py] Re: Minor suggestion for web editor

2014-10-31 Thread Paolo Valleri
The "expose: controller_method_1, controller_method_2 ..." line is supposed to contain shortcuts that open a new tab and call the method controller you clicked. I'm not sure I understood what you aske; are you interested in changing the current behavior so when you click the controller name, you

[web2py] function 'GEOSversion' not found

2014-10-31 Thread Raouf Mir
i am gettting this error. function 'GEOSversion' not found -- 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 subs

[web2py] Forcing download of generated PDF

2014-10-31 Thread Jason Solack
Hello everyone, i'm generating a PDF using pdfkit and i'd like my function to force the download of the pdf file i'm making. Here's some simple code demonstrating the PDF being made in memory: def make_pdf(): import pdfkit pdf = pdfkit.from_string("test", False) return pdf Ideally

[web2py] Unit Testing

2014-10-31 Thread Ben Olivas
What do people use to perform unit testing in web2py? -- 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 subscribed

[web2py] if else if in views

2014-10-31 Thread Sriram Gudimella
Why does this .. {{for i in range(0,3):}} {{if i==0:}} Email : {{=form[i]}} {{else if i==1:}} Passkey

[web2py] Forking/multiprocessing bug triggered by Web2Py launch directory

2014-10-31 Thread Roshan Mathews
Hi, I have a weird bug that seems to be triggered when using the multiprocessing module, if web2py is launched from another directory. I've tried to isolate the issue. To reproduce the issue, take a clean web2py source tarball, and make the following changes: 1. to the end of *applications/welc

Re: [web2py] Re: Web Editor Blank Screen

2014-10-31 Thread Trevor Strauss
Thanks to whoever denied my last question. Here it is...plus broke something today which allow me to view the file but have no idea what broke. picture attached of style change ... someone must know? The other missing item is the create button in the files toggle slide outdoes this give anyon

[web2py] Re: SQLFORM. Insert field to DB from calculation (not from form)

2014-10-31 Thread Dmitry Vlasov
Solve a problem by myself. Simply put additional code with callback call before in line 428. четверг, 23 октября 2014 г., 14:20:25 UTC+4 пользователь Dmitry Vlasov написал: > > Hi folks, > > I'm trying to insert additional field to DB, but it cannot be obtain from > SQLFORM. > I use SOLIDGRID p

[web2py] Asynchronous Background Processes

2014-10-31 Thread Josh L
I'm trying to solve a business problem where I need to cache many images, around 20 at a time from a third party website on my server and then serve those to a client. A key requirement is that they be made available as quickly as possible, so for this reason I started building a function in We

[web2py] download an in memory PDF generated by pdfkit

2014-10-31 Thread Jason Solack
Hello, i have a PDF file i have generated and i'd like to have users download when clicking an 'export' button on the page. i have tried this: import pdfkit pdf = pdfkit.from_string("test", False) return response.stream(pdf, attachment=True, filename="whatever.pdf") and it doesn't

[web2py] Uploading of file is not working.

2014-10-31 Thread Nurendra Choudhary
Hi, My db.py is: Field ('Research_Statement','upload'), Field ('Teaching_Statement','upload'), Field ('Relevant_

[web2py] Deploying web2py-based service along with no-web2py main site

2014-10-31 Thread Dmitry Vlasov
Hi, web2py users, anybody know, is there a way to deploy service, written with web2py in a such a way: 1) we have a site, xxx.com, for example. The site isn't web2py based. It is accessible from internet and shouldn't be touched. 2) the main aim is to access web2py service requesting subdoma

[web2py] Re: janrain implementation

2014-10-31 Thread marylou
According to janrain, the web2py built in code for using janrain uses a deprecated method of displaying their login widget. Has anyone been able to recently integrate janrain in a web2py application? If so, how. Thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documentation)

[web2py] How to create a dual purpose login?

2014-10-31 Thread Luis Ramos
Hi guys, the website I'm programming has to parts, one for the "provider" and one for the "client". Is it possible to have just one login box for both? The main goal is that everybody logs in in the same page, then if is a client, take it to the client dashboard, if is a provider, take it to th

[web2py] Pack Custom, Failing

2014-10-31 Thread James O' Driscoll
All, I am trying to use Pack Custom option to make a slice. When I click the Pack Custom, I can see the tree file structure for a split second, then it disappears. I am using source distribution and I have used used the latest version to test. Any help would be great. Regards, James -- Re

[web2py] image blog

2014-10-31 Thread Ken Archer
Hi, I am a newbie to web2py. I am going through the manual; at the 'image blog'. Having entered the code, I get the following error when I click database administration. I would greatly appreciate if assistance can be rendered in this regard. ('DAL' object has no attribute 'image_id') -- Reso

[web2py] P3P headers in redirects

2014-10-31 Thread Vlada Ćalić
Hello, I have a very strange problem which I'm not able to solve, somebody may be able to help. I'm building a web app which needs to run embedded in an iframe of a company web. It works in normal browsers but not in IE. Of course, it's "Privacy policy" that prevents it from working. I foun

Re: [web2py] Re: Minor suggestion for web editor

2014-10-31 Thread António Ramos
i dont want to change current behaviour just would like to see added a feature to edit the code of the controller so i dont have to scroll down until i find it 2014-10-31 13:48 GMT+00:00 Paolo Valleri : > The "expose: controller_method_1, controller_method_2 ..." line is > supposed to contain s

Re: [web2py] if else if in views

2014-10-31 Thread Marin Pranjić
Why don't you use elif? On Wed, Oct 29, 2014 at 6:23 PM, Sriram Gudimella < sriramsgudime...@gmail.com> wrote: > Why does this .. > > {{for i in range(0,3):}} > > {{if i==0:}} > > Email : > > >

Re: [web2py] Re: Web Editor Blank Screen

2014-10-31 Thread Paolo Valleri
something has not been loaded correctly, can you check the chrome developer console? Il giorno venerdì 31 ottobre 2014 15:02:09 UTC+1, Trevor Strauss ha scritto: > > Thanks to whoever denied my last question. Here it is...plus broke > something today which allow me to view the file but have no i

[web2py] Re: How to create a dual purpose login?

2014-10-31 Thread Leonel Câmara
Sure, I would add a redirect to login_onaccept to do that. -- 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 subsc

[web2py] Re: Format specification for chained one to many

2014-10-31 Thread Ron McOuat
Thanks Anthony, that worked. For some reason lambdas still confuse me, I need to work on that. In terms of the model I didn't show all the fields, there are mid block addresses as well. I am thinking the best way forward is to denormalize the road table into the address table and put the values

[web2py] Re: Deploying web2py-based service along with no-web2py main site

2014-10-31 Thread Niphlod
configure web2py to be served within the server that handles subdomain.xxx.com On Thursday, October 30, 2014 12:10:44 AM UTC+1, Dmitry Vlasov wrote: > > Hi, web2py users, > > anybody know, is there a way to deploy service, written with web2py in a > such a way: > > 1) we have a site, xxx.com, fo

[web2py] ajax eval not working when url has an argument

2014-10-31 Thread Toby
Hi, I tried this ajax eval example: http://www.web2py.com/books/default/chapter/29/11/jquery-and-ajax#Eval-target It works fine so long as the url doesn't have an argument. But if I add an argument to the url, then it doesn't work anymore. For example https://apps.homemade-gifts-made-easy.com/aj

[web2py] Re: ajax eval not working when url has an argument

2014-10-31 Thread Anthony
Should work. Please show your code. Anthony On Friday, October 31, 2014 12:30:17 PM UTC-4, Toby wrote: > > Hi, > > I tried this ajax eval example: > > http://www.web2py.com/books/default/chapter/29/11/jquery-and-ajax#Eval-target > > It works fine so long as the url doesn't have an argument. But i

[web2py] Re: Format specification for chained one to many

2014-10-31 Thread Anthony
On Friday, October 31, 2014 11:26:02 AM UTC-4, Ron McOuat wrote: > > Thanks Anthony, that worked. For some reason lambdas still confuse me, I > need to work on that. > Note, it doesn't have to be a lambda -- you can write a separate function: def address_format(row): return '%s %s' % (row.st

[web2py] Unexpected common filter behavior

2014-10-31 Thread mcamel
Hi everybody, It seems common filters do nothing is there is no WHERE clause in the SQL. Following book example: db.blog_post.insert(subject='one', post_text=request.utcnow, is_public= True) db.blog_post.insert(subject='two', post_text=request.utcnow, is_public= False) this gives no WHE

[web2py] Re: if else if in views

2014-10-31 Thread Anthony
What you have written is equivalent to: if i == 0: ... else: if i == 1: ... else: ... Perhaps you instead meant: if 1 == 0: ... elif i == 1: ... else: ... Anthony On Wednesday, October 29, 2014 1:23:38 PM UTC-4, Sriram Gudimella wrote: > > Why does this

[web2py] Re: Unexpected common filter behavior

2014-10-31 Thread Leonel Câmara
Well the common_filter is on the table and you give it no table. -- 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

[web2py] Re: Unexpected common filter behavior

2014-10-31 Thread Anthony
In the BaseAdapter._select method at https://github.com/web2py/web2py/blob/master/gluon/dal/adapters/base.py#L1035, it looks like tables included only by virtue of the list of fields in ._select() but not explicitly included in the query are purposely left out of the common_filters fitlering (i

[web2py] Re: Unexpected common filter behavior

2014-10-31 Thread mcamel
Sorry Leonel, for the sake of brevity i've just started where the book ends. You need to write this before: db.define_table('blog_post', Field('subject'), Field('post_text', 'text'), Field('is_public', 'boolean'), common_filter = lambda query: db.blog_post.is_public==True ) I append now both ful

[web2py] Re: Unexpected common filter behavior

2014-10-31 Thread Leonel Câmara
Well if common_fields are used for security reasons it must definitely be revisited. Although, my design choice would be different, I would not allow you to put fields in the select from tables not explicitly included. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation)

[web2py] Re: Unexpected common filter behavior

2014-10-31 Thread Leonel Câmara
In my opinion this bug is caused by bad design that complicates things unnecessarily. Why are we allowing users to ask for fields in the select for tables they haven't included in the query? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/we

[web2py] Re: Unexpected common filter behavior

2014-10-31 Thread mcamel
Ticket opened: https://code.google.com/p/web2py/issues/detail?id=2010 Regards. -- 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

[web2py] Re: Unexpected common filter behavior

2014-10-31 Thread Niphlod
+1: never coded with that syntax and it feels unnatural to me. On Friday, October 31, 2014 8:47:44 PM UTC+1, Leonel Câmara wrote: > > In my opinion this bug is caused by bad design that complicates things > unnecessarily. Why are we allowing users to ask for fields in the select > for tables the

[web2py] Re: Unexpected common filter behavior

2014-10-31 Thread mcamel
Book has plenty of examples like: db().select(db.person... To encourage people not to code that way they should be changed. Is this the way you encourage? db(db.person).select(db.person... Regards. El viernes, 31 de octubre de 2014 21:12:23 UTC+1, Niphlod escribió: > > +1: never code

[web2py] Re: Unexpected common filter behavior

2014-10-31 Thread Anthony
On Friday, October 31, 2014 3:47:51 PM UTC-4, Leonel Câmara wrote: > > In my opinion this bug is caused by bad design that complicates things > unnecessarily. Why are we allowing users to ask for fields in the select > for tables they haven't included in the query? > But the DAL doesn't really p

[web2py] basic argument question

2014-10-31 Thread Alex Glaros
Assume am total beginner: Argument below gets correctly passed to controller named "comment_on_an_object". dict(header='Comments', body=lambda row: A('Comments',_class="btn btn-mini" , _href=URL('comment_on_an_object', vars=dict(filter=row.objectID, looks good so far: http://127.0.0.1:800

[web2py] Re: basic argument question

2014-10-31 Thread Anthony
On Friday, October 31, 2014 4:46:32 PM UTC-4, Alex Glaros wrote: > > Assume am total beginner: > > Argument below gets correctly passed to controller named > "comment_on_an_object". > > dict(header='Comments', body=lambda row: A('Comments',_class="btn > btn-mini", _href=URL('comment_on_an_object

[web2py] Re: Unexpected common filter behavior

2014-10-31 Thread Leonel Câmara
It feels completely unnatural to me to just ask the DAL for fields. I do get your point with the "FROM" clause whoever I don't think it maps well to DAL semantics. I do realize I'm not being very objective with this opinion. More technically, one of the biggest code smells for me, is when you n

[web2py] Re: [web2py-dev] Unexpected common filter behavior

2014-10-31 Thread Massimo DiPierro
db(query).select(*fields) is supposed to translated into SELECT *fields (from TABLE) WHERE query where TABLES are inferred automatically from fields or from query. In principle one can have fields without a query (no WHERE) and a query without fields (select *). On Oct 31, 2014, at 3:12 PM,

[web2py] Re: [web2py-dev] Unexpected common filter behavior

2014-10-31 Thread Massimo DiPierro
But it is critical to be able to filter fields at the database level. I think db as the send of all records db(...) as a subset, db(...)(...) as a set of all subset, etc. db(...).select(..fields..) specified which columns to filter from the set. On Oct 31, 2014, at 3:12 PM, Niphlod wrote: >

[web2py] Re: Unexpected common filter behavior

2014-10-31 Thread Anthony
> > More technically, one of the biggest code smells for me, is when you need > to remember to change things in more than one place when adding a feature. > Someone is bound to forget it. This feature may also hide a bug where a > user forgets to add a query for one of the tables but still gets

[web2py] Re: Unexpected common filter behavior

2014-10-31 Thread Anthony
On Friday, October 31, 2014 5:10:24 PM UTC-4, Leonel Câmara wrote: > > It feels completely unnatural to me to just ask the DAL for fields. > Then how in web2py would you best represent the following? SELECT name FROM person It seems to me that db().select(db.person.name) is the closest you can g

[web2py] import error when running compiled version of web2py

2014-10-31 Thread skd
Hi all, I have a web2py app that runs perfectly fine when running with web2py_src on windows. However, if i compile and pack the app and attempt to run it with web2py.exe in windows, I get import errors such as: Cannot import module 'requests' If I type import requests at a python shell i get

[web2py] Re: basic argument question

2014-10-31 Thread Alex Glaros
Thanks Anthony, args look good: http://127.0.0.1:8000/ES1/default/comment_on_an_object?filter=5&id=1 but for 2nd variable, objectComments = db.SuperObjectComment(request.get_vars.id) this error appears: 'str' object has no attribute 'created_on' However, if I use below statement where ever

[web2py] Re: import error when running compiled version of web2py

2014-10-31 Thread skd
skd writes: > > If I type import requests at a python shell i get no errors > If I type import requests at a python shell launched via command window > launched without admin rights I do indeed get errors > More info on attempting to type import requests at a python shell: - when the comm

[web2py] Re: How to create a dual purpose login?

2014-10-31 Thread Luis Ramos
Thanks for the answer, I'll test it tonight. On Friday, October 31, 2014 11:17:17 AM UTC-4, Leonel Câmara wrote: > > Sure, I would add a redirect to login_onaccept to do that. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source c

[web2py] update_or_insert

2014-10-31 Thread Luis Ramos
I'm currently using this method to insert new elements. How can I update the 'update_date' field only if there's an update and only insert the 'creation_date' one time? import datetime now = datetime.datetime.now() db.define_table('dogs', Field('name'), Field('

[web2py] Re: Translation issue

2014-10-31 Thread Massimo Di Pierro
very strange because T(T(...)) would not translate twice but T(T(...)+'') would. On Monday, 27 October 2014 03:28:35 UTC-5, Ion Caliman wrote: > > Hi! > > I reported a bug with translation here >

[web2py] Re: janrain implementation

2014-10-31 Thread Massimo Di Pierro
In gluon/contrib/login_methods/ we have both janrain_account.py (new) and rpx_account.py (old). New apps should old janrain_ccount. On Monday, 27 October 2014 14:02:26 UTC-5, mar...@hens-teeth.net wrote: > > According to janrain, the web2py built in code for using janrain uses a > deprecated me

[web2py] Re: Pack Custom, Failing

2014-10-31 Thread Massimo Di Pierro
Please open a ticket about this. I will reviews this asap. What OS? What browser? On Tuesday, 28 October 2014 18:56:46 UTC-5, James O' Driscoll wrote: > > All, > > I am trying to use Pack Custom option to make a slice. > > When I click the Pack Custom, I can see the tree file structure for a > s

[web2py] Re: image blog

2014-10-31 Thread Massimo Di Pierro
A typo somewhere? Can you show the complete traceback? On Tuesday, 28 October 2014 23:02:18 UTC-5, Ken Archer wrote: > > Hi, > I am a newbie to web2py. I am going through the manual; at the 'image > blog'. > Having entered the code, I get the following error when I click database > administrati

[web2py] Re: function 'GEOSversion' not found

2014-10-31 Thread Massimo Di Pierro
Now a web2py error On Thursday, 30 October 2014 23:07:11 UTC-5, Raouf Mir wrote: > > i am gettting this error. > function 'GEOSversion' not found > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.co

[web2py] Re: basic argument question

2014-10-31 Thread Anthony
On Friday, October 31, 2014 8:01:53 PM UTC-4, Alex Glaros wrote: > > Thanks Anthony, args look good: > > http://127.0.0.1:8000/ES1/default/comment_on_an_object?filter=5&id=1 > > but for 2nd variable, > > objectComments = db.SuperObjectComment(request.get_vars.id) > The above method does not retur

[web2py] Re: update_or_insert

2014-10-31 Thread Anthony
Does this work: db.define_table('dogs', ..., Field('creation_date', 'datetime', default=now), Field('update_date', 'datetime', default=None, update=now)) Then in your update_or_insert, don't explicitly specify either of those fields and let the default/update attr

[web2py] Re: auth.settings.login_onaccept and request.vars_next

2014-10-31 Thread Anthony
What does on_login() do? Assuming it doesn't do a redirect, it shouldn't interfere with the redirect to the _next URL (in which case, the problem likely lies elsewhere). Anthony On Friday, October 31, 2014 4:20:58 AM UTC-4, Annet wrote: > > I have the follwoing auth settings: > > > auth.setting