[web2py] Re: DAL Select(fields) puzzle

2021-08-26 Thread Rob Paire
Ah! Now it makes sense - Thank you for your help. Exactly the kind of 
understanding I was looking for.

-Rob

On Wednesday, August 25, 2021 at 9:44:15 PM UTC-4 snide...@gmail.com wrote:

> On Wednesday, August 25, 2021 at 3:39:34 PM UTC-7 Rob Paire wrote:
>
>> Hi Web2py 
>> I hope someone can explains this puzzling behavior. The code below was 
>> taken from the book, and it works as given, but when I remove the  
>> "yes_or_no" condition from the field list parameters it causes 
>> a KeyError('id') error, and I don't understand why. 
>>
>>
>> *condition = db.person.name.startswith('B')*
>> *yes_or_no = condition.case('Yes', 'No')*
>> *rows = db(db.person.name  == 
>> 'Bob').select(db.person.name ,yes_or_no 
>> ).as_dict()  *
>> *rows = db(db.person.name  == 
>> 'Bob').select(db.person.ALL).as_dict()  *
>> *## the two select examples above works as expected*
>>
>> *rows = db(db.person.name  == 
>> 'Bob').select(db.person.name ).as_dict()  *
>> This last example in red throws a KeyError('id') error when trying to 
>> name specific fields, but  works fine when returning ALL fields, or when a 
>> condition is specified.
>>
>
> I don't have a complete answer, but it's the as_dict() that throws the 
> error, because it's looking for a key that isn't there.  If you do 
> for row in rows:
>   print row
>  you see that row doesn't have "id" as a key; it only has 'name' as a 
> key.  as_dict() and as_list() must have a requirement for an id field, and 
> if you make your select
> rows = db(db.person.name == 'Bob').select(db.person.name
> ,db.person,id).as_dict()
> it should work as expected.
> [The requirement isn't mentioned in the book]
>
> /dps
>
>

-- 
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/3dd9af09-ead6-4054-9939-678989de26ffn%40googlegroups.com.


[web2py] Re: 1054, "Unknown column in 'field list'... Help me

2021-08-26 Thread pa...@cancamusa.net
It's also important to use fake_migrate_all=True, besides fake_migrate=True 
and migrate=True.

On Thursday, July 29, 2021 at 1:15:11 PM UTC+2 pa...@cancamusa.net wrote:

> My problem came from importing a sql database backup. I had to checkout 
> the version which was used to make that backup, then update the code and 
> trust the web2py migrations, which worked, then make a new backup for the 
> test data.
> Regards
>

-- 
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/756af4ef-5f4a-4b84-8c74-ada080301426n%40googlegroups.com.


Re: [web2py] Internal Server Error 500 when doing medium to heavy data processing

2021-08-26 Thread Jirawat Kusolpreedee
Try increasing timeout

On Thu, Aug 26, 2021, 18:34 Davidiam  wrote:

> Version
>
> 2.18.5-stable+timestamp.2019.04.08.04.22.03
> (Running on Microsoft-IIS/10.0, Python 3.6.8)
>
> Hello,
>
> We have been using web2py for a couple of years with very few issues, but
> lately we have been getting *Internal Server Error 500 *error messages
> when certain scripts are called.  These scripts due some relatively heavy
> processing.
>
> I am not sure if this is related to web2py or purely a server, resource or
> network problem but I thought that someone here may have had similar issues
> and can recommend some configuration change to remedy this.
>
> Kind Regards,
>
> David
>
> --
> 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/7e70675f-7887-4b8a-964c-95e3a3d759c4n%40googlegroups.com
> 
> .
>

-- 
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/CAFLP1QFJT1Zk%3Do0i-aTC1Yoq-wkj5cir9sVf4HLMfq_%2Bce1ahQ%40mail.gmail.com.


[web2py] Internal Server Error 500 when doing medium to heavy data processing

2021-08-26 Thread Davidiam
Version

2.18.5-stable+timestamp.2019.04.08.04.22.03
(Running on Microsoft-IIS/10.0, Python 3.6.8)

Hello,

We have been using web2py for a couple of years with very few issues, but 
lately we have been getting *Internal Server Error 500 *error messages when 
certain scripts are called.  These scripts due some relatively heavy 
processing.

I am not sure if this is related to web2py or purely a server, resource or 
network problem but I thought that someone here may have had similar issues 
and can recommend some configuration change to remedy this.

Kind Regards, 

David

-- 
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/7e70675f-7887-4b8a-964c-95e3a3d759c4n%40googlegroups.com.