Re: [web2py] No module named error

2020-06-13 Thread António Ramos
if all is ok, restart web2py

Em dom., 14 de jun. de 2020 às 00:35, patito feo 
escreveu:

> Hi,
>
> Im trying to use a module file inside /modules/ folder but keep getting
> this error.
>
>
> failed to reload module because:
>
> ImportError('No module named mdplenus.modules.test',)
>
> --
> 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/ba92fb90-96da-48a1-8130-b12a0256bb84o%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/CAEM0BxMSw8NOVhSREc8mF8QK3Ph%3D2Cr-C%2BN%2BbjSq8Eoa0G9i8w%40mail.gmail.com.


[web2py] No module named error

2020-06-13 Thread patito feo
Hi,

Im trying to use a module file inside /modules/ folder but keep getting 
this error.


failed to reload module because:

ImportError('No module named mdplenus.modules.test',)

-- 
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/ba92fb90-96da-48a1-8130-b12a0256bb84o%40googlegroups.com.


Re: [web2py] Re: How can I get auth.user_id inside my decorator?

2020-06-13 Thread Jim Steil
Then either you're not loved in our not running in a controller function
I'd guess

On Sat, Jun 13, 2020, 10:01 AM Константин Комков 
wrote:

> Yes, I thought about it, but if auth.user_id is None for me in
> auth.user.id I got error:  'NoneType' object has
> no attribute 'id'.
>
> суббота, 13 июня 2020 г., 15:40:21 UTC+3 пользователь Jim S написал:
>>
>> Have you tried auth.user.id?
>>
>> -Jim
>>
>> On Saturday, June 13, 2020 at 1:34:04 AM UTC-5, Константин Комков wrote:
>>>
>>> I use decorator for reduce count of sql queries for logged in users like
>>> that:
>>> def is_info(fun):
>>> def decorated():
>>> if session.is_info is None:
>>> entrant = db(db.a_persons.WEB_ID == auth.user_id).select(
>>> db.a_persons.FILE_CODE0, db.a_persons.F, db.a_persons.I,
>>> db.a_persons.O, db.a_persons.id,
>>> db.a_persons.BIRTHDAY, db.a_persons.GENDER,
>>> db.a_persons.BIRTHPLACE, db.a_persons.GRADUATION_LEVEL,
>>> db.a_persons.COUNTRY, db.a_persons.REGION,
>>> db.a_persons.ADR_INDEX, db.a_persons.ADR_DISTRICT,
>>> db.a_persons.ADR_LOC_TYPE, db.a_persons.ADR_TOWN,
>>> db.a_persons.ADR_STREET_TYPE, db.a_persons.ADR_STREET,
>>> db.a_persons.ADR_HOUSE, db.a_persons.ADR_BUILDING,
>>> db.a_persons.ADR_FLAT, db.a_persons.PHONE,
>>> db.a_persons.NEED_HOSTEL, db.a_persons.PREP_COURSE,
>>> db.a_persons.ARMY, db.a_persons.EXTRA,
>>> db.a_persons.WORK_EXP, db.a_persons.PASS_ID,
>>> db.a_persons.GRADUATION_YEAR, db.a_persons.EDU_REGION,
>>> db.a_persons.LANGUAGE).first()
>>> if entrant is None:
>>> redirect(URL('user', 'index', args=['logout']))
>>> session.is_info = True
>>> session.myvar = auth.user_id
>>> session.is_info = True
>>> session.file_code = entrant.FILE_CODE0
>>> session.middle_name = entrant.O
>>> session.entrant_id = entrant.id
>>> session.birthday = entrant.BIRTHDAY
>>> session.sex = entrant.GENDER
>>> session.birthplace = entrant.BIRTHPLACE
>>> session.country = entrant.COUNTRY
>>> session.region = entrant.REGION
>>> session.adr_index = entrant.ADR_INDEX
>>> session.adr_district = entrant.ADR_DISTRICT
>>> session.adr_loc_type = entrant.ADR_LOC_TYPE
>>> session.adr_town = entrant.ADR_TOWN
>>> session.adr_street_type = entrant.ADR_STREET_TYPE
>>> session.adr_street = entrant.ADR_STREET
>>> session.adr_house = entrant.ADR_HOUSE
>>> session.adr_building = entrant.ADR_BUILDING
>>> session.adr_flat = entrant.ADR_FLAT
>>> session.phone = entrant.PHONE
>>> session.need_hostel = entrant.NEED_HOSTEL
>>> session.prep_course = entrant.PREP_COURSE
>>> session.army = entrant.ARMY
>>> session.extra = entrant.EXTRA
>>> session.work_exp = entrant.WORK_EXP
>>> session.pass_id = entrant.PASS_ID
>>> session.graduation_level = entrant.GRADUATION_LEVEL
>>> session.graduation_year = entrant.GRADUATION_YEAR
>>> session.edu_region = entrant.EDU_REGION
>>> session.language = entrant.LANGUAGE
>>> return fun()
>>> else:
>>> return fun()
>>> return decorated
>>> As I understund after that decorator inside my function I check
>>> session.myvar and have None. I can't use auth.user_id inside decorator?
>>> tables.py
>>> db.define_table('a_persons', Field('FILE_CODE0', length=15),
>>> Field('WEB_ID', 'reference auth_user')
>>> # ...
>>> )
>>> Why I don't have error in query, becouse db.a_persons.WEB_ID == None? I
>>> have the first user information.
>>> Web2py - 2.18.5-stable+timestamp.2019.04.08.04.22.03
>>>
>>> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/0PblfPYOs_o/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/1d90d353-ba6a-42f3-bf60-b12282c3a10fo%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 

