[web2py] modules load another function that define tables

2022-03-08 Thread 黄祥
*modules/database_pydal* def database(): from pydal import DAL DB_URI = "sqlite://test.sqlite" db = DAL(DB_URI, pool_size = 1, migrate = True, fake_migrate = False) return db def table_customer(): from pydal import Field from pydal.validators import IS_NOT_EMP

[web2py] Re: Is it possible to write to session variables from Web2py modules?

2021-01-23 Thread at
rds > Clemens > > > On Thursday, January 21, 2021 at 8:01:36 AM UTC+1 at wrote: > >> Is it possible to write to session variables from Web2py modules? >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (So

[web2py] Re: Is it possible to write to session variables from Web2py modules?

2021-01-23 Thread Clemens
Just reference the session in the module by: session = current.session Then you can use exactly in the same way as in the controllers. Best regards Clemens On Thursday, January 21, 2021 at 8:01:36 AM UTC+1 at wrote: > Is it possible to write to session variables from Web2py modu

[web2py] Re: Is it possible to write to session variables from Web2py modules?

2021-01-22 Thread 黄祥
> Is it possible to write to session variables from Web2py modules? > yes, it is ref: http://web2py.com/books/default/chapter/29/04/the-core?search=current.#Accessing-the-API-from-Python-modules best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documen

[web2py] Is it possible to write to session variables from Web2py modules?

2021-01-20 Thread at
Is it possible to write to session variables from Web2py modules? -- 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

[web2py] modules: NameError("name 'reload' is not defined",)

2020-06-24 Thread Serge Bourgeois
I have an issue saving my modues with the last version of web2py. Is there something I do wrong? Context: Ubuntu 18.04 / web2py version 2.20.4 / python 3.6.9 How to reproduce this issue (a bug??) with a simple example: In the applications examples, create a module (for instance empty.py) Then

[web2py] Modules not loading in python 3

2019-04-06 Thread John Bannister
Hi all, I have recently upgraded to python 3.6 from 2.7 running on Centos7 with apache. Problem I am having is as follows:- 1: I have a number of apps each of which has a number of modules. Whilst it seems that I can import modules from paython (such as pytz etc) and I can also import modules

[web2py] Modules Import Problem.

2018-07-20 Thread Scott ODonnell
I have an API Wrapper library I'm trying to use in my Web2PY project by including it in the modules directory. I'm copying a directory called myWrapper into the modules directory. The result is applications/myApp/modules/myWrapper Within the myWrapper directory are all the files that make up the

[web2py] Re: execute web2py modules in terminal on 2.16.1

2018-01-04 Thread 黄祥
it works well now, thanks alex and anthony best regards, stifan -- 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: execute web2py modules in terminal on 2.16.1

2018-01-04 Thread Anthony
On Thursday, January 4, 2018 at 11:47:18 AM UTC-5, Alex Beskopilny wrote: > > Hi! > replace print "install" > with print ("install") > The reason you now need to use the print() function instead of the print statement when running code via the web2py shell (even with Python 2), is that in the g

[web2py] Re: execute web2py modules in terminal on 2.16.1

2018-01-04 Thread Alex Beskopilny
Hi! replace print "install" with print ("install") On Tuesday, January 2, 2018 at 10:06:31 PM UTC+3, 黄祥 wrote: > > cant execute from terminal web2py modules while in previous version is > work fine > *step on local machine (terminal)* > python -V >

[web2py] execute web2py modules in terminal on 2.16.1

2018-01-02 Thread 黄祥
cant execute from terminal web2py modules while in previous version is work fine *step on local machine (terminal)* python -V Python 2.7.10 cd rm -rf ~/web2py/applications/test cp -R ~/web2py/applications/welcome/ ~/web2py/applications/test rsync -zavr ~/git/web2py/test ~/web2py/applications

[web2py] Modules do not reflected changes.

2017-08-30 Thread Claudio Andre
Hello, I'm using web2py 2.15.3-stable on Kali (debian) and having a strange behavior. Each time I change anything on the source code of one of the modules I have inside of the folder /applications/modules/ is not reflected on the application unless I reboot the VM (tried restarting just the web

[web2py] Modules not reloading

2017-07-19 Thread Anthony
Is this Python 2 or 3? Does it work using __import__() instead of importlib? -- 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 bec

[web2py] Modules not reloading

2017-07-18 Thread António Ramos
Hello in my db.py i have this from gluon.custom_import import track_changes; track_changes(True) from wf_validates import Validate db.define_table( "status", ... Field.Virtual('isavailable', lambda row: Validate().Status(row,db)), Format="%(title)s" ) *my wf_validates.py* from html import *

Re: [web2py] Re: Nginx / Web2py modules dont reload

2015-09-25 Thread Mark Billion
Much appreciated everyone. So far touch uwsgi.ini seems to be working... On Thu, Sep 24, 2015 at 11:34 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Track changes is really meant for testing and not for production and I > cannot exclude something strange can happen in a highly con

[web2py] Re: Nginx / Web2py modules dont reload

2015-09-24 Thread Massimo Di Pierro
Track changes is really meant for testing and not for production and I cannot exclude something strange can happen in a highly concurrent environment. If the module is in the app modules/ folder, all workers should update it but something else may be going on. As Leonel says restarting uwsgi-em

[web2py] Re: Nginx / Web2py modules dont reload

2015-09-24 Thread Leonel Câmara
Yeah I pretty much just restart uwsgi-emperor or touch the affected application config file in /etc/uwsgi/vassals -- 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 Issu

[web2py] Re: Nginx / Web2py modules dont reload

2015-09-24 Thread Mark Billion
Sadly I've tried that too -- 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 to the Google Groups "web2

[web2py] Re: Nginx / Web2py modules dont reload

2015-09-24 Thread 黄祥
perhaps it about web2py custom import e.g. models/db.py ## uncomment when running on development from gluon.custom_import import track_changes; track_changes(True) best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (S

[web2py] Nginx / Web2py modules dont reload

2015-09-24 Thread Mark Billion
Running w2p on nginx/ubuntu 14.04. When I change a module's code, the changes dont show up when I load the app again (ie a class that returned 2 but now returns 1 still returns 2). Ive turned sendfile off in Nginx and have reloaded the thing over and over. Sometimes it works and sometimes I

[web2py] Modules and controllers running in processes - global variables

2014-12-03 Thread Alan Evangelista
Most of my application code is running in Python modules in the modules directory. In the modules directory, I have a few singletons which are implemented as variables defined in the main body of a globals module. However, it seems that web2py runs my modules and the controller in different pro

Re: [web2py] Modules not detecting functions

2013-02-04 Thread Massimo Di Pierro
@Johann, this is not a good solution because ties the import to the application name. @Wonton, can you email me your app so I can take a look. What os? what python version? what web2py version? On Monday, 4 February 2013 04:47:46 UTC-6, Johann Spies wrote: > > But if I do this in default.py: >

Re: [web2py] Modules not detecting functions

2013-02-04 Thread Johann Spies
But if I do this in default.py: > import mymodule > def index(): > value = mymodule.attribute > return value > > it works and return 'goobye world', so default detects the attribute but > not the function, why is this? Maybe I'm not building the module correctly? > > I've tried to put the

[web2py] Modules not detecting functions

2013-01-31 Thread Wonton
Hello everyone! I have a project in a server without admin access so it's difficult for me to debug it, I have a strange problem and I'm lost with it. Basically my default.py has something like this: import mymodule def index(): value = mymodule.function() return value And inside modul

[web2py] modules folder and pythonpath in web2py

2012-08-15 Thread Kevin Miller
Hi all, I have decided to start using eclipse for python development. I did all the import stuff and added the modules folder in my pythonpath. Everything works find except I keep getting the red X when I am using files from the modules folder. It works without problems with web2py. I am using ecl

Re: [web2py] modules

2012-05-16 Thread Bruno Rocha
For that to work you need a bare __init__.py file in all directories and subdirectories. /applications/__init__.py, /applications/yourapp/__init__.py, .../modules/__init__.py On Wed, May 16, 2012 at 12:13 PM, Aurigadl wrote: > I always work with modules. In the latest versions of web2py not work

[web2py] modules

2012-05-16 Thread Aurigadl
I always work with modules. In the latest versions of web2py not work. doing the following to import: from applications.examples.modules import test Restricting the application name.The modules are placed in the / app / modules/. As this problem solved.

Re: [web2py] Modules on Google App Engine

2012-03-15 Thread Bruno Rocha
requests module does not runs on python 2.5 https://github.com/kennethreitz/requests/issues/427 On Fri, Mar 16, 2012 at 1:52 AM, howesc wrote: > if the library is self-contained, is not written in C, and does not use > un-permitted features, you can just put the library in site-packages inside >

Re: [web2py] Modules on Google App Engine

2012-03-15 Thread howesc
if the library is self-contained, is not written in C, and does not use un-permitted features, you can just put the library in site-packages inside web2py and it will upload with your app. On Thursday, March 15, 2012 5:56:49 AM UTC-7, Udi Milo wrote: > > I found the problem (which leads to a new

Re: [web2py] Modules on Google App Engine

2012-03-15 Thread Bruno Rocha
It is not possible on gae. You have to change your app to use urllib or fetch http://zerp.ly/rochacbruno Em 15/03/2012 09:56, "Udi Milo" escreveu: > I found the problem (which leads to a new problem). > my module was using "import requests" > requests is http://docs.python-requests.org/en/v0.10.

Re: [web2py] Modules on Google App Engine

2012-03-15 Thread Udi Milo
I found the problem (which leads to a new problem). my module was using "import requests" requests is http://docs.python-requests.org/en/v0.10.7/index.html that I have installed on my machine. I guess I need to tell web2py to install it when it deploys. do you know how I do that? and if its not p

Re: [web2py] Modules on Google App Engine

2012-03-14 Thread Jonathan Lundell
On Mar 14, 2012, at 8:32 PM, Bruno Rocha wrote: > I guess your module is trying to do something denied in GAE, some python std > modules are not available on GAE, and also you cannot access filesystem. One thing to try would be to put the modules in site-packages, so they're in sys.path and don'

Re: [web2py] Modules on Google App Engine

2012-03-14 Thread Bruno Rocha
I guess your module is trying to do something denied in GAE, some python std modules are not available on GAE, and also you cannot access filesystem. Another common problem is incompatibility with Python2.5 Take a look at LOG tab at your google app engine admin page, may be the traceback is there

Re: [web2py] Modules on Google App Engine

2012-03-14 Thread Udi Milo
The thing is that locally, it works. only when I deploy to GAE it is missing... which files do you recommend I look into to try and find the reason for this weird problem? On Tuesday, March 13, 2012 5:32:52 PM UTC-4, rochacbruno wrote: > > Maybe you have a syntax error or an error with imports i

Re: [web2py] Modules on Google App Engine

2012-03-13 Thread Bruno Rocha
Maybe you have a syntax error or an error with imports inside the api module, the web2py custom importer does not shows complete traceback for that cases. On Tue, Mar 13, 2012 at 10:48 AM, Udi Milo wrote: > Hi all, > > I've added a new api.py file to the /modules directory. > I've also added a c

[web2py] Modules on Google App Engine

2012-03-13 Thread Udi Milo
Hi all, I've added a new api.py file to the /modules directory. I've also added a call from my default.py "from api import Api" working locally, everything is fine. when deploying to GAE, I get No module named api can anyone suggest an answer to my problem?

[web2py] Modules: how to access db

2012-02-09 Thread Johann Spies
I am not ready with this project to try out Bruno's way of setting up a database using modules and not models. But I want to be able to do something like this in a module: def number_or_records(table): count = db(db[table]).count() -- Because experiencing your loyal love is

[web2py] Modules in modules folder don't reload

2011-11-22 Thread Vinicius Assef
I lost some time this afternoon fighting against a bug that was already solved, but I didn't see it working. I'm importing a python module in myapp/modules folder. Changes I made there wasn't saw in browser processing. The only way to make it work was restarting web2py server. Is there any confi

[web2py] Re: Now we can run web2py modules on PiCloud

2011-09-27 Thread Massimo Di Pierro
This is fantastic. Did you try it? On Sep 26, 11:36 pm, Bruno Rocha wrote: > Interesting... we can run web2py as a package in PiCloud > >      picloud.com | visit the > blog| > twitter | > unsubscribe

[web2py] [tip] Now we can run web2py modules on PiCloud

2011-09-26 Thread Bruno Rocha
Interesting... we can run web2py as a package in PiCloud picloud.com | visit the blog| twitter | unsubscribe

[web2py] modules and plugins

2011-09-13 Thread Christopher Baron
Hi web2py users, Let's say I have a lot of functions that I would like to include into a plugin. I do not want all of these functions in the controller of the plugin. What's the best way to include a large number of utility functions into a plugin ? Thanks in advance, Chris

[web2py] Re: import of web2py modules very complicated

2010-06-18 Thread pierreth
OK, Thank you for the explanation Massimo. I thought there is package called 'modules' in my web2py application directory so I can put my modules there and import them with 'import'. It is the natural way of doing thing. Now I understand the limitations you are facing.

[web2py] Re: import of web2py modules very complicated

2010-06-17 Thread mdipierro
t any NORMAL python module, put it in > > site packages and import it using normal python syntax. > > > If you want to import "web2py modules", i.e. modules that belong to a > > specific application only, then you have to follow the rules and not > > all modules

[web2py] Re: import of web2py modules very complicated

2010-06-16 Thread pierreth
On 14 juin, 08:11, mdipierro wrote: > It depends. If you want to import any NORMAL python module, put it in > site packages and import it using normal python syntax. > > If you want to import "web2py modules", i.e. modules that belong to a > specific application only, th

[web2py] Re: import of web2py modules very complicated

2010-06-14 Thread mdipierro
It depends. If you want to import any NORMAL python module, put it in site packages and import it using normal python syntax. If you want to import "web2py modules", i.e. modules that belong to a specific application only, then you have to follow the rules and not all modules can be imp

[web2py] Re: import of web2py modules very complicated

2010-06-13 Thread pierreth
On 13 juin, 17:54, Jonathan Lundell wrote: > Try local_import instead of import (same manual page). OK :-) I needed that to fix the warning of Pydev. Now I use a template like that at beginning of mvc files: # Fake the imports needed by the static code analyzer. if False: import gluon.langu

Re: [web2py] import of web2py modules very complicated

2010-06-13 Thread Jonathan Lundell
On Jun 13, 2010, at 4:46 PM, pierreth wrote: > I found that importing modules in Web2py seems to be very complex: > > http://web2py.com/book/default/section/4/18 > > I have a module in 'modules' and I do 'import modules.my_module' to > import the module in my application. > > This is working fi

[web2py] import of web2py modules very complicated

2010-06-13 Thread pierreth
I found that importing modules in Web2py seems to be very complex: http://web2py.com/book/default/section/4/18 I have a module in 'modules' and I do 'import modules.my_module' to import the module in my application. This is working fine with Eclipse Pydev because I have setup the Python path for

[web2py:33138] Re: can you use web2py modules in python script?

2009-10-19 Thread Sebastian Brandt
ed in the base path of the > > installation? > > > Greets > > > Sebastian > > > On 19 Okt., 03:24, Mico Siahaan wrote: > > > > Hi Sebastian, you need to put gluon in python path. > > > > Regards, > > > Mico > > > > On

[web2py:33125] Re: can you use web2py modules in python script?

2009-10-18 Thread mdipierro
n? > > Greets > > Sebastian > > On 19 Okt., 03:24, Mico Siahaan wrote: > > > Hi Sebastian, you need to put gluon in python path. > > > Regards, > > Mico > > > On 10/19/09, Sebastian Brandt wrote: > > > > Hi everyone, > > > >

[web2py:33116] Re: can you use web2py modules in python script?

2009-10-18 Thread Sebastian Brandt
> > > > > Hi everyone, > > > is it possible to use the web2py modules in a python script? > > > I plan to write a script which shall write stuff that is passed to it > > in a database and I want to use the web2py DAL for that because it is > > just awesome.

[web2py:33115] Re: can you use web2py modules in python script?

2009-10-18 Thread mdipierro
-S youapp -M -R yourscript Massimo On Oct 18, 8:24 pm, Mico Siahaan wrote: > Hi Sebastian, you need to put gluon in python path. > > Regards, > Mico > > On 10/19/09, Sebastian Brandt wrote: > > > > > > > Hi everyone, > > > is it possible to use th

[web2py:33114] Re: can you use web2py modules in python script?

2009-10-18 Thread Mico Siahaan
Hi Sebastian, you need to put gluon in python path. Regards, Mico On 10/19/09, Sebastian Brandt wrote: > > Hi everyone, > > is it possible to use the web2py modules in a python script? > > I plan to write a script which shall write stuff that is passed to it > in a datab

[web2py:33113] can you use web2py modules in python script?

2009-10-18 Thread Sebastian Brandt
Hi everyone, is it possible to use the web2py modules in a python script? I plan to write a script which shall write stuff that is passed to it in a database and I want to use the web2py DAL for that because it is just awesome... I tried to import the modules but I get errors that there is no