[web2py] Communication error when saving in admin web interface

2019-11-06 Thread Davidiam
Windows server 2016, IIS 10, Windows 10, Edge

Version

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

A few of our developers have been experiencing this so I thought I would 
ask the forum for help.
 
If we edit a file in the web2py admin console, we often get a red 
communication error in the "Last saved on" field.

I did some testing and I noticed that this happens pretty consistently if I 
save after about 90 seconds. It is almost as though the editing session 
times out.  
After a refresh of the page in the Edge web browser I can again do saves.

If I save every 10 or 20 seconds, the saves are successful. 

Has anyone else noticed this issue?  Or even better, is there a solution to 
this problem?

I do not find any logging for this error.

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/d6e83d7f-70f0-44cc-bc80-787c8fd809a9%40googlegroups.com.


[web2py] Re: Example in Celery for scheduling in py4web ?

2019-11-06 Thread Ruslan Gareev
There is no special context in py4web that may be different from standart 
python modules context. So any examples for celery will fit to py4web with 
minimal changes for your app context.

Web2py have this own workflow and that make Massimo to create web2py's own 
scheduler.

среда, 6 ноября 2019 г., 18:19:44 UTC+5 пользователь Marcelo Huerta написал:
>
> El miércoles, 6 de noviembre de 2019, 1:59:06 (UTC-3), Ruslan Gareev 
> escribió:
>>
>> Hello. You can google something like: "python celery queue". :)
>>
>
> Har har. I wanted an example specifically in the context of *py4web* 
> because I cannot make sense of them seeing them in other contexts.
>  
>
>> But using Dramatiq  will be better 
>> option than Celery.
>>
>
> I will take a look. Hopefully their examples would be easier to 
> understand, I know now that asking here will only produce mockery.
>
> Lovely group!
>
>

-- 
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/941a7a6e-6147-43c9-89a6-a43eb8016d5e%40googlegroups.com.


[web2py] Distinct by field don't work for firebird

2019-11-06 Thread Константин Комков
Hello!
db().select(db.tt_on_day.TIMETABLE_ID,distinct=db.tt_on_day.TIMETABLE_ID)
>>>SELECT DISTINCT ON (tt_on_day.TIMETABLE_ID) tt_on_day.TIMETABLE_ID FROM 
tt_on_day

with True - work
db().select(db.tt_on_day.TIMETABLE_ID,distinct=True)
>>>SELECT DISTINCT tt_on_day.TIMETABLE_ID FROM tt_on_day

And I don't understand one more thing. If I do query like that:
rows = db((db.t_fac.FULL_NAME != 'НЕИДЕНТИФИЦИРОВАННОЕ') &
  (db.a_groups.FO == 1) &
  (db.a_groups.INACTIVE == 0)).select(db.t_fac.id,db.t_fac.
FULL_NAME,distinct=True,
  join=[db.a_groups.on(db.
tt_main.GROUP_ID == db.a_groups.id),
db.t_fac.on(db.
a_groups.FAC == db.t_fac.id)])
Then I want to get id and FULL_NAME in circle:
faculties = {}

for row in rows:
faculties[row.t_fac.id] = row.t_fac.FULL_NAME
but I have error, becouse row is dict now and I should write:
for row in rows:
faculties[row['id']] = row['FULL_NAME']
Why row type is dict?

-- 
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/29fbd8a1-93df-4467-a0cf-87e099edf919%40googlegroups.com.


[web2py] Re: Redis session error - latest web2py master

2019-11-06 Thread Jim S
Same here.  I've reported and submitted a fix but it was rejected.  It 
worked for all of our use cases.

On Wednesday, November 6, 2019 at 9:19:07 AM UTC-6, Leonel Câmara wrote:
>
> We also got this bug when we tried to upgrade to the latest web2py and had 
> to rollback. We were using the old 2.X pyredis and then tried with 3.X you 
> get the same problem with both. Please report this issue in github, if no 
> one fixes it we will probably end up fixing it as we also need this fix.
>

-- 
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/fac1d3b8-fc02-4e63-8d73-d8b8ad06a77d%40googlegroups.com.


[web2py] Re: Example in Celery for scheduling in py4web ?

2019-11-06 Thread Dave S


On Wednesday, November 6, 2019 at 5:19:44 AM UTC-8, Marcelo Huerta wrote:
>
> El miércoles, 6 de noviembre de 2019, 1:59:06 (UTC-3), Ruslan Gareev 
> escribió:
>>
>> Hello. You can google something like: "python celery queue". :)
>>
>
> Har har. I wanted an example specifically in the context of *py4web* 
> because I cannot make sense of them seeing them in other contexts.
>

I have only skimmed through the celery information so far, but it sounds to 
me like you write a module the same way [devil in the details] that you 
write a scheduler module for web2py.   It's worth discussing whether you 
use redis for front and back ends around celery, or rabbitmq in front.  
Import your models as needed to talk to the app's database.
 

>  
>
>> But using Dramatiq  will be better 
>> option than Celery.
>>
>
> I will take a look. Hopefully their examples would be easier to 
> understand, I know now that asking here will only produce mockery.
>

If you think that you've been mocked here, I'm sorry.  This group has never 
been one for mockery or for in-fighting.  I say that as someone who comes 
here for help, but shares what I can help others with.


