[web2py] Can somebody help me to integrate Web2Py on Hostagtor?

2013-12-31 Thread Paulo Nelson Sobral
I'm having my first steps on web2py and python and would really benefit from a dummy tutorial... Thanks, -- 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)

[web2py] Where should I put my application logic code?

2013-12-31 Thread Wei Li
Hi, This could be a silly question:) . I am going to build up some application logic. So I will create a few class and functions. Looks like it's not very good to put these code under controllers. Although from the manual, it says controller folder is for application logic and workflow. See if

[web2py] Passing form input to a query.

2013-12-31 Thread Keith Planer
This is probably a beyond-simple problem but I can't figure it out. var = request.args(0) query=db.consumer.lname grid = '' form = FORM(Last Name: ,INPUT(_name='lname'),INPUT(_type='submit')) if form.accepts(request.vars, session): query=(db.consumer.lname=???)

[web2py] Re: I don't want 'Login Successful' or 'Success' popping up on the screen in my app.

2013-12-31 Thread Keith Planer
I found div class=flash{{=response.flash or ''}}/div in layout.html and commented it out. No more flashes. Thanks. On Monday, December 30, 2013 12:34:12 PM UTC-6, Anthony wrote: If you generally don't want flash messages, you can remove the response.flash code from layout.html. If you want

[web2py] smartgrid : editing a subtable containing field representation creates an internal error

2013-12-31 Thread Serge Bourgeois
Hi, I have an issue I cannot resolve. As I am not an expert, this is probably a personal bug (a 'stupid error'...). Thank in advance for any help. Here is how this happens... 1. My db model has 2 tables and 2 rendering functions... def render_company(f_company = None, row = None):

[web2py] Re: Where should I put my application logic code?

2013-12-31 Thread 黄祥
granma said : 'everything is wonderful if you know how to appreciate it' imho models : yet in the books said that is better to not put the logic function in models - Minimize the code in models: do not define functions there, define functions in the controllers that need them or - even

[web2py] Re: Passing form input to a query.

2013-12-31 Thread Niphlod
use form.vars holds a dict with the values matched with the _name keys, so something like form.vars.lname should definitely work On Tuesday, December 31, 2013 11:10:00 AM UTC+1, Keith Planer wrote: This is probably a beyond-simple problem but I can't figure it out. var = request.args(0)

[web2py] Re: Passing form input to a query.

2013-12-31 Thread Keith Planer
And that did, thank you. On Tuesday, December 31, 2013 6:10:02 AM UTC-6, Niphlod wrote: use form.vars holds a dict with the values matched with the _name keys, so something like form.vars.lname should definitely work On Tuesday, December 31, 2013 11:10:00 AM UTC+1, Keith Planer wrote:

[web2py] Strange error: TypeError: can't pickle lock objects

