[web2py] function

2010-11-21 Thread tan le
i have 2 function in controler/vnstoragedoc.py def check(type1,type2,type3): query1 = db.archives.symbol.like('%'+request.vars.txtSoKyHieu+'%') query2 = db.archives.key.like('%'+request.vars.txtTuKhoa+'%') query3 = db.archives.archives_type == db.arch

[web2py] function

2015-05-12 Thread KevC
Hi community! I want to call a function inside other function, What can I do? For example: def function_1(): y = 'This is an example' (I wanna here my function "function_2") return locals() def function_2(): x = 'Hello world' return locals() My best regards. -- Resourc

[web2py] function in query

2011-02-11 Thread Manuele Pesenti
Hi, how can I select records of a table that got 2 date fields (one datetime and a simple date) wich difference is a fixed value? I thought this solution: import datetime today=datetime.datetime.today() yesterday = today.date() - datetime.timedelta(days=1) db.define_table('mytab', ...

[web2py] web2py function documentation

2011-03-25 Thread Hal Smith
As I continue to plug along, following your manual, I keep bumping into web2pyfunctions (I assume) - such as index (), first (), second (), and dict (). It would be nice to have these documented, in something like the UNIX Man pages. Later, it speaks of request.vars.visitor_name - without explaini

[web2py] function lazy_user at ...

2017-06-28 Thread António Ramos
Hello i added an authors and readers computed fields to my table db.define_table( 'entities', ... Field('authors',compute= lambda r:authors(r)), ... ) when i save a record i get this : authors : [**] created_by : 4L created_on : datetime.datetime(2017, 6, 28, 16, 16, 24) delete_record

[web2py] Function for downloading files

2013-07-17 Thread lesssugar
There's default/download function, usually used like this on files that were uploaded: Download In this case, I do not want to keep the full download path in my tag. Instead, when the link is clicked, I would like to redirect to another function, which will proceed with the download based on

Re: [web2py] function in query

2011-02-11 Thread w2padawan
2011/2/11 Manuele Pesenti : > (...) > TypeError: float() argument must be a string or a number > > Thank you very much for any help. > >Manuele > where/why is the/a float argument?

[web2py] Re: web2py function documentation

2011-03-25 Thread Massimo Di Pierro
There are Python keywords http://zetcode.com/tutorials/pythontutorial/keywords/ There are Python built-in function, defined here: http://docs.python.org/library/functions.html (dict is one of them) There are web2py APIs, they are all documented in the book: http://web2py.com/book/default/chap

[web2py] Re: web2py function documentation

2011-03-25 Thread Anthony
On Friday, March 25, 2011 10:00:04 AM UTC-4, Hal Smith wrote: > > As I continue to plug along, following your manual, I keep bumping > into web2pyfunctions (I assume) - such as index (), first (), second > (), and dict (). It would be nice to have these documented, in > something like the UNIX

[web2py] Re: web2py function documentation

2011-03-25 Thread pbreit
I agree about using the online book, especially if you are following along at your computer. If you are new to Python, make sure to read the Python chapter. Just keep in mind that writing technical documentation for a wide variety of skill levels is really, really hard. The Web2py Book does a v

[web2py] Function is evaluated twice?

2011-04-02 Thread Serbitar
I have the controller: @auth.requires_login() def roll(): if request.args(0): step = int(request.args(0)) else: return dict(message = "Roll it!") if request.args(1): visible = False else: visible = True result = util.roll_step(step) db.live.i

[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] function contingent on registration

2017-05-19 Thread R U
I would like to add a list of dates into my data base when the user signs up. from datetime import date, datetime, timedelta import random from random import randint dog = randint(3,25) def perdelta(start, end, delta): curr = start while curr < end: yield curr curr += delta

[web2py] web2py function import not working well

2014-06-03 Thread Maurice Waka
from applications.Folders1.modules.myfolder1.main import mainfrom applications.Folders1.modules.myfolder1.list1 import GAMES0 code.if id == name3: result = location return result else: while True: class Filters(object):

[web2py] Web2Py function to query the database...

2013-01-12 Thread Mihir Lade
Hi Guys, I am currently working on an assignment where I need to create a function which would query the database to search flights available according to the users input through the HTML form. I have attached a picture of the HTML form. Basically the user, selects the origin, the destination,

[web2py] Function that does not require a view

2010-10-24 Thread Luther Goh Lu Feng
If I have a function that I intend to call from different controllers, but I have no need for the function to have a view, where should this function be defined? eg. a function that simply calculates the outcome of a math formula, and several controllers will call this function to display the re

[web2py] Function in view in model less app

2014-11-30 Thread Ruud Schroen
Hi there, I'm building a webapp with the model less app approach by Bruno Rocha and I stumble upon a problem. Usually when you use models you can define function which can later be used inside a view. How would I do this with a model less approach? -- Resources: - http://web2py.com - http://w

[web2py] Function in view in model less app

2014-11-30 Thread Anthony
Of course, if you define a function in a module, you will need to explicitly import it. You can import it in a model file if you like. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/w

[web2py] Re: web2py function import not working well

2014-06-03 Thread Derek
Sorry, but it looks like it's doing what you are asking of it. Perhaps you should comment your code to make sure it's doing what you are thinking it's doing. you are instantiating a new filters class, giving it the name 'o', then you get a list of the contents of that class, run them if possible

Re: [web2py] web2py function import not working well

2014-06-03 Thread Maurice Waka
When I work with the same module on python shell, its perfectly printing out. I dont know why it does not print on web2py. Basically I imported it without editing from python shell. Anyway since am new to web2py and python, you could help out On Tuesday, June 3, 2014, Derek wrote: > Sorry, but it

Re: [web2py] web2py function import not working well

2014-06-03 Thread Michael Beller
Some of the code in the functions and classes not displayed in your original post may reference web2py globals and environment variables. I think (I'm still learning web2py also) that running your code in the shell then has access to the web2py environment. Modules do not have access automatic

Re: [web2py] web2py function import not working well

2014-06-04 Thread Derek
you running it from the shell gives you the REPL which you don't have when you run it through web2py. repl will print out if you just give it a class it will tell you what instance of class you have. if you want to print like it does in the repl, you need to 'print repr(x)' where x is the class

Re: [web2py] web2py function import not working well

2014-06-05 Thread Maurice Waka
Thanks team!! That gives me an idea of how to program. Mush appreciated! On Thu, Jun 5, 2014 at 2:20 AM, Derek wrote: > you running it from the shell gives you the REPL which you don't have when > you run it through web2py. repl will print out if you just give it a class > it will tell you what

Re: [web2py] web2py function import not working well

2014-06-08 Thread Maurice Waka
I tried to work it out but I still have no breakthrough. Now I get this None write response instead. Here is the code: from applications.test.modules.Test1 import GAMES0from applications.test.modules.Test1 import GAMES1from applications.test.modules.Test1.cores import mainfrom gluon import *de

[web2py] Re: web2py function import not working well

2014-06-08 Thread Maurice Waka
On Tuesday, June 3, 2014 12:50:48 PM UTC+3, Maurice Waka wrote: > > from applications.Folders1.modules.myfolder1.main import mainfrom > applications.Folders1.modules.myfolder1.list1 import GAMES0 > code.if id == name3: > result = location > return result > else:

[web2py] Re: Web2Py function to query the database...

2013-01-12 Thread Alan Etkin
The book has anything you are asking for and much more. For an introduction to forms and controllers I think you could check the examples at Overview: http://www.web2py.com/books/default/chapter/29/03#Overview Also, there are appliances available you can use as example: http://www.web2py.com/ap

[web2py] Re: Web2Py function to query the database...

2013-01-12 Thread Mihir Lade
Hi Alan, I've read the chapters a few times however having difficulty understanding a HTML search page would pass the information to a function where it queries multiple databases to return the data? On Sunday, January 13, 2013 8:14:07 AM UTC+10:30, Alan Etkin wrote: > > The book has anything y

[web2py] Re: Web2Py function to query the database...

2013-01-12 Thread Anthony
Can you provide more details regarding what you have tried? How are you creating the form and posting to web2py? Are you querying local databases that you are modeling with the DAL, or are you querying some external API's? When you submit a form to web2py (via GET or POST), the variables will be

[web2py] Re: Web2Py function to query the database...

2013-01-15 Thread Mihir Lade
Hi Anthony, Thanks for your reply. The code to searchFlights is as below: def searchFlights(): return dict() def show(): *receivedFlights = request.vars.originCity+','+request.vars.destCity+','+request.vars.type+','+request.vars.deptDate+','+request.vars.arrivalDate+','+request.vars.v

[web2py] Re: Web2Py function to query the database...

2013-01-15 Thread Mihir Lade
Also, I am querying a local database that I created using the DAL. Yes, I am creating a custom HTML form and posting it to web2py to query the database.. On Sunday, January 13, 2013 9:45:11 AM UTC+10:30, Anthony wrote: > > Can you provide more details regarding what you have tried? How are you

[web2py] Re: Web2Py function to query the database...

2013-01-15 Thread Anthony
Answered on StackOverflow: http://stackoverflow.com/a/14341931/440323 On Tuesday, January 15, 2013 3:19:13 AM UTC-5, Mihir Lade wrote: > > Hi Anthony, > > Thanks for your reply. > > The code to searchFlights is as below: > > def searchFlights(): > return dict() > > def show(): > *received

Re: [web2py] Function that does not require a view

2010-10-24 Thread Branko Vukelic
On Sun, Oct 24, 2010 at 2:18 PM, Luther Goh Lu Feng wrote: > If I have a function that I intend to call from different controllers, but I > have no need for the function to have a view, where should this function be > defined? eg. a function that simply calculates the outcome of a math formula, >

[web2py] Function being called twice from one button click

2015-02-26 Thread peter
confirm button. This then calls a web2py function that sends a confirmation email and books the seats in the database. A user claims it is double booking him even though he only clicks confirm once. The strange thing is it only does this for him and it has done it three weeks running. Has anyone

[web2py] Route (legacy) php request to a web2py function

2014-08-07 Thread wish7code
Hi guys, any idea how I can map an url like upload/upl*.php5* to an web2py controller/function? Background: upload/upl.php was the old url from an outdated php server stack. Unfortunately it has been hardcoded in some clients out of my control. To make things work a 301 redirect will break thi

[web2py] function that lists all members of a group

2010-02-06 Thread weheh
Is there a built-in function that will list all members of a group, or do I need to write a query to do that? Seems like such a function should exist, but I can't find it in the doc. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to thi

[web2py] Re: Route (legacy) php request to a web2py function

2014-08-08 Thread Dave S
On Thursday, August 7, 2014 1:38:48 PM UTC-7, wish...@gmail.com wrote: > > Hi guys, > > any idea how I can map an url like upload/upl*.php5* to an web2py > controller/function? > > This is way out of my range of expertise, so expect to hear sniggering from the experts, but I'd look at a rewrite

[web2py] Function for checking payments and arrears in DB needed

2019-06-14 Thread dirman
I need a function to manage payment by installment and when fee is fully paid db.define_table('payment_type', Field('category'), Field('amount', 'double'),format='%(category)s %(amount)s') db.define_table('fee', Field('name', 'reference students'), Field('category', 'reference payment_type'), Fi

[web2py] Re: GAE Task Queue no longer passes payload to web2py function

2019-05-24 Thread Dave S
On Friday, May 24, 2019 at 3:43:26 AM UTC-7, Carl Hunter Roach wrote: > > This code has been working for a couple of years but, for an unknown > reason to me, has stopped working. > > This function continues to create Tasks correctly. > > def send_task(): > from google.appengine.

[web2py] Re: GAE Task Queue no longer passes payload to web2py function

2019-05-24 Thread Carl Hunter Roach
Thanks for responding dps. Having found the issue arrive with the R-2.15.0b2 release I did try the latest 2.18x line. But that too was broken so I went back to R-2.14.6 But then last week the issue started to occur (I hadn’t pushed any code so this change is hard to explain, to say the least).

[web2py] Re: GAE Task Queue no longer passes payload to web2py function

2019-05-28 Thread Carl Hunter Roach
I installed R-2.15.4. You are right that I don't get any function parameters in the functions that handle my Google tasks. I am getting a weird error. In the function handling the Google task that historically worked) the value of `request.body` is: ', mode 'w+b' at 0x2b31c3ed9930> That is wei

[web2py] Re: GAE Task Queue no longer passes payload to web2py function

2019-05-28 Thread Dave S
On Tuesday, May 28, 2019 at 4:11:40 AM UTC-7, Carl Hunter Roach wrote: > > I installed R-2.15.4. > You are right that I don't get any function parameters in the functions > that handle my Google tasks. > > I am getting a weird error. > > In the function handling the Google task that historically

[web2py] "function ... is not JSON serializable" error when rendering db row as JSON

2011-09-02 Thread Amnon Khen
Dear web2py folks, I have a controller that fetches a record from the DB (I'm using GAE). def event(): id=request.args[0] myrow = db.event[id] return dict(myrow = myrow) What I try to render the result as JSON, I get the following error (trace starts from generic.json view)

Re: [web2py] Re: GAE Task Queue no longer passes payload to web2py function

2019-05-28 Thread Carl Hunter Roach
From: web2py@googlegroups.com on behalf of Dave S Sent: Tuesday, May 28, 2019 7:10 pm To: web2py-users Subject: [web2py] Re: GAE Task Queue no longer passes payload to web2py function On Tuesday, May 28, 2019 at 4:11:40 AM UTC-7, Carl Hunter Roach wrote: I installed R-2.15.4. You are

[web2py:25547] web2py function to pretty-print HTML (for insertion into AMY or TEXTAREA)?

2009-07-03 Thread dlypka
If I load some raw HTML into eamy or a simple TEXTAREA, I need to have it pretty-printed first, to avoid the long lines which mess up the display. I see there are various python libaries to do this. But does web2py already have such a function somewhere? I see the CODE widget, but it does colori

[web2py:21641] os.system command works in Python shell, but not in a Web2py function

2009-05-11 Thread NetHead
Hey Gang: When a user visits a page, I am attempting to run the following lines: import os os.system("E:/Python/web2py_src/web2py/applications/TheReckoning/ prod_scripts/dropship_copy_to_opc.bat") This exact command works fine from a Python interactive session, BUT when put int

[web2py:25548] Re: os.system command works in Python shell, but not in a Web2py function

2009-07-03 Thread Angelo Compagnucci
> When a user visits a page, I am attempting to run the following lines: >> >> > import os >> > os.system("E:/Python/web2py_src/web2py/applications/TheReckoning/ >> > prod_scripts/dropship_copy_to_opc.bat") >> >> > This exact com

[web2py:25554] Re: os.system command works in Python shell, but not in a Web2py function

2009-07-03 Thread mdipierro
n 11 Maio, 21:54, NetHead wrote: > > >> > Hey Gang: > > >> > When a user visits a page, I am attempting to run the following lines: > > >> > import os > >> > os.system("E:/Python/web2py_src/web2py/applications/TheReckoning/

[web2py:25556] Re: os.system command works in Python shell, but not in a Web2py function

2009-07-03 Thread Angelo Compagnucci
ve little information about your problem. You >> >> probably would live better with an IDE/debugger, probing your stack >> >> data with breakpoints and showing you the code at execution time. >> >> >> Best Regards >> >> >> On 11 Maio, 21:54, NetHead wrote

[web2py:25557] Re: os.system command works in Python shell, but not in a Web2py function

2009-07-03 Thread mdipierro
t; - Finally, you give little information about your problem. You > >> >> probably would live better with an IDE/debugger, probing your stack > >> >> data with breakpoints and showing you the code at execution time. > > >> >> Best Regards > > >>

[web2py:25612] Re: web2py function to pretty-print HTML (for insertion into AMY or TEXTAREA)?

2009-07-03 Thread dlypka
I found BeautifulSoup to do it. On Jul 3, 9:51 am, dlypka wrote: > If I load some raw HTML into  eamy or a simple TEXTAREA, I need to > have it pretty-printed first, to avoid the long lines which mess up > the display. > I see there are various python libaries to do this. > > But does web2py alr

[web2py:21649] Re: os.system command works in Python shell, but not in a Web2py function

2009-05-11 Thread Francisco Gama
web2py/applications/TheReckoning/ > prod_scripts/dropship_copy_to_opc.bat") > > This exact command works fine from a Python interactive session, > BUT when put into a Web2py function, the page never loads -- the > blue bar just creeps forward slly. > > We tried this

[web2py:21652] Re: os.system command works in Python shell, but not in a Web2py function

2009-05-11 Thread mdipierro
> > os.system("E:/Python/web2py_src/web2py/applications/TheReckoning/ > > prod_scripts/dropship_copy_to_opc.bat") > > > This exact command works fine from a Python interactive session, > > BUT when put into a Web2py function, the page never loads -- the >

[web2py] Function fails when called from scheduler, but ok when called from a controller/function

2016-01-12 Thread Lisandro
I'm seeing this traceback error when I try to run a function defined in a model: Traceback (most recent call last): File "/var/www/medios/gluon/scheduler.py" , line 295, in executor _env = env(a=a, c=c, import_models=True) File "/var/www/medios/gluon/shell.py", line 166, in env sys.exit(1) Syste

[web2py] Function can't update DB when called from scheduler, but can when called from a controller/function

2016-03-22 Thread M Mihai
So I want to update the database while a scheduler task is running but the function won't update it. If I try to run the same function from a controller it will update the database. Here is the function: def Test(): row = db(db.posts.Posted==False).select().first() row.update_record(Pos