> Lovely group!
>
>
It is.  An oasis.  Compare list.postfix.users, where many posts aren't even 
answered.

/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/4aa831da-3e46-4e7f-afb6-b8c2e3f35142%40googlegroups.com.


Re: [web2py] How to filter a referenced field in a for

2019-11-06 Thread Massimiliano
Try with:

Is_empty_or(is_in_db(...))

Il giorno mer 6 nov 2019 alle 15:34 Steve  ha scritto:

> Hi,
>
> I have a SQLFORM which has 2 fields referenced all to another Product
> table.
> In this form you can select 1 or more products but only first is
> mandatory, the other one is optional.
>
> The problem i have is that i don't want all the products in the dropdown
> list but only the products which are for example are in stock, the others i
> don't want in the list.
> For the mandatoy field , i don't have an issue because i use
> "requires=IS_IN_DB(..."
>
> But for the other fields, which are not mandatory, i am not able to filter
> the dropdown list, if i use IS_IN_DB that yoou have to fill in the form
> field , but as said i would like to leave second product selection optional
>
> Can anyone help me on my way.
>
> db.define_table('werkgroep',
> Field('omschrijving', requires=IS_NOT_EMPTY()),
> Field('product1',requires = IS_IN_DB(db(db.product.stock
> <> 1), db.product, '%(first_name)s %(last_name)s'), label=T('Product 1')),
> Field('product2',db.product, label=T('Practitioner 2'))
> )
>
> db.define_table('product',
> Field('name',requires=IS_NOT_EMPTY()),
> Field('stock', 'integer', requires=IS_NOT_EMPTY()
> )
>
> Hope you can help me,
>
> Steve
>
> --
> 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/d4de53e3-5dd2-448a-8e70-0f7e94edfd46%40googlegroups.com
> 
> .
>
-- 
Massimiliano

-- 
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/CANPTPxJ0MOWDQS2tkpBoBVChFerosa-bQtKBynhmx2tTX4mxZQ%40mail.gmail.com.


[web2py] Re: Redis session error - latest web2py master

2019-11-06 Thread Jose C
On Wednesday, 6 November 2019 15:19:07 UTC, Leonel Câmara wrote:
>
> We also got this bug when we tried to upgrade to the latest web2py and had 
> to rollback. We were using the old 2.X pyredis and then tried with 3.X you 
> get the same problem with both. Please report this issue in github, if no 
> one fixes it we will probably end up fixing it as we also need this fix.
>

Hi Leonel,

Thanks for confirming, I was pulling my hair (what little is left) out with 
this one.  I can also confirm that it is present with the 2.x as well as 
3.x versions of pyredis.  I'll report on github.

Regards,

Jose

-- 
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/a0f38fe9-fb92-4328-969d-605c289a6ffa%40googlegroups.com.


[web2py] Re: Redis session error - latest web2py master

2019-11-06 Thread Leonel Câmara
We also got this bug when we tried to upgrade to the latest web2py and had 
to rollback. We were using the old 2.X pyredis and then tried with 3.X you 
get the same problem with both. Please report this issue in github, if no 
one fixes it we will probably end up fixing it as we also need this fix.

-- 
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/43f5414e-2d18-4f02-97cb-4c8a685a2b59%40googlegroups.com.


[web2py] How to filter a referenced field in a for

2019-11-06 Thread Steve
Hi,

I have a SQLFORM which has 2 fields referenced all to another Product table.
In this form you can select 1 or more products but only first is mandatory, 
the other one is optional.

The problem i have is that i don't want all the products in the dropdown 
list but only the products which are for example are in stock, the others i 
don't want in the list.
For the mandatoy field , i don't have an issue because i use 
"requires=IS_IN_DB(..."  

But for the other fields, which are not mandatory, i am not able to filter 
the dropdown list, if i use IS_IN_DB that yoou have to fill in the form 
field , but as said i would like to leave second product selection optional

Can anyone help me on my way.

db.define_table('werkgroep',
Field('omschrijving', requires=IS_NOT_EMPTY()),
Field('product1',requires = IS_IN_DB(db(db.product.stock <> 
1), db.product, '%(first_name)s %(last_name)s'), label=T('Product 1')),
Field('product2',db.product, label=T('Practitioner 2'))
)

db.define_table('product',
Field('name',requires=IS_NOT_EMPTY()),
Field('stock', 'integer', requires=IS_NOT_EMPTY()
)

Hope you can help me,

Steve

-- 
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/d4de53e3-5dd2-448a-8e70-0f7e94edfd46%40googlegroups.com.


[web2py] Re: Example in Celery for scheduling in py4web ?

2019-11-06 Thread Marcelo Huerta
El miércoles, 6 de noviembre de 2019, 1:59:06 (UTC-3), Ruslan Gareev 
escribió:
>
> Hello. You can google something like: "python celery queue". :)
>

Har har. I wanted an example specifically in the context of web2py because 
I cannot make sense of them seeing them in other contexts.
 

> But using Dramatiq  will be better 
> option than Celery.
>

I will take a look. Hopefully their examples would be easier to understand, 
I know now that asking here will only produce mockery.

Lovely group!

-- 
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/b4d582f6-7116-4a1c-a767-9ad09da99232%40googlegroups.com.