[web2py] Re: How can I get auth.user_id inside my decorator?

2020-06-13 Thread Константин Комков
Yes, I thought about it, but if auth.user_id is None for me in auth.user.id 
I got error:  'NoneType' object has no attribute 
'id'.

суббота, 13 июня 2020 г., 15:40:21 UTC+3 пользователь Jim S написал:
>
> Have you tried auth.user.id?
>
> -Jim
>
> On Saturday, June 13, 2020 at 1:34:04 AM UTC-5, Константин Комков wrote:
>>
>> I use decorator for reduce count of sql queries for logged in users like 
>> that:
>> def is_info(fun):
>> def decorated():
>> if session.is_info is None:
>> entrant = db(db.a_persons.WEB_ID == auth.user_id).select(
>> db.a_persons.FILE_CODE0, db.a_persons.F, db.a_persons.I, 
>> db.a_persons.O, db.a_persons.id,
>> db.a_persons.BIRTHDAY, db.a_persons.GENDER, 
>> db.a_persons.BIRTHPLACE, db.a_persons.GRADUATION_LEVEL,
>> db.a_persons.COUNTRY, db.a_persons.REGION, 
>> db.a_persons.ADR_INDEX, db.a_persons.ADR_DISTRICT,
>> db.a_persons.ADR_LOC_TYPE, db.a_persons.ADR_TOWN, 
>> db.a_persons.ADR_STREET_TYPE, db.a_persons.ADR_STREET,
>> db.a_persons.ADR_HOUSE, db.a_persons.ADR_BUILDING, 
>> db.a_persons.ADR_FLAT, db.a_persons.PHONE,
>> db.a_persons.NEED_HOSTEL, db.a_persons.PREP_COURSE, 
>> db.a_persons.ARMY, db.a_persons.EXTRA,
>> db.a_persons.WORK_EXP, db.a_persons.PASS_ID, 
>> db.a_persons.GRADUATION_YEAR, db.a_persons.EDU_REGION,
>> db.a_persons.LANGUAGE).first()
>> if entrant is None:
>> redirect(URL('user', 'index', args=['logout']))
>> session.is_info = True
>> session.myvar = auth.user_id
>> session.is_info = True
>> session.file_code = entrant.FILE_CODE0
>> session.middle_name = entrant.O
>> session.entrant_id = entrant.id
>> session.birthday = entrant.BIRTHDAY
>> session.sex = entrant.GENDER
>> session.birthplace = entrant.BIRTHPLACE
>> session.country = entrant.COUNTRY
>> session.region = entrant.REGION
>> session.adr_index = entrant.ADR_INDEX
>> session.adr_district = entrant.ADR_DISTRICT
>> session.adr_loc_type = entrant.ADR_LOC_TYPE
>> session.adr_town = entrant.ADR_TOWN
>> session.adr_street_type = entrant.ADR_STREET_TYPE
>> session.adr_street = entrant.ADR_STREET
>> session.adr_house = entrant.ADR_HOUSE
>> session.adr_building = entrant.ADR_BUILDING
>> session.adr_flat = entrant.ADR_FLAT
>> session.phone = entrant.PHONE
>> session.need_hostel = entrant.NEED_HOSTEL
>> session.prep_course = entrant.PREP_COURSE
>> session.army = entrant.ARMY
>> session.extra = entrant.EXTRA
>> session.work_exp = entrant.WORK_EXP
>> session.pass_id = entrant.PASS_ID
>> session.graduation_level = entrant.GRADUATION_LEVEL
>> session.graduation_year = entrant.GRADUATION_YEAR
>> session.edu_region = entrant.EDU_REGION
>> session.language = entrant.LANGUAGE
>> return fun()
>> else:
>> return fun()
>> return decorated
>> As I understund after that decorator inside my function I check 
>> session.myvar and have None. I can't use auth.user_id inside decorator?
>> tables.py
>> db.define_table('a_persons', Field('FILE_CODE0', length=15), 
>> Field('WEB_ID', 'reference auth_user')
>> # ...
>> )
>> Why I don't have error in query, becouse db.a_persons.WEB_ID == None? I 
>> have the first user information.
>> Web2py - 2.18.5-stable+timestamp.2019.04.08.04.22.03
>>
>>

-- 
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/1d90d353-ba6a-42f3-bf60-b12282c3a10fo%40googlegroups.com.


[web2py] Re: How can I get auth.user_id inside my decorator?

2020-06-13 Thread Jim S
Have you tried auth.user.id?

-Jim

On Saturday, June 13, 2020 at 1:34:04 AM UTC-5, Константин Комков wrote:
>
> I use decorator for reduce count of sql queries for logged in users like 
> that:
> def is_info(fun):
> def decorated():
> if session.is_info is None:
> entrant = db(db.a_persons.WEB_ID == auth.user_id).select(
> db.a_persons.FILE_CODE0, db.a_persons.F, db.a_persons.I, 
> db.a_persons.O, db.a_persons.id,
> db.a_persons.BIRTHDAY, db.a_persons.GENDER, 
> db.a_persons.BIRTHPLACE, db.a_persons.GRADUATION_LEVEL,
> db.a_persons.COUNTRY, db.a_persons.REGION, 
> db.a_persons.ADR_INDEX, db.a_persons.ADR_DISTRICT,
> db.a_persons.ADR_LOC_TYPE, db.a_persons.ADR_TOWN, 
> db.a_persons.ADR_STREET_TYPE, db.a_persons.ADR_STREET,
> db.a_persons.ADR_HOUSE, db.a_persons.ADR_BUILDING, 
> db.a_persons.ADR_FLAT, db.a_persons.PHONE,
> db.a_persons.NEED_HOSTEL, db.a_persons.PREP_COURSE, 
> db.a_persons.ARMY, db.a_persons.EXTRA,
> db.a_persons.WORK_EXP, db.a_persons.PASS_ID, 
> db.a_persons.GRADUATION_YEAR, db.a_persons.EDU_REGION,
> db.a_persons.LANGUAGE).first()
> if entrant is None:
> redirect(URL('user', 'index', args=['logout']))
> session.is_info = True
> session.myvar = auth.user_id
> session.is_info = True
> session.file_code = entrant.FILE_CODE0
> session.middle_name = entrant.O
> session.entrant_id = entrant.id
> session.birthday = entrant.BIRTHDAY
> session.sex = entrant.GENDER
> session.birthplace = entrant.BIRTHPLACE
> session.country = entrant.COUNTRY
> session.region = entrant.REGION
> session.adr_index = entrant.ADR_INDEX
> session.adr_district = entrant.ADR_DISTRICT
> session.adr_loc_type = entrant.ADR_LOC_TYPE
> session.adr_town = entrant.ADR_TOWN
> session.adr_street_type = entrant.ADR_STREET_TYPE
> session.adr_street = entrant.ADR_STREET
> session.adr_house = entrant.ADR_HOUSE
> session.adr_building = entrant.ADR_BUILDING
> session.adr_flat = entrant.ADR_FLAT
> session.phone = entrant.PHONE
> session.need_hostel = entrant.NEED_HOSTEL
> session.prep_course = entrant.PREP_COURSE
> session.army = entrant.ARMY
> session.extra = entrant.EXTRA
> session.work_exp = entrant.WORK_EXP
> session.pass_id = entrant.PASS_ID
> session.graduation_level = entrant.GRADUATION_LEVEL
> session.graduation_year = entrant.GRADUATION_YEAR
> session.edu_region = entrant.EDU_REGION
> session.language = entrant.LANGUAGE
> return fun()
> else:
> return fun()
> return decorated
> As I understund after that decorator inside my function I check 
> session.myvar and have None. I can't use auth.user_id inside decorator?
> tables.py
> db.define_table('a_persons', Field('FILE_CODE0', length=15), 
> Field('WEB_ID', 'reference auth_user')
> # ...
> )
> Why I don't have error in query, becouse db.a_persons.WEB_ID == None? I 
> have the first user information.
> Web2py - 2.18.5-stable+timestamp.2019.04.08.04.22.03
>
>

