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)
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
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=???)
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
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):
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
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)
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:
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
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
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'))
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
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
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
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
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
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
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:
-
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.
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
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'),*
*
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
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
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:
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,
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:
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
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
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
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 +
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
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.
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
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)
-
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
+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)
-
36 matches
Mail list logo