Re: [web2py] Re: ldap import problem

2015-08-24 Thread Johann Spies
Thanks Richard and Massimo for your replies.

Version 2.12.3-stable+timestamp.2015.08.18.19.14.07


Massimo, there is nothing in modules - only __init__.py

This is a new app.

Regards
Johann

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Getting cannot import name table_field after upgrading to 2.12.3

2015-08-24 Thread Rahul
Hi All,
   Recently I upgraded to version 2.12.3 and  I am getting this type 
exception  - I am using Plugin solidtable -  Is there something that needs 
to be done differently or something that needs to be changed? Please 
suggest - Note: On version 2.9.5 it used to working just fine. 

 cannot import name table_field

  File "D:/web2py2.12.3/web2py/web2py/applications/AHM/models/db.py" 
, line 26, in 

from plugin_solidtable import SOLIDTABLE
  File "D:\web2py2.12.3\web2py\web2py\gluon\custom_import.py", line 95, in 
custom_importer
return base_importer(pname, globals, locals, fromlist, level)
  File "applications\AHM\modules\plugin_solidtable.py", line 5, in 
from gluon.sqlhtml import table_field, represent, Row
ImportError: cannot import name table_field

Please suggest - Rahul 


-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Getting cannot import name table_field after upgrading to 2.12.3

2015-08-24 Thread Johann Spies
I had similar problems which convinced me to to stop using solidtable.

Regards
Johann


-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] folders structure for ajax requests

2015-08-24 Thread Dmitri Ermolaev
If I use ajax - it willl load all in /model - menus too

but for what?

ajax requests need in db + settings - and not need in menu

My idea: - make separate folder /menus - it will be laded as layout.html

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: ldap import problem

2015-08-24 Thread Massimo Di Pierro
So the problem is that it cannot import ldal. Do you know it works from the 
normal python shell?

>>> import ldap

Does it work from the web2py shell?


On Monday, 24 August 2015 02:13:25 UTC-5, Johann Spies wrote:
>
> Thanks Richard and Massimo for your replies.
>
> Version 2.12.3-stable+timestamp.2015.08.18.19.14.07
>
>
> Massimo, there is nothing in modules - only __init__.py
>
> This is a new app.  
>
> Regards
> Johann
>
>

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Getting cannot import name table_field after upgrading to 2.12.3

2015-08-24 Thread Paolo Valleri
see also https://github.com/kenji4569/sqlabs/issues/68

On Monday, August 24, 2015 at 3:23:24 PM UTC+2, Johann Spies wrote:
>
> I had similar problems which convinced me to to stop using solidtable.
>
> Regards
> Johann
>
>
> -- 
> Because experiencing your loyal love is better than life itself, 
> my lips will praise you.  (Psalm 63:3)
>

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: folders structure for ajax requests

2015-08-24 Thread Derek
put it in modules and import modules as you need them.

On Monday, August 24, 2015 at 6:39:10 AM UTC-7, Dmitri Ermolaev wrote:
>
> If I use ajax - it willl load all in /model - menus too
>
> but for what?
>
> ajax requests need in db + settings - and not need in menu
>
> My idea: - make separate folder /menus - it will be laded as layout.html
>

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLFORM.grid shows ids instead of names only in Linux

2015-08-24 Thread Antonio Salazar
Upgrading to 2.12.3-stable+timestamp.2015.08.19.00.18.03 solved the problem.
I guess the moral of the history is "Always use the same framework version 
in production and development".

On Saturday, August 22, 2015 at 7:07:07 PM UTC-5, Massimo Di Pierro wrote:
>
> please try and let us know.
>
> On Friday, 21 August 2015 16:31:25 UTC-5, Antonio Salazar wrote:
>>
>> The web2py versions are different
>>
>> The working one (development) is 
>> 2.11.2-stable+timestamp.2015.05.30.16.33.24
>> The non-working one (production) is 
>> 2.10.3-stable+timestamp.2015.04.02.21.42.07
>>
>> I could try upgrading both to 2.12.3
>>
>> On Friday, August 21, 2015 at 4:24:33 PM UTC-5, Antonio Salazar wrote:
>>>
>>> My application shows integer ids instead of names for any table I update 
>>> using SQLFORM.grid().
>>> It's running a source installation on Apache2 on Linux.
>>> The database is PostgreSQL on Windows.
>>>
>>> Using the same application on the integrated web server in Windows shows 
>>> the names correctly.
>>> I'm using PostgreSQL on the same Windows server.
>>>
>>> My databases are declared like this:
>>>
>>> db = DAL('postgres:psycopg2://user:password@server/database', pool_size=10)
>>> dblog = DAL('postgres:psycopg2://user:password@server/database_log', 
>>> pool_size=10)
>>>
>>>
>>> This is perplexing me.
>>>
>>

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLFORM.grid shows ids instead of names only in Linux