2013-12-31 Thread Álvaro José Iradier
Hi, I am using web2py hosted in Apache2 with WSGI, Python 2.7.3 on a Linux Machine. When I go to the admin interface over SSL from a remote machine, I get this error: type 'exceptions.TypeError'(can't pickle lock objects) Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. Traceback

[web2py] Re: Regarding checkbox implementation in web2py??

2013-12-31 Thread Akash Agrawall
Thanx man.. it worked. On Friday, November 1, 2013 3:57:15 AM UTC+5:30, Akash Agrawall wrote: Hie guys I am a newbie in web2py I have added a Field in the table which goes like this: { db.Field('category','list:reference

[web2py] Error in Custom Register Page in web2py

2013-12-31 Thread Akash Agrawall
Hie folks. When I click on submit button of the CUSTOM REGISTRATION form. it redirects to the same page.. ?? No idea what this is about.. Controller: default.py def register(): form=auth.register() form.add_button('Cancel', URL('register'))

[web2py] Re: Can somebody help me to integrate Web2Py on Hostagtor?

2013-12-31 Thread Alan Etkin
I'm having my first steps on web2py and python and would really benefit from a dummy tutorial... Check this posts http://www.web2pyslices.com/slice/show/1567/running-web2py-on-hostgator-shared-host https://groups.google.com/d/msg/web2py/HvKqgkatK1E/0mFjGUYPjLYJ However, deployment recipes

[web2py] Re: Error in Custom Register Page in web2py

2013-12-31 Thread Anthony
At the end of the form, you have {{=form.custom.begin}}, but it should be {{=form.custom.end}}. On Tuesday, December 31, 2013 7:24:34 AM UTC-5, Akash Agrawall wrote: Hie folks. When I click on submit button of the CUSTOM REGISTRATION form. it redirects to the same page.. ?? No

[web2py] Re: Where should I put my application logic code?

2013-12-31 Thread Anthony
2. the web2py modules is like python modules, it automatically compile it, so you will got *pyc for every module you create in here, and i think it will increaase the performance in byte compile rather in script. Note, if you use admin to compile the application, you get the same benefit

[web2py] Re: Where should I put my application logic code?

2013-12-31 Thread Anthony
Looks like to me *modules *is the best place. But the new problem is the global objects and classes are not visible to files in modules unlike files in models/controllers. I am not sure which packages need to be imported. It will be convenient if *modules *folder can be treated same as

[web2py] Re: new feature in trunk

2013-12-31 Thread Nguyen Minh Tuan
I tried to use with MS SQL but this function seem error! On Thursday, October 24, 2013 3:35:38 PM UTC+7, Arnon Marcus wrote: How would this work internally? What queries would be generated? How many queries would be generated? At what points in time would queries be executed? Would that be

[web2py] Re: Can somebody help me to integrate Web2Py on Hostagtor?

2013-12-31 Thread Kyle Flanagan
Paulo, I spent probably 48+ hours trying to get web2py running on hostgator with no success. I tried pretty much every shared hosting guide out there, opened a ticket with hostgator, had them work on it, but with no luck. I don't mean to discourage you, and if you successfully get it up and

[web2py] web2pyslices old notifications

2013-12-31 Thread Alan Etkin
If you have an account at web2pyslices, you'll probably start receiving old notifications from the site about comments, articles, etc. This is due to a bug in the model recently discovered which was preventing the automated notification service to send those mails. -- Resources: -

Re: [web2py] always get This webpage has a redirect loop if use google oauth2

2013-12-31 Thread Vinicius Assef
I'm experiencing the same problem but with CAS provider in version 2.8.2. I sent 2 emails to this list some days ago, but until now I didn't saw a solution. :-( On Tue, Dec 31, 2013 at 4:47 AM, Wei Li lim...@gmail.com wrote: I am trying to make a tiny example to login my app via google oauth2.

Re: [web2py] Re: save upload filename in database

2013-12-31 Thread Calvin Morrison
Here is my solution! if hasattr(request.vars['up_file'],filename): form.vars.filename = request.vars['up_file'].filename if form.process().accepted: redirect(URL('data', 'index')) elif form.errors: response.flash = form has errors On 28 December 2013 17:08, Calvin Morrison

[web2py] Help with query from multiple tables and groupby

2013-12-31 Thread Francisco
Hello Guys (by the way Happy New Year everyone). I'm having a problem writing a query to get product details, price and only one image for every product. I have tables like this: *db.define_table('price_lists'* *Field('name')* *)* *db.define_table('products',* *Field('name'),* *

[web2py] limit the application for client user

2013-12-31 Thread 黄祥
hi, is it possible to limit the application for client user? something identical with trial version for client user, so the user can try the application, test and use it for several time (1 month for example) or base on table record (limit to 10/100 record per table). if possible what is the

[web2py] Adding elements (e.g. a button) to SQLFORM.grid

2013-12-31 Thread Kyle Flanagan
I'm using a table to hold temporary information from a user. I use SQLFORM.grid to present this table. What I'd like to do is add a submit button below the table that calls my submit function. If I try adding an extra element in the controller according to the book

[web2py] 2nd page of results don't show up on my SQLFORM.grid

2013-12-31 Thread Keith Planer
def patient_lookup(): db.consumer.id.readable=False var = request.args(0) grid = [] links=[lambda row: A('Note',_href=URL('default', 'notes',args=[row.id ])), lambda row: A('Diagnosis',_href=URL('default', 'diagnosis_lookup' ,args=[row.id])), lambda row:

[web2py] Re: 2nd page of results don't show up on my SQLFORM.grid

2013-12-31 Thread Kyle Flanagan
My web2py experience is limited, but it seems you're losing your form.vars.lname variable when you navigate to the next page. You'll need to assign it to a request.vars, session, or some other persistent variable and then use that to build your query instead of form.vars.lname. On Tuesday,

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-31 Thread Avi A
Still stuck with that. While this is rendered as expected on w3school try me: (assuming org_code = 3): var a ={{=URL('default', 'org_form_load.load/ + org_code + ')}}; alert(a): {{=URL('default', 'org_form_load.load/3')}} on web2py it renders:

[web2py] slice added showing technique for inline SQLFORM.grid editing (no plugin)

2013-12-31 Thread Tim Richardson
I've written a slice summarising how you can made SQLFORM.grid inline editable just by using standard web2py. The idea is to use represent to show a widget, to add a submit button via selectable, and to trap post_vars to update the database. It actually only takes a few lines of code. It seems

[web2py] Re: Where should I put my application logic code?

2013-12-31 Thread Phil Hughes
Add an argument to the function: foo(bar): Only functions with no arguments can be called from the outside world. On Tuesday, December 31, 2013 3:57:56 AM UTC-6, Wei Li wrote: Hi, This could be a silly question:) . I am going to build up some application logic. So I will create a few

[web2py] Select all fields plus a calculated field?

2013-12-31 Thread User
What is the proper way to select all fields plus a few additional calculated fields? Here is my basic query with no calculated field location = db(db.location.id == loc_id).select().first() This query returns location as a class 'gluon.dal.Row' object with fields for the location table as

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-31 Thread Anthony
It appears you are trying to mix Python and Javascript. Note, everything inside the {{...}} must be Python and gets executed on the server. Adding the org_code variable must be done in Javascript, so it would be: var url = '{{=URL('default', 'org_form_load.load')}}'; $.web2py.component(url +

[web2py] Re: 2nd page of results don't show up on my SQLFORM.grid

2013-12-31 Thread Anthony
Of course. Your function creates and returns a grid only when the form is submitted -- otherwise it never gets through your form.accepts test. You might be better off using the built-in grid search functionality. You can modify the search to only search the lname field. You just have to add

[web2py] Re: Adding elements (e.g. a button) to SQLFORM.grid

2013-12-31 Thread Tim Richardson
I've been experimenting with this (see this for example http://www.web2pyslices.com/slice/show/1928/basic-inline-editing-in-sqlformgrid-no-plugin-method) The slice shows how to add a submit button, process the submit and also how to use web2py widgets to make grid elements in-line editable.

Re: [web2py] Re: Where should I put my application logic code?

2013-12-31 Thread Wei Li
Thank you all for the replies! On Tue, Dec 31, 2013 at 1:10 PM, Phil Hughes nica...@gmail.com wrote: Add an argument to the function: foo(bar): Only functions with no arguments can be called from the outside world. On Tuesday, December 31, 2013 3:57:56 AM UTC-6, Wei Li wrote: Hi, This

[web2py] web2py app like adminer

2013-12-31 Thread 黄祥
hi, is there any web2py tools like adminer? if not, is it possible to create one like adminer? ref: http://www.adminer.org/ thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-31 Thread Avi A
Now I got it... theoython {{ is rendered befor the js Thanks. On Wednesday, January 1, 2014 2:22:24 AM UTC+2, Anthony wrote: It appears you are trying to mix Python and Javascript. Note, everything inside the {{...}} must be Python and gets executed on the server. Adding the org_code

[web2py] Re: slice added showing technique for inline SQLFORM.grid editing (no plugin)

2013-12-31 Thread Simon Ashley
+1 ... inspired a solution to a long standing issue. May have to take back a few things I've said about Collingwood of late :) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -