[web2py] Re: Object type None error

2020-10-13 Thread T.R.Rajkumar
this is the result of the sp for amcid = 1910

unitidamcnothsktsktssktuskawgdavda
pfamtsacamtesiamt
ts2AHO20DP0529921.366008865.319458317.76000
31453.642458198133.440.001201554.585840151.72
532868.361460037.93

On Wednesday, October 14, 2020 at 10:40:53 AM UTC+5:30 T.R.Rajkumar wrote:

>
> I get this error for a particular amcid = 1910, for others it is working 
> ok. What might be the problem. The sp 
>
> usr_getconlabqty_amc_new is indeed returning row from db when checked in the 
> backend. please elucidate.
>
> Error ticket for "web_ocms" Ticket ID 
>
> 127.0.0.1.2020-10-14.10-26-27.939fd264-ebf8-4e08-aa76-2ca0d84a5703
>  'NoneType' object is not iterable Version 
> web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47 
> Python Python 2.7.5: D:\Python\python.exe (prefix: D:\Python) Traceback 
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
>
> Traceback (most recent call last):
>   File "D:\web2py\gluon\restricted.py", line 227, in restricted
> exec ccode in environment
>   File "D:/web2py/applications/web_ocms/controllers/amc.py" 
> , line 
> 407, in 
>   File "D:\web2py\gluon\globals.py", line 417, in 
> self._caller = lambda f: f()
>   File "D:/web2py/applications/web_ocms/controllers/amc.py" 
> , line 
> 247, in schII
> rowsconlab = db.executesql("exec usr_getconlabqty_amc_new 
> @amcid=?",placeholders=([amcid]),as_dict=True)
>   File "D:\web2py\gluon\packages\dal\pydal\base.py", line 1028, in executesql
> fields = colnames or [f[0] for f in columns]
> TypeError: 'NoneType' object is not iterable
>
> Error snapshot [image: help] 
> 
>  
>
> ('NoneType' object is not iterable) 
>
> inspect attributes 
> Frames 
>
>- 
>
>*File D:\web2py\gluon\restricted.py in restricted at line 227* code 
>arguments variables 
>- 
>
>*File D:\web2py\applications\web_ocms\controllers\amc.py in  
>at line 407* code arguments variables 
>- 
>
>*File D:\web2py\gluon\globals.py in  at line 417* code 
>arguments variables 
>- 
>
>*File D:\web2py\applications\web_ocms\controllers\amc.py in schII at 
>line 247* code arguments variables 
>- 
>
>*File D:\web2py\gluon\packages\dal\pydal\base.py in executesql at line 
>1028* code arguments variables 
>Function argument list 
>
>(self=, 
>query='exec usr_getconlabqty_amc_new @amcid=?', placeholders=['1910'], 
>as_dict=True, fields=None, colnames=None, as_ordered_dict=False)
>Code listing 
>
>1023.
>1024.
>1025.
>1026.
>1027.
>1028.
>
>1029.
>1030.
>1031.
>1032.
>
># Non-DAL legacy db query, converts cursor results to dict.
># sequence of 7-item sequences. each sequence tells about a 
> column.
># first item is always the field name according to Python 
> Database API specs
>columns = adapter.cursor.description
># reduce the column info down to just the field names
>fields = colnames or [f[0] for f in columns]
>
>if len(fields) != len(set(fields)):
>raise RuntimeError("Result set includes duplicate column 
> names. Specify unique column names using the 'colnames' argument")
>#: avoid bytes strings in columns names (py3)
>if columns and not PY2:
>
>Variables 
>fields None 
>colnames None 
>columns None 
>f undefined
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/df927438-f572-40ac-8db3-52ea122845cen%40googlegroups.com.


[web2py] Object type None error

2020-10-13 Thread T.R.Rajkumar

I get this error for a particular amcid = 1910, for others it is working 
ok. What might be the problem. The sp 

usr_getconlabqty_amc_new is indeed returning row from db when checked in the 
backend. please elucidate.

Error ticket for "web_ocms" Ticket ID 

127.0.0.1.2020-10-14.10-26-27.939fd264-ebf8-4e08-aa76-2ca0d84a5703
 'NoneType' object is not iterable Version 
web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47 
Python Python 2.7.5: D:\Python\python.exe (prefix: D:\Python) Traceback 

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.

Traceback (most recent call last):
  File "D:\web2py\gluon\restricted.py", line 227, in restricted
exec ccode in environment
  File "D:/web2py/applications/web_ocms/controllers/amc.py" 
, line 
407, in 
  File "D:\web2py\gluon\globals.py", line 417, in 
self._caller = lambda f: f()
  File "D:/web2py/applications/web_ocms/controllers/amc.py" 
, line 
247, in schII
rowsconlab = db.executesql("exec usr_getconlabqty_amc_new 
@amcid=?",placeholders=([amcid]),as_dict=True)
  File "D:\web2py\gluon\packages\dal\pydal\base.py", line 1028, in executesql
fields = colnames or [f[0] for f in columns]
TypeError: 'NoneType' object is not iterable

Error snapshot [image: help] 

 

('NoneType' object is not iterable) 

inspect attributes 
Frames 
   
   - 
   
   *File D:\web2py\gluon\restricted.py in restricted at line 227* code 
   arguments variables 
   - 
   
   *File D:\web2py\applications\web_ocms\controllers\amc.py in  at 
   line 407* code arguments variables 
   - 
   
   *File D:\web2py\gluon\globals.py in  at line 417* code arguments 
   variables 
   - 
   
   *File D:\web2py\applications\web_ocms\controllers\amc.py in schII at 
   line 247* code arguments variables 
   - 
   
   *File D:\web2py\gluon\packages\dal\pydal\base.py in executesql at line 
   1028* code arguments variables 
   Function argument list 
   
   (self=, 
   query='exec usr_getconlabqty_amc_new @amcid=?', placeholders=['1910'], 
   as_dict=True, fields=None, colnames=None, as_ordered_dict=False)
   Code listing 
   
   1023.
   1024.
   1025.
   1026.
   1027.
   1028.
   
   1029.
   1030.
   1031.
   1032.
   
   # Non-DAL legacy db query, converts cursor results to dict.
   # sequence of 7-item sequences. each sequence tells about a 
column.
   # first item is always the field name according to Python 
Database API specs
   columns = adapter.cursor.description
   # reduce the column info down to just the field names
   fields = colnames or [f[0] for f in columns]
   
   if len(fields) != len(set(fields)):
   raise RuntimeError("Result set includes duplicate column 
names. Specify unique column names using the 'colnames' argument")
   #: avoid bytes strings in columns names (py3)
   if columns and not PY2:
   
   Variables 
   fields None 
   colnames None 
   columns None 
   f undefined
   

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e43d24a7-2db8-44b3-ba29-e4a1f421809fo%40googlegroups.com.


[web2py] Limiting database entries

2020-10-13 Thread mostwanted
Is there a way to limit the number of entries to a database?
Like limiting the number of entries to only 100 and nothing more.

Regards;

Mostwanted 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/23c3a45f-bc13-4374-8c00-3c3689422f1dn%40googlegroups.com.


[web2py] Re: Can't import gluon.contrib.simplejson after migrating to Python 3

2020-10-13 Thread villas
I'm not sure what you should replace it with.
I think the only reason why simplejson is no longer distributed with web2py 
was that the json module became part of the standard library of python.  
Therefore,  it did not seem necessary to include it.  
However, if you wish to install simplejson for some reason,  then I don't 
think there is anything stopping you. 

On Tuesday, 13 October 2020 at 11:25:43 UTC+1 Pie wrote:

> I have the same problem as the OP.  However the function I need to replace 
> is:
> gluon.contrib.simplejson.encoder.encode_basestring
>
> What should I replace this with?
>
> On Wednesday, October 9, 2019 at 7:42:30 AM UTC-7 villas wrote:
>
>> I think we stopped using simplejson some time ago.
>>
>> Now, when you do this:
>> from gluon.contrib import simplejson
>>
>> ... this happens ... 
>> from json import *
>>
>> So, you may as well use the modules of json directly.
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/3c990181-e77d-4c04-80ad-53eb83782394n%40googlegroups.com.


[web2py] Share sessions

2020-10-13 Thread 'Annet' via web2py-users
In the model files of my applications I have these lines of code
because I want to share the session, so menus etc. reflect the
correct state and users need not login twice

# share the session cookie among all subdomains under the main domain

response.cookies[response.session_id_name]['domain'] = '.leonexus.nl'

# If you want two or more applications to share sessions, set masterapp 
# to the name of the master application.

session.connect(request, response, masterapp="controlpanel")



I wonder whether I need both lines of code or just one of them, and whether
there is a specific order to place them in.


Kind regards,

Annet

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/57ec480c-042d-4679-93ee-4460b633fbdan%40googlegroups.com.


[web2py] Re: Can't import gluon.contrib.simplejson after migrating to Python 3

2020-10-13 Thread Pie
I have the same problem as the OP.  However the function I need to replace 
is:
gluon.contrib.simplejson.encoder.encode_basestring

What should I replace this with?

On Wednesday, October 9, 2019 at 7:42:30 AM UTC-7 villas wrote:

> I think we stopped using simplejson some time ago.
>
> Now, when you do this:
> from gluon.contrib import simplejson
>
> ... this happens ... 
> from json import *
>
> So, you may as well use the modules of json directly.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/453c6fde-e272-4fcd-9dd4-4092bce5f2d7n%40googlegroups.com.


[web2py] Re: web2py hosting

2020-10-13 Thread 'Annet' via web2py-users
Hi Jose,

You're right no regrets at all. Just like you I very much appreciate their 
willingness to
help you solve the problems you run into when deploying your applications.

Annet



Op dinsdag 13 oktober 2020 om 08:51:21 UTC+2 schreef Jose C:

> Hi Annet,  
>
> Just FYI, I'm going on 18 months now with Opalstack and couldn´t be 
> happier.  Running multiple web2py (and other) apps on servers in US and EU, 
> hosted email, etc. with the same access and levels of control I'd had on 
> WF.  And most importantly, always the same incredible customer focus and 
> willingness to help that originally made WF famous, that is, until their 
> encounter with the Borg/GD  ;)
>
> I doubt you'll have any regrets,
>
> Jose
>
>
>
>
> On Saturday, 10 October 2020 at 17:07:20 UTC+1 Annet wrote:
>
>> Hi Antonio,
>>
>> I came across your post, and thought I'd share my experience with 
>> Opalstack.
>>
>> I am a web developer not a server administrator, I hosted at Webfaction 
>> because their
>> support people were very patient and helpful. After joining forces with 
>> GD support no
>> longer stands out from the crowd.
>>
>> Last week I signed up with Opalstack, https://www.opalstack.com/ and I 
>> am glad I did, 
>> great support and a simple but powerful control panel. One of the former 
>> WF support 
>> people wrote a web2py install script which got me up and running in no 
>> time.
>>
>> Hope this was helpful,
>>
>> Annet V.
>>
>> Op vrijdag 22 mei 2020 om 09:45:12 UTC+2 schreef Ramos:
>>
>>> I´m a webfaction long time user and from another post here i got worried 
>>> about the godaddy acquisition.Eventually webfaction may die in a short term 
>>> period.
>>>
>>> Can you recommend a good alternative? 
>>> Can you share your experience?
>>>
>>> Opalstack
>>> pythonanywhere
>>>
>>> others ?
>>>
>>> regards
>>> António
>>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/349b3852-ff30-4416-b2c1-ff1466736f9bn%40googlegroups.com.