2015-08-24 Thread 黄祥
that's why there is configuration management software (puppet, chef, etc). 
we usually use it for environment separation purpose, like development 
(same like testing environment, but put it on the developer or engineer 
comp), testing (put it on server for testing purpose by system analist, 
etc), staging (after testing done with no bugs occured, and put it on 
several days till week to monitor before goes to production environment) 
and production environment.

best regards,
stifan

On Monday, August 24, 2015 at 10:36:29 PM UTC+7, Antonio Salazar wrote:
>
> Upgrading to 2.12.3-stable+timestamp.2015.08.19.00.18.03 solved the 
> problem.
> I guess the moral of the history is "Always use the same framework version 
> in production and development".
>
> On Saturday, August 22, 2015 at 7:07:07 PM UTC-5, Massimo Di Pierro wrote:
>>
>> please try and let us know.
>>
>> On Friday, 21 August 2015 16:31:25 UTC-5, Antonio Salazar wrote:
>>>
>>> The web2py versions are different
>>>
>>> The working one (development) is 
>>> 2.11.2-stable+timestamp.2015.05.30.16.33.24
>>> The non-working one (production) is 
>>> 2.10.3-stable+timestamp.2015.04.02.21.42.07
>>>
>>> I could try upgrading both to 2.12.3
>>>
>>> On Friday, August 21, 2015 at 4:24:33 PM UTC-5, Antonio Salazar wrote:

 My application shows integer ids instead of names for any table I 
 update using SQLFORM.grid().
 It's running a source installation on Apache2 on Linux.
 The database is PostgreSQL on Windows.

 Using the same application on the integrated web server in Windows 
 shows the names correctly.
 I'm using PostgreSQL on the same Windows server.

 My databases are declared like this:

 db = DAL('postgres:psycopg2://user:password@server/database', pool_size=10)
 dblog = DAL('postgres:psycopg2://user:password@server/database_log', 
 pool_size=10)


 This is perplexing me.

>>>

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLFORM.grid shows ids instead of names only in Linux

2015-08-24 Thread Antonio Salazar
For now, I'm happy learning the quirks of web2py before trying learn the 
quirks of a configuration management tool.

I've been hearing a lot of good things about configuration management, 
though. I'd like to at least setup a proof of concept before our linux vms 
become unwieldy. Thanks for the advice.

On Monday, August 24, 2015 at 4:46:20 PM UTC-5, 黄祥 wrote:
>
> that's why there is configuration management software (puppet, chef, etc). 
> we usually use it for environment separation purpose, like development 
> (same like testing environment, but put it on the developer or engineer 
> comp), testing (put it on server for testing purpose by system analist, 
> etc), staging (after testing done with no bugs occured, and put it on 
> several days till week to monitor before goes to production environment) 
> and production environment.
>
> best regards,
> stifan
>
> On Monday, August 24, 2015 at 10:36:29 PM UTC+7, Antonio Salazar wrote:
>>
>> Upgrading to 2.12.3-stable+timestamp.2015.08.19.00.18.03 solved the 
>> problem.
>> I guess the moral of the history is "Always use the same framework 
>> version in production and development".
>>
>> On Saturday, August 22, 2015 at 7:07:07 PM UTC-5, Massimo Di Pierro wrote:
>>>
>>> please try and let us know.
>>>
>>> On Friday, 21 August 2015 16:31:25 UTC-5, Antonio Salazar wrote:

 The web2py versions are different

 The working one (development) is 
 2.11.2-stable+timestamp.2015.05.30.16.33.24
 The non-working one (production) is 
 2.10.3-stable+timestamp.2015.04.02.21.42.07

 I could try upgrading both to 2.12.3

 On Friday, August 21, 2015 at 4:24:33 PM UTC-5, Antonio Salazar wrote:
