[web2py] Recommended python version for web2py-2.22.5(latest)

2022-06-09 Thread Gaurav Vichare
I am upgrading  web2py 2.14.6 running on python 2.7 to latest web2py 
2.22.5. May I know which python 3 version should i go with? Can I use 
python 3.10?
 
Thank You
- Gaurav

-- 
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/066b0d0e-994b-42f6-b1da-12fa144bd0ccn%40googlegroups.com.


[web2py] Re: customizing field's visibility in user's profile

2022-06-09 Thread Gaurav Vichare
In controllers/default.py, inside *user* function set *readable* and 
*writable* to *False* for the fields that you want to hide.

def user():

*db.auth_user.field_name.readable = False
db.auth_user.field_name.writable = False*
return dict(form=auth())

On Wednesday, June 8, 2022 at 2:02:54 AM UTC+5:30 Vlad wrote:

> I added a few fields to auth_user, but they are for internal usage, so I 
> don't want users to see those when they are logged in. How do I manage the 
> visibility of the fields in the user profile? 
>

-- 
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/28026264-b761-44f0-8074-2eabfa6dd42fn%40googlegroups.com.


Re: [web2py] Recommended python version for web2py-2.22.5(latest)

2022-06-09 Thread Maurice Waka
I use python 3:10.Nothing much apart from e.g. print being a function.

On Thu, Jun 9, 2022, 11:47 AM Gaurav Vichare 
wrote:

> I am upgrading  web2py 2.14.6 running on python 2.7 to latest web2py
> 2.22.5. May I know which python 3 version should i go with? Can I use
> python 3.10?
>
> Thank You
> - Gaurav
>
> --
> 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/066b0d0e-994b-42f6-b1da-12fa144bd0ccn%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/CALkNK56UOYkF10YFrxm6ZLmBTB%3DW%2Bz37jFtBO-0vNok2wkmdrg%40mail.gmail.com.


[web2py] Re: customizing field's visibility in user's profile

2022-06-09 Thread Vlad
Thank you, Jim, I was aware of this parameter, but I wasn't sure where 
exactly to set it. But just got the answer. Thank you very much. 

On Wednesday, June 8, 2022 at 11:01:24 AM UTC-4 Jim S wrote:

> Can you just set readable and writable to False?
>
> -Jim
>
>
> On Tuesday, June 7, 2022 at 3:32:54 PM UTC-5 Vlad wrote:
>
>> I added a few fields to auth_user, but they are for internal usage, so I 
>> don't want users to see those when they are logged in. How do I manage the 
>> visibility of the fields in the user profile? 
>>
>

-- 
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/bb06c5c3-919e-47a9-8716-3752a0971bfdn%40googlegroups.com.


[web2py] Re: customizing field's visibility in user's profile

2022-06-09 Thread Vlad
Got it, thank you very much! 

On Thursday, June 9, 2022 at 4:54:26 AM UTC-4 gauravv...@gmail.com wrote:

> In controllers/default.py, inside *user* function set *readable* and 
> *writable* to *False* for the fields that you want to hide.
>
> def user():
>
> *db.auth_user.field_name.readable = False
> db.auth_user.field_name.writable = False*
> return dict(form=auth())
>
> On Wednesday, June 8, 2022 at 2:02:54 AM UTC+5:30 Vlad wrote:
>
>> I added a few fields to auth_user, but they are for internal usage, so I 
>> don't want users to see those when they are logged in. How do I manage the 
>> visibility of the fields in the user profile? 
>>
>

-- 
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/376f8875-60fb-40cb-8a6e-404f5a740a86n%40googlegroups.com.


[web2py] Groupby tricky question

2022-06-09 Thread Vlad
Please help - I can't figure it out! 
My question is a bit detailed, but it's not about details - I am totally 
missing how to properly handle this kind of thing:

I have the following query:

query = (db.ladore_order.created_on>=dt1) & 
(db.ladore_order.created_on<=dt2)

rows = db(query).select(db.ladore_order.customer,
db.ladore_order.created_on.max(),
groupby=[db.ladore_order.customer],
orderby=[~db.ladore_order.created_on.max()])

I have 3 issues here that I am looking to resolve:

1) It shows all the orders between the range of dates dt1 and dt2. However, 
the same customer may have ordered after dt2 also (so that created_on of 
the later order would be greater than dt2). I am looking ONLY for those 
customers/orders that ordered between dt1 and dt2 and haven't ordered since 
then.

2) Besides db.ladore_order.customer in the select, I also need 
db.ladore_order.id which corresponds to the latest order of the customer. I 
can run db.ladore_order.created_on.max(), but, obviously, I can't do the 
same for the id field. If I just keep db.ladore_order.id , without any 
aggregate function, in the select, it still works for sqlite, but it 
doesn't work for stricter db, like postgres. And it really shouldn't work 
with a field which is missing an aggregate function in the place of groupby.

3) If possible, I would also love to have the very same thing created with 
SQLFORM.grid() (I mean, I need both - rows with select, and also the 2nd 
way to do it with grid, if this is possible.

Thank you for help!! 

-- 
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/9fd6ac75-d39f-4bad-8fa3-46ea3e73b3dan%40googlegroups.com.