-- 
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/ac5eb0cc-1e54-4913-ba0d-c1997965b63co%40googlegroups.com.


Re: [web2py] Re: How to debug appadmin CSV uploading

2020-06-13 Thread Jon Subscripted
Thanks Dave!

El El sáb, 16 may 2020 a las 23:18, Dave S  escribió:

>
>
> On Friday, May 8, 2020 at 12:41:16 PM UTC-7, Jonsubs wrote:
>>
>> Thanks!
>>
>> El El sáb, 2 may 2020 a las 3:10, Andrew Rogers 
>> escribió:
>>
>>> Can't help you Jon sorry. I tried to upload a while back but got a
>>> different issue (see
>>> https://groups.google.com/forum/#!topic/web2py/03-7xKAioD8)  So maybe
>>> that feature has fallen into disuse?
>>>
>>>
>>>
>
> For what it's worth, I have done plenty of CSV uploads from the admin
> pages (DB Mgt) but that has been mostly from 2.14.6 on my home system.
>
> On a production system, when I switched from SQLite to Postgres, the CSV
> import was hundreds of thousands of rows, and I used the psql console.
>
> /dps
>
> On Friday, 1 May 2020 16:57:38 UTC+10, Jonsubs wrote:

 Hi everyone,
 I'm trying to upload a CSV file to my MySQL database using appadmin.

 I do get a "data uploaded" flash message as if I succeeded, but data is
 not there.

 Could anyone suggest me how to debug this operation?
 Thanks, Jon.


 
  Libre
 de virus. www.avast.com
 
 <#m_-3876244012739838975_CAK8tz31GshpuRQfy8V7=4rKh7tGSE4eOqL2X9-GE+M3EkFdbCw@mail.gmail.com_m_3033399681327063300_CAK8tz31FLL14iggF+geUS_piGUFSmjKQV7ie34f=7OeQBFRh3Q@mail.gmail.com_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

>>> --
>>> 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 web...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/f7f07401-d033-4a7e-9273-79e3698050b2%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/3812a283-94b3-458e-89fc-181a452d3028%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/CAK8tz33_Y%2BcrhN%3D%3DtLDsry4E3z2BSfSe_koN3pMTZFzAiSAx7Q%40mail.gmail.com.


[web2py] How can I get auth.user_id inside my decorator?

2020-06-13 Thread Константин Комков
I use decorator for reduce count of sql queries for logged in users like 
that:
def is_info(fun):
def decorated():
if session.is_info is None:
entrant = db(db.a_persons.WEB_ID == auth.user_id).select(
db.a_persons.FILE_CODE0, db.a_persons.F, db.a_persons.I, 
db.a_persons.O, db.a_persons.id,
db.a_persons.BIRTHDAY, db.a_persons.GENDER, 
db.a_persons.BIRTHPLACE, db.a_persons.GRADUATION_LEVEL,
db.a_persons.COUNTRY, db.a_persons.REGION, 
db.a_persons.ADR_INDEX, db.a_persons.ADR_DISTRICT,
db.a_persons.ADR_LOC_TYPE, db.a_persons.ADR_TOWN, 
db.a_persons.ADR_STREET_TYPE, db.a_persons.ADR_STREET,
db.a_persons.ADR_HOUSE, db.a_persons.ADR_BUILDING, 
db.a_persons.ADR_FLAT, db.a_persons.PHONE,
db.a_persons.NEED_HOSTEL, db.a_persons.PREP_COURSE, 
db.a_persons.ARMY, db.a_persons.EXTRA,
db.a_persons.WORK_EXP, db.a_persons.PASS_ID, 
db.a_persons.GRADUATION_YEAR, db.a_persons.EDU_REGION,
db.a_persons.LANGUAGE).first()
if entrant is None:
redirect(URL('user', 'index', args=['logout']))
session.is_info = True
session.myvar = auth.user_id
session.is_info = True
session.file_code = entrant.FILE_CODE0
session.middle_name = entrant.O
session.entrant_id = entrant.id
session.birthday = entrant.BIRTHDAY
session.sex = entrant.GENDER
session.birthplace = entrant.BIRTHPLACE
session.country = entrant.COUNTRY
session.region = entrant.REGION
session.adr_index = entrant.ADR_INDEX
session.adr_district = entrant.ADR_DISTRICT
session.adr_loc_type = entrant.ADR_LOC_TYPE
session.adr_town = entrant.ADR_TOWN
session.adr_street_type = entrant.ADR_STREET_TYPE
session.adr_street = entrant.ADR_STREET
session.adr_house = entrant.ADR_HOUSE
session.adr_building = entrant.ADR_BUILDING
session.adr_flat = entrant.ADR_FLAT
session.phone = entrant.PHONE
session.need_hostel = entrant.NEED_HOSTEL
session.prep_course = entrant.PREP_COURSE
session.army = entrant.ARMY
session.extra = entrant.EXTRA
session.work_exp = entrant.WORK_EXP
session.pass_id = entrant.PASS_ID
session.graduation_level = entrant.GRADUATION_LEVEL
session.graduation_year = entrant.GRADUATION_YEAR
session.edu_region = entrant.EDU_REGION
session.language = entrant.LANGUAGE
return fun()
else:
return fun()
return decorated
As I understund after that decorator inside my function I check 
session.myvar and have None. I can't use auth.user_id inside decorator?
tables.py
db.define_table('a_persons', Field('FILE_CODE0', length=15), 
Field('WEB_ID', 'reference auth_user')
# ...
)
Why I don't have error in query, becouse b.a_persons.WEB_ID == None? I have 
the first user information.
Web2py - 2.18.5-stable+timestamp.2019.04.08.04.22.03

-- 
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/5eaa71be-d785-4c92-960a-3e7da582d51bo%40googlegroups.com.