>
> My application shows integer ids instead of names for any table I 
> update using SQLFORM.grid().
> It's running a source installation on Apache2 on Linux.
> The database is PostgreSQL on Windows.
>
> Using the same application on the integrated web server in Windows 
> shows the names correctly.
> I'm using PostgreSQL on the same Windows server.
>
> My databases are declared like this:
>
> db = DAL('postgres:psycopg2://user:password@server/database', 
> pool_size=10)
> dblog = DAL('postgres:psycopg2://user:password@server/database_log', 
> pool_size=10)
>
>
> This is perplexing me.
>


-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Add link to view a referenced table in SQLFORM.grid

2015-08-24 Thread Thomas Sitter
I have two tables that I'd like to link in SQLFORM.grid.

db.define_table('customer',
 Field('firstname'),
 Field('lastname'),
 Field('account'))

db.define_table('survey_data',
 Field('customer_id', 'reference customer'),
 Field('Q1'),
 Field('Q2'),
 Field('Q3'))


In my SQLFORM I'd like to only show the firstname, lastname, and a link to 
view the survey_data for customers who have survey data.

def customer_view:
query=((db.customer.account > 100) & (db.customer.id==db.survey_data.
customer_id))
fields=[db.customer.firstname, db.customer.lastname]
grid=SQLFORM.grid(deletable=False, editable=False, paginate=100, query=
query, fields=fields)
return dict(grid=grid)

Is there any way to add a link to view the survey data to this table? I 
want it to work the same way that clicking 'view' on the SQLFORM.grid 
automatically brings up a formatted customer information page.

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)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Getting cannot import name table_field after upgrading to 2.12.3

2015-08-24 Thread Rahul

Thanks for getting back with replies 

For me I looked at the fix  

Added 2 lines to modules/plugin_solidtable.py

import re
table_field = re.compile('[\w_]+\.[\w_]+')


I chose to add table_field statement to _create_td(...) function, where it 
is used.
-

However I was not able to make it work. :-( 

Next up  is suggestions for a checkbox enabled table -  Does SQLForm.grid() 
suppport checkboxes for selecting multiple records and doing something with 
them (probably mass delete or mass actions like merge etc ??) 

Cheers Rahul. 

On Monday, August 24, 2015 at 8:36:27 PM UTC+5:30, Paolo Valleri wrote:
>
> see also https://github.com/kenji4569/sqlabs/issues/68
>
> On Monday, August 24, 2015 at 3:23:24 PM UTC+2, Johann Spies wrote:
>>
>> I had similar problems which convinced me to to stop using solidtable.
>>
>> Regards
>> Johann
>>
>>
>> -- 
>> Because experiencing your loyal love is better than life itself, 
>> my lips will praise you.  (Psalm 63:3)
>>
>

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: ldap import problem

2015-08-24 Thread Johann Spies
On 24 August 2015 at 16:20, Massimo Di Pierro 
wrote:

So the problem is that it cannot import ldal. Do you know it works from the
> normal python shell?
>
> >>> import ldap
>
> Does it work from the web2py shell?
>


No, I cannot import ldap. I also tried it from another app (welcome) this
time:


In [1]: import ldap
---
ImportError   Traceback (most recent call last)
/home/js/web2py/applications/welcome/models/menu.py in ()
> 1 import ldap

/home/js/web2py/gluon/custom_import.pyc in custom_importer(name, globals,
locals, fromlist, level)
 87 result = result or
sys.modules[modules_prefix+'.'+itemname]
 88 except KeyError, e:
---> 89 raise ImportError, 'Cannot import
module %s' % str(e)
 90 modules_prefix += "." + itemname
 91 return result

ImportError: Cannot import module 'applications.welcome.modules.ldap'

and the same with ldap_auth:

import ldap_auth
---
ImportError   Traceback (most recent call last)
/home/js/web2py/applications/welcome/models/menu.py in ()
> 1 import ldap_auth

/home/js/web2py/gluon/custom_import.pyc in custom_importer(name, globals,
locals, fromlist, level)
 87 result = result or
sys.modules[modules_prefix+'.'+itemname]
 88 except KeyError, e:
---> 89 raise ImportError, 'Cannot import
module %s' % str(e)
 90 modules_prefix += "." + itemname
 91 return result

ImportError: Cannot import module 'applications.welcome.modules.ldap_auth'



Regards
Johann

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Add link to view a referenced table in SQLFORM.grid

2015-08-24 Thread Anthony
Have you considered SQLFORM.smartgrid?

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.