[web2py] Re: ImportError with packages in site-packages.

2018-03-29 Thread AlighaThor
And yes...I restarted the server several times without any effect. The same ImportError excepction. -- 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 r

[web2py] Re: ImportError with packages in site-packages.

2018-03-29 Thread AlighaThor
Hi. Thanks for anwser. Well, I was trying to import "requests" in PythonAnywhere. I found that they have it pre-installed (I did'nt know). So, problem solved by now. I could'nt import the standalone request package inside site-packages or the app specific "modules" directory neither. El jueves,

[web2py] Re: How could I create a validator to show the field based on the membership?

2018-03-29 Thread 黄祥
*pls try (not tested)* has_membership_admin = 'Admin' in set(auth.user_groups.values() ) db.table.field.readable = has_membership_admin or has_membership_admin = 'Admin' in set(auth.user_groups.values() ) db.table.field.show_if = has_membership_admin best regards, stifan -- Resources: - http://

[web2py] How could I create a validator to show the field based on the membership?

2018-03-29 Thread greenpoise
Is it possible to create a validator (in this case readable) only if the user belongs to a specific membership?? -- 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 Issue

Re: [web2py] on delete event callbacks and versioned tables

2018-03-29 Thread Richard Vézina
They are intent to be used to specify something before or after the delete... I mean even if there is no "pure" deletion occuring your record doesn't exist anymore for the end user once you "deleted" it even if versioning mechanism keep trace of it for the purpose of the audit trail integrity... D

[web2py] Re: How to select a table and represent the foreign key values

2018-03-29 Thread Greenpoise
sorry if you copied and pasted my solution, it had a typo. This worked for me: db.define_table('table1', Field('field_1'), format='%(field_1)s') db.define_table('table2', Field('field_1', 'reference table1'), Field('field_2', 'string'),

[web2py] Re: ImportError with packages in site-packages.

2018-03-29 Thread Leonel Câmara
The application's modules folder is the last place the importer looks that's why you get the error there. Have you restarted web2py after putting requests in the site-packages folder? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (

[web2py] Re: How to select a table and represent the foreign key values

2018-03-29 Thread LoveWeb2py
I found that by adding db.table2.field_1.represent = lambda id, row: db.table1(row.field_1).field_1 db(db.table1).select().render() It accomplishes the task. Thank you so much! On Thursday, March 29, 2018 at 1:56:14 PM UTC-4, LoveWeb2py wrote: > > Thank you so much for your help. > > db.table2.f

[web2py] Re: How to select a table and represent the foreign key values

2018-03-29 Thread LoveWeb2py
Thank you so much for your help. db.table2.field_1.requires = IS_IN_DB (db,db.table_1.field_1, '%(field_1)s') rows = db(db.table1).select() rows shows db.table1 = 1 and not 'some_value' Unfortuantely still does not work. I am running pyDal on

[web2py] Re: How to select a table and represent the foreign key values

2018-03-29 Thread Greenpoise
Like this, in the model: db.define_table('table1', Field('field_1'), format='%(field_1)s') db.define_table('table2', Field('field_1', 'reference table1'), Field('field_2', 'string), format='%(field_1)s') db.table2.field_1.requir

[web2py] Re: How to select a table and represent the foreign key values

2018-03-29 Thread Greenpoise
db.table2.field_1.requires = IS_IN_DB (db,db.table_1.field_1,'%(field_1)s') On Thursday, March 29, 2018 at 9:20:34 AM UTC-7, LoveWeb2py wrote: > > > How can I select a foreign key and represent the value? I want to > represent the entire gr

[web2py] Re: How to select a table and represent the foreign key values

2018-03-29 Thread LoveWeb2py
Do I define that in the model.py file? Can I do it before the query? On Thursday, March 29, 2018 at 12:28:02 PM UTC-4, Greenpoise wrote: > > db.table2.field_1.requires = IS_IN_DB > (db,db.table_1.field_1,'%(field_1)s') > > > On Thursday, March

[web2py] How to select a table and represent the foreign key values

2018-03-29 Thread LoveWeb2py
How can I select a foreign key and represent the value? I want to represent the entire group and now have to do individual queries for each foreign key. Is that possible? db.define_table('table1', Field('field_1'), format='%(field_1)s') db.define_table('table2',

[web2py] ImportError with packages in site-packages.

2018-03-29 Thread AlighaThor
Hi! I'm stuck importing packages within site-packages (the web2py one). I'm trying to import the Request library: Ticket ID 127.0.0.1.2018-03-29.10

[web2py] on delete event callbacks and versioned tables

2018-03-29 Thread Manuele Pesenti
Are actually _before_delete and _after_delete callbacks called on record delete event even if on versioned tables? I mean on versioned tables records are just updated from is_active True to False and not really deleted... right? So what is in thees cases the called list of callback function?

Re: [web2py] btn-default

2018-03-29 Thread andfae
Ok...now there is web2py-bootstrap4 in the last version. But, doesn't matter, here I cannot modify nothing because thisi is a jquery instruction to addClass. This is not the definition of the class itself. 2018-03-28 21:01 GMT+02:00 Dave S : > > > On Wednesday, March 28, 2018 at 11:43:00 AM UTC-