Re: [web2py] Web2py Windows edition with 3.x Interpreter

2019-06-14 Thread Nico Zanferrari
Hi Dave, I think that rāma meant that he used a Windows system with the same Python version as the one in a already frozen web2py program in order to install modules inside it. AFAIK he didn't use a pip program inside a frozen web2py. See this howto page

[web2py] Re: Web3py

2019-06-14 Thread 黄祥
cache on select not work, modify apps/todo/api, cacheable=True is work without defining cache *apps/todo/__init__.py* @action('api') # a GET API function @action.uses(db)# all before starting a db connection def todo(): cache_time_expire = 10 cache_

[web2py] Re: Datatables serverside JSON/Ajax

2019-06-14 Thread Jim S
I believe you are confusing a couple things here. The code you're using is trying to use a server-side data set, but the data:{{=results}}, is using the results passed to the view as the data to display, not the data you're getting back from the ajax call. I'll try to make some time later th

[web2py] Re: Web3py

2019-06-14 Thread Massimo Di Pierro
Be careful that you can no longer change attributes everywhere you like as in: db.tablename.fieldname.readable = False In web2py this is ok. In web3py this is not safe. Attributes must be global. The state of fixtures must not be modified inside actions. On Thursday, 13 June 2019 17:57:49 UTC-

[web2py] Re: Web3py

2019-06-14 Thread Massimo Di Pierro
Try replace cache with cache2 = lambda key, f, expiration: cache.get(key,f, expiration) cache_db = (cache2, cache_time_expire) On Friday, 14 June 2019 03:32:53 UTC-7, 黄祥 wrote: > > cache on select not work, modify apps/todo/api, cacheable=True is work > without defining cache > *apps/todo/__in

Re: [web2py] Re: Web3py FORM referenced fields

2019-06-14 Thread Massimo Di Pierro
Thanks. That clarifies. Will fix later today. On Wednesday, 12 June 2019 23:25:26 UTC-7, John Bannister wrote: > > Hi Massimo, > > > > Issue is not the dropdown for referenced fields on an Add rec as that > works fine. Issue is when you want to edit a record with a referenced field > so > >

[web2py] Re: Datatables serverside JSON/Ajax

2019-06-14 Thread Cristina Sig
Thank you @Jim. I will appreciate if you can share some example because I have been struggling with this for weeks and I'm really confused with ajax and server side. El viernes, 14 de junio de 2019, 9:39:14 (UTC-3), Jim S escribió: > > I believe you are confusing a couple things here. The code

Re: [web2py] Web2py Windows edition with 3.x Interpreter

2019-06-14 Thread rāma
Hi Dave, Nico is right here. I used pip to pre-package modules for easier distribution. Not really a DLL but works. The only downside is that distributing the app can be really large. On Friday, 14 June 2019 00:31:50 UTC+8, Dave S wrote: > > > > On Monday, April 29, 2019 at 8:15:09 PM UTC-7, rā

Re: [web2py] Re: Datatables serverside JSON/Ajax

2019-06-14 Thread Jim Steil
I've attached the 'packed' file of the app. The app: -uses your table setup (I took the uppercase characters out of your table names - I'm not preaching, but in my experience you don't want to do this) -puts some test data into the degree table -added a page to list the degrees using datatables.n

Re: [web2py] Re: Datatables serverside JSON/Ajax

2019-06-14 Thread Cristina Sig
Thank you @Jim, I will test it out this evening and let you know if I have any questions or doubts about it :) El viernes, 14 de junio de 2019, 13:16:32 (UTC-3), Jim S escribió: > > I've attached the 'packed' file of the app. > > The app: > > -uses your table setup (I took the uppercase character

[web2py] 2 domains for 2 apps on 1 web2p

2019-06-14 Thread Vlad
I've had multiple apps in one web2py with no problems, of course, but only up to the point I've assigned different domains to different apps I am on PythonAnywhere, but presumably it's the same issue on any hosting. I am giving 2 cnames for 2 apps, and I pointed both cnames properly. BUT only

[web2py] Re: 2 domains for 2 apps on 1 web2p

2019-06-14 Thread Vlad
let me be a bit more specific, as my problem is apparently in missing something very basic: here is a quote from PythonAnywhere docs: "...for each additional domain name, you need to set up another PythonAnywhere web app from the web tab. This time though, you should choose "manual configuratio

[web2py] Re: 2 domains for 2 apps on 1 web2p

2019-06-14 Thread Jim S
My production routes.py has this in it: routers = dict(BASE=dict(domains={'www.domain1.com': 'app1', 'www.domain2.com': 'app2'})) -Jim On Friday, June 14, 2019 at 1:47:22 PM UTC-5, Vlad wrote: > > let me be a bit more specific, as my problem is apparently in

Re: [web2py] Re: 2 domains for 2 apps on 1 web2p

2019-06-14 Thread Eliezer (Vlad) Tseytkin
Oops I didn't know that domains can be there! Thank you!! On Fri, Jun 14, 2019, 3:02 PM Jim S wrote: > My production routes.py has this in it: > > routers = dict(BASE=dict(domains={'www.domain1.com': 'app1', > 'www.domain2.com': 'app2'})) > > > > -Jim > > > On F

Re: [web2py] Re: 2 domains for 2 apps on 1 web2p

2019-06-14 Thread Jim Steil
Glad to help, this is the only way I know manage the routing, I'd forgotten about the routes_in. -Jim On Fri, Jun 14, 2019 at 2:05 PM Eliezer (Vlad) Tseytkin < westgate6...@gmail.com> wrote: > Oops I didn't know that domains can be there! > Thank you!! > > On Fri, Jun 14, 2019, 3:02 PM Jim S wr

[web2py] Re: Upgrading from 2.08 to 2.18.5

2019-06-14 Thread Jim Gregory
OK, I installed the current version of web2py on my laptop and copied over the 'init' application and a 'blog' application. I've launched the test server and opened the blog app in my browser. The main problem I'm having now is URL rewriting. Here's routes.py in my blog app: default_contro

[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

Re: [web2py] Re: Datatables serverside JSON/Ajax

2019-06-14 Thread Cristina Sig
@Jim I tried the app and it works!! but I have a question, is it possible to search through all the columns or has to be one at the time? Also, do you know if this server side method works on data bases with thousands of records or is it a bit slower? Thanks again! El viernes, 14 de junio de 2

Re: [web2py] Re: Datatables serverside JSON/Ajax

2019-06-14 Thread Jim Steil
Yes, you can search through multiple columns. I just happened to write the sample on a table with one column. The key is in building the DAL query properly. Jim On Fri, Jun 14, 2019, 6:13 PM Cristina Sig wrote: > @Jim > > I tried the app and it works!! but I have a question, is it possible to

[web2py] Re: Web3py

2019-06-14 Thread 黄祥
> > *url* = > http://localhost:8000/_dashboard/dbadmin?app=test&dbname=db&tablename=address > *result* = { "__class__": "lazyT", "kwargs": {}, "text": "Field 0", > "translator": { "__class__": "method" } } > *expected result *= Field 0 > no error occured but the result is not expected > there's

[web2py] Re: Web3py

2019-06-14 Thread 黄祥
> > Be careful that you can no longer change attributes everywhere you like as > in: > > db.tablename.fieldname.readable = False > > In web2py this is ok. In web3py this is not safe. Attributes must be > global. The state of fixtures must not be modified inside actions. > is it mean in controll

[web2py] Re: Web3py

2019-06-14 Thread Massimo Di Pierro
Does not exist because it is always lazy by default. On Friday, 14 June 2019 21:53:54 UTC-7, 黄祥 wrote: > > *url* = >> http://localhost:8000/_dashboard/dbadmin?app=test&dbname=db&tablename=address >> *result* = { "__class__": "lazyT", "kwargs": {}, "text": "Field 0", >> "translator": { "__class__

[web2py] Re: Web3py

2019-06-14 Thread Massimo Di Pierro
db.tablename.fieldname.readable = False # SAFE def test(): db.tablename.fieldname.readable = False # NOT SAFE *models.py* def on_define_tablename(table): table.fieldname.readable = False # SAFE db.define_table('tablename', Field('fieldname'), on_define = on_define_tablename) BU