[web2py] Re: How can I use vue attributes inside FORM?

2020-09-24 Thread Константин Комков
Thank you, for your attention *Villas*. I don't ask your rewrite my code) 
My code is working.

   1. Validator IS_INT_IN_RANGE good work not only in SQLFORM.
   2. Function get_help_id() getting name from request.vars - ('help_1', 
   'help_2', ... , 'help_17', 'help_18').

I just want to add in my form additional usability. For that task I neded 
add attributes in FORM and it was my question. And I don't find solution 
yet.
But as variant I can add attributes in javascript and then use vuejs.

-- 
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/ed077fff-34c2-456c-b7a2-550d0af46871o%40googlegroups.com.


[web2py] Re: How can I use vue attributes inside FORM?

2020-09-24 Thread Константин Комков
I spent a lot of time for understanding that cases when we can use SQLFORM 
or SQLFORM.factory() 1 or 2 in 100.

[image: 1.png]

[image: 2.png]

[image: 3.png]

[image: 4.png]
I have table in database for report and on picture I show differ between 
what I need and what can supply SQLFORM. I know that we can exclude 
unnecessary fields and change labels in SQLFORM, but I don't know how to 
combine helps type with status and cloned it 18 times.
All code if you want:
@auth.requires_login()
def egisso_load():
def get_help_id(name):
result = None
if len(name) > 5:
try:
result = int(name[5:])
except:
return result
return result


helps_statuses = db().select(db.s_helps_statuses.id, db.s_helps_statuses
.name,
 cache=(cache.ram, 3600), cacheable=True)
helps_types = db(db.s_helps_types.active == 1).select(
db.s_helps_types.id, db.s_helps_types.name, orderby=db.s_helps_types
.id, cache=(cache.ram, 3600),
cacheable=True)
years = [OPTION(request.now.year, _value=request.now.year),
 OPTION(request.now.year - 1, _value=request.now.year - 1)]
message = ''
form = FORM(DIV(DIV(LABEL('Год:', _for='year'),
SELECT(*years, _name='year', _id='year', _class=
'form-control',
   requires=IS_INT_IN_RANGE(request.now.year - 1
, request.now.year + 1,
error_message="Year 
isn't correct!"),
   **{'_v-model': 'year'}, **{"'v-test'": "test"
}),
_class='col-sm-12 col-md-4 col-lg-3'),
DIV(LABEL('Месяц:', _for='month'),
SELECT(
OPTION('Январь', _value=1),
OPTION('Февраль', _value=2),
OPTION('Март', _value=3),
OPTION('Апрель', _value=4),
OPTION('Май', _value=5),
OPTION('Июнь', _value=6),
OPTION('Июль', _value=7),
OPTION('Август', _value=8),
OPTION('Сентябрь', _value=9),
OPTION('Октябрь', _value=10),
OPTION('Ноябрь', _value=11),
OPTION('Декабрь', _value=12),
requires=IS_INT_IN_RANGE(1, 13, 
error_message='Указан 
некорректный месяц!'),
_name='month', _id='month', _class=
'form-control'),
_class='col-sm-12 col-md-4 col-lg-3'),
_class='form-group row'),
DIV(DIV(P('Виды выплат:', _class='lead mb-0'), _class='col'
), _class='form-group row'),
DIV(DIV(INPUT(_type='checkbox', _name='chb', _id='chb', **{
'_v-model': 'chb'},
  _class='form-check-input'),
   LABEL('Отметить всё как загруженное:', _for='chb', 
_class='form-check-label'),
   _class='form-check'), _class='form-group'))


helps_statuses_list = list()
for row in helps_statuses:
helps_statuses_list.append(OPTION(row.name, _value=row.id))
helps_statuses_list.insert(0, OPTION(''))
columns_list = list()
for row in helps_types:
columns_list.append(DIV(LABEL(row.name, _for=f'help_{row.id}'),
SELECT(*helps_statuses_list, _id=f
'help_{row.id}',
   _name=f'help_{row.id}', _class=
'form-control',
   requires=IS_IN_DB(db, 
's_helps_statuses.id',
 error_message='Выберите 
значение!')),
_class='col-sm-12 col-md-4 col-lg-3 pb-3'))
form.append(DIV(*columns_list, _class='form-group row', _id=
'helps_type_row'))
form.append(DIV(DIV(INPUT(_type='submit', _class='btn btn-dark w-100'), 
_class='col-sm col-md-4 col-lg-3'),
_class='form-group row'))
if form.process().accepted:
for x in form.vars:
if x not in ('year', 'month', 'chb'):
help_id = get_help_id(x)
if help_id is not None:
db.a_egisso_and_divisions.update_or_insert(
(db.a_egisso_and_divisions.division == auth.user.
division) &
(db.a_egisso_and_divisions.year == form.vars.year) &
(db.a_egisso_and_divisions.month == form.vars.month) 
&
(db.a_egisso_and_divisions.helps_type == help_id),
division=auth.user.division, helps_type=help_id, 
year=form.vars.year,
month=form.vars.month, status=form.vars[x])
else:
message = f'Из ключа {x} не может быть извлечено 
значение идентификатора!'

[web2py] Re: How can I use vue attributes inside FORM?

2020-09-23 Thread Константин Комков
Villlas, yes that variant with .xml() add attribute, but that variant with 
FORM not worked, and I don't know how to add it in FORM.
def my_func():

form = FORM(DIV(DIV(LABEL('Год:', _for='year'),
SELECT(*years, _name='year', _id='year',
   requires=IS_INT_IN_RANGE(request.now.year - 1, 
request.now.year + 1,
error_message='Указан 
некорректный год!'),
   _class='form-control', **{'_v-model': 'year'}),
_class='col-sm-12 col-md-4 col-lg-3'), _class='form-group 
row'))
return dict(form=form)

P.S. That variant not worked:
XML(SELECT(*years, _name='year', _id='year', _class='form-control',   
requires=IS_INT_IN_RANGE(request.now.year - 1, request.now.year + 1, 
error_message="Year isn't correct!"), **{'_v-model': 'year'}).xml())


среда, 23 сентября 2020 г., 18:41:12 UTC+3 пользователь villas написал:
>
> Strange,  copy and paste lines in the shell...
>
> >>> years = ['2020','2021']
>
> >>> SELECT(*years, _name='year', _id='year', _class='form-control',   
> requires=IS_INT_IN_RANGE(request.now.year - 1, request.now.year + 1, 
> error_message="Year isn't correct!"), **{'_v-model': 'year'}).xml()
>
> ' value="2020">20202021'
>
>
>
> On Wednesday, 23 September 2020 at 12:18:50 UTC+1 Константин Комков wrote:
>
>> I do form with fields *year, month* and another some fields which must 
>> be loaded from table in database if year and month != ''.
>> I know how to make that with vue attributes, but cun't create them inside 
>> function in controller. Villas, your example is the same - not work. If I 
>> add **{'_data-test': 'test'} - when form was generated I have 
>> data-test="test" in select, **{'_v-model': 'year'} -when form was generated 
>> I don't have v-model="year" in select.
>>
>> вторник, 22 сентября 2020 г., 20:50:15 UTC+3 пользователь Константин 
>> Комков написал:
>>
>>>
>>> I don't know but it's not working:
>>>
>>> SELECT(*years, _name='year', _id='year',
>>>requires=IS_INT_IN_RANGE(request.now.year - 1, request.now.year + 1,
>>> error_message="Year isn't correct!'"),
>>>_class='form-control', **{'_v-model': 'year'})
>>>
>>>
>>>
>>>

-- 
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/dd3b2019-9d3a-4270-bef9-209189cfcad3o%40googlegroups.com.


[web2py] Re: How can I use vue attributes inside FORM?

2020-09-23 Thread Константин Комков
I do form with fields *year, month* and another some fields which must be 
loaded from table in database if year and month != ''.
I know how to make that with vue attributes, but cun't create them inside 
function in controller. Villas, your example is the same - not work. If I 
add **{'_data-test': 'test'} - work, **{'_v-model': 'year'} - not work.

вторник, 22 сентября 2020 г., 20:50:15 UTC+3 пользователь Константин Комков 
написал:
>
>
> I don't know but it's not working:
>
> SELECT(*years, _name='year', _id='year',
>requires=IS_INT_IN_RANGE(request.now.year - 1, request.now.year + 1,
> error_message="Year isn't correct!'"),
>_class='form-control', **{'_v-model': 'year'})
>
>
>
>

-- 
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/49f66dfb-b179-40a2-851e-c854b94bd78bo%40googlegroups.com.


[web2py] Re: Freshly cloned web2py, grid example says "not authorized"

2020-09-22 Thread Константин Комков
Hello! You need to comment decorator #@auth.requires_membership('admin') or 
add your user in 'admin' group see chapter 9 Access Control in The book.
Also set table name, forexample:
tablename = 'auth_user'

-- 
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/cbf97c74-9a33-4f29-9d04-b0c744dfebdeo%40googlegroups.com.


[web2py] How can I use vue attributes inside FORM?

2020-09-22 Thread Константин Комков

I don't know but it's not working:

SELECT(*years, _name='year', _id='year',
   requires=IS_INT_IN_RANGE(request.now.year - 1, request.now.year + 1,
error_message="Year isn't correct!'"),
   _class='form-control', **{'_v-model': 'year'})



-- 
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/81230801-2e4e-4dc6-804f-0823c8b6e8e8o%40googlegroups.com.


[web2py] Re: Error with FDB in new version of Web2py

2020-08-19 Thread Константин Комков
*Massimo, Villas* I checked last update in firebird.py at 15 May, but it's 
not work. That file is not work with any firebird database.

-- 
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/0e112cc7-798c-477f-a850-b2208c8cc88ao%40googlegroups.com.


[web2py] Re: Error with FDB in new version of Web2py

2020-08-06 Thread Константин Комков
*Villas*, can I update pyDAL myself in web2py or it's suggestion 
for Massimo Di Pierro?)

четверг, 6 августа 2020 г. в 14:25:13 UTC+3, villas: 

> It's a good time to update pyDAL too!
>

-- 
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/3149bde7-d628-4de5-b784-89a74280ee54n%40googlegroups.com.


[web2py] Error with FDB in new version of Web2py

2020-08-06 Thread Константин Комков
*Error ticket for "application"*
*Ticket ID*
*127.0.0.1.2020-08-06.08-53-16.232678aa-5c76-4d2f-b740-c3dc5be4668d*

* ('Error while preparing SQL 
statement:\n- SQLCODE: -104\n- Dynamic SQL Error\n- SQL error code = 
-104\n- Unexpected end of command - line 1, column 8', -104, 335544569)*
*Версия*
*web2py™ Version 2.20.4-stable+timestamp.2020.05.03.05.18.50*
*Python Python 3.7.3: C:\Python\python.exe (prefix: C:\Python)*
*Traceback*
*Traceback (most recent call last):*
*  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py new\gluon\restricted.py", 
line 219, in restricted*
*exec(ccode, environment)*
*  File "C:/Users/kkomkov.TIMACAD/Desktop/web2py 
new/applications/application/controllers/default.py", line 151, in *
*  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py new\gluon\globals.py", 
line 430, in *
*self._caller = lambda f: f()*
*  File "C:/Users/kkomkov.TIMACAD/Desktop/web2py 
new/applications/application/controllers/default.py", line 6, in index*
*interval = db().select(db.t_admission_schedule.BEGINNING, 
cache=(cache.ram, 60 * 60 * 24), cacheable=True).first()*
*  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\gluon\packages\dal\pydal\objects.py", line 2634, in select*
*return adapter.select(self.query, fields, attributes)*
*  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\gluon\packages\dal\pydal\adapters\base.py", line 877, in select*
*return self._cached_select(cache, sql, fields, attributes, colnames)*
*  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\gluon\packages\dal\pydal\adapters\base.py", line 868, in _cached_select*
*key, lambda self=self, args=args: self._select_aux(*args), time_expire*
*  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py new\gluon\cache.py", line 
247, in __call__*
*value = f()*
*  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\gluon\packages\dal\pydal\adapters\base.py", line 868, in *
*key, lambda self=self, args=args: self._select_aux(*args), time_expire*
*  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\gluon\packages\dal\pydal\adapters\base.py", line 835, in _select_aux*
*rows = self._select_aux_execute(sql)*
*  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\gluon\packages\dal\pydal\adapters\base.py", line 829, in 
_select_aux_execute*
*self.execute(sql)*
*  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\gluon\packages\dal\pydal\adapters\__init__.py", line 65, in wrap*
*if not args[0].connection:*
*  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\gluon\packages\dal\pydal\connection.py", line 32, in connection*
*return self.get_connection()*
*  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\gluon\packages\dal\pydal\connection.py", line 66, in get_connection*
*self.set_connection(connection, run_hooks=True)*
*  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\gluon\packages\dal\pydal\connection.py", line 80, in set_connection*
*self.test_connection()*
*  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\gluon\packages\dal\pydal\adapters\base.py", line 425, in 
test_connection*
*self.execute("SELECT 1;")*
*  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\gluon\packages\dal\pydal\adapters\__init__.py", line 69, in wrap*
*return f(*args, **kwargs)*
*  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\gluon\packages\dal\pydal\adapters\base.py", line 461, in execute*
*rv = self.cursor.execute(command, *args[1:], **kwargs)*
*  File "C:\Python\lib\site-packages\fdb\fbcore.py", line 3688, in execute*
*self._ps = PreparedStatement(operation, self, True)*
*  File "C:\Python\lib\site-packages\fdb\fbcore.py", line 2307, in __init__*
*"Error while preparing SQL statement:")*
*fdb.fbcore.DatabaseError: ('Error while preparing SQL statement:\n- 
SQLCODE: -104\n- Dynamic SQL Error\n- SQL error code = -104\n- Unexpected 
end of command - line 1, column 8', -104, 335544569)*
*Error snapshot help*
*DatabaseError(('Error while preparing SQL statement:\n- SQLCODE: -104\n- 
Dynamic SQL Error\n- SQL error code = -104\n- Unexpected end of command - 
line 1, column 8', -104, 335544569))*

*inspect attributes*

*Frames*
*File C:\Users\kkomkov.TIMACAD\Desktop\web2py new\gluon\restricted.py in 
restricted at line 219 код аргументы переменные*

*File C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\applications\application\controllers\default.py in  at line 151 
код аргументы переменные*

*File C:\Users\kkomkov.TIMACAD\Desktop\web2py new\gluon\globals.py in 
 at line 430 код аргументы переменные*

*File C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\applications\application\controllers\default.py in index at line 6 код 
аргументы переменные*

*File C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\gluon\packages\dal\pydal\objects.py in select at line 2634 код 
аргументы переменные*

*File C:\Users\kkomkov.TIMACAD\Desktop\web2py 
new\gluon\packages\dal\pydal\adapters\base.py in select at line 877 код 
аргументы переменные*

*File C:\Users\kkomkov.TIMACAD\Desktop\web2py 

[web2py] Re: Problem with upload field

2020-06-21 Thread Константин Комков
I tried to load file with long filename until that file was loaded. So 
maximal length for filename is 34 symbols.

I do like that:
last_symbol = len(document[key].filename) - 1
while document[key].filename[last_symbol] != '.':
last_symbol -= 1
without_ext = document[key].filename[:last_symbol]
if len(without_ext) < 35:
load = db_app.doc_images.validate_and_insert(person=f'{f} {i} {number} 
{email}',
 doctype=document.doctype, 
file=document[key])
else:
# return message about filename < 35 sybols.


-- 
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/a1ab20f7-1df7-4949-9232-13931a2bo%40googlegroups.com.


[web2py] Re: Problem with upload field

2020-06-19 Thread Константин Комков
I am very happy today! I can find user who can't load file and talk with 
him. User can't load file with name:
ФГБОУ ВО Липецкий государственный педагогический университет им. П.П. 
Семенова-Тян-Шанского

filename in error for that file is 
doc_images.file.9bbb3bdd72dc6f61.d0a4d093d091d09ed0a320d092d09e20d09bd0b8d0bfd0b5d186d0bad0b8d0b920d0b3d0bed181d183d0b4d0b0d180d181d182d0b2d0b5d0bdd0bdd18bd0b920d0bfd0b5d0b4d0b0d0b3d0bed0b3d0b8d187d0b5d181d0bad0b8d0b920d183d0bdd0b8d0b2d0b5d180d181d0b8d182d0b5d18220d0b8d0bc2e20d09f2ed09f2e20d0a1d0b5d0bcd0b5d0bdd0bed0b2d0b02dd0a2d18fd0bd2dd0a8d0b0d0bdd181d0bad0bed0b3d0be2e6a7067.jpg

How can I validate it?

-- 
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/c0d405b0-1196-4bdb-9cca-85da2242b1dfo%40googlegroups.com.


[web2py] Re: Problem with upload field

2020-06-19 Thread Константин Комков
*Dave*, hello and thank you for attention!
You are right my user (my colleague) load file with name in web2py format 
and don't tell me about it (:
But I have error in any way becouse there is users which can't load file 
with web2py format and I don't know how they are doing that.
I have examples filenames of that users from errors:

doc_images.file.b293994694c6d81d.32303230303631375f31393231343920d09fd0b0d181d0bfd0bed180d18220d09fd0bed0b4d0bed181d0b8d0bdd0bdd0b8d0bad0bed0b2d0b020d09bd0b5d0bdd0b020d181d182d18020d0be20d0b7d0b0d0b3d180d0b0d0bdd0bfd0b0d181d0bfd0bed180d182d0b52e6a7067.jpg
doc_images.file.aefe38bc2064002c.d0a3d0b4d0bed181d182d0bed0b2d0b5d180d0b5d0bdd0b8d0b520d0ba20d0b7d0bed0bbd0bed182d0bed0b920d0bcd0b5d0b4d0b0d0bbd0b820d09fd0bed0b4d0bed181d0b8d0bdd0bdd0b8d0bad0bed0b2d0b020d09bd0b5d0bdd0b02e706466.pdf

That filenames looks like previous, but I don't sure.

There is file with name 
(doc_images.file.80bde2fc22f5afc8.31353932333930313839373638363033373433343035313436333933353834312e6a7067)
 
in upload folder.
That file with name (
doc_images.file.b520635e438be8d7.646f635f696d616765732e66696c652e383062646532666332326635616663382e33313335333933323339333033313338333933373336333833363330333733343334333033353331333433363339333533383334333132653661373036372e6a7067.jpg)
 
are absent.
Current situation 137 users with success and 5 users can't load files (For 
that 5 users > 100 tikets was created on server with one type of error: No 
such file or directory)

-- 
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/f7084a73-8da1-4a14-ba25-cef7489acecao%40googlegroups.com.


[web2py] Re: Problem with upload field

2020-06-18 Thread Константин Комков
I thought that there is problem f'{f} {i} {number} {email}' here, but on my 
computer I can send document without problem.
Why in error I see databases\\..\\uploads?
What means two points?
That folder have next structure:
- test
- databases
- uploads

-- 
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/6baf36d2-3780-4b44-b264-eff83ca74bf2o%40googlegroups.com.


[web2py] Problem with upload field

2020-06-18 Thread Константин Комков
Part of users and me don't have problem, but another part of users can't 
load files. On server I see error:

* [Errno 2] No such file or directory: 
'C:\\inetpub\\wwwroot\\applications\\test\\databases\\..\\uploads\\doc_images.file.b520635e438be8d7.646f635f696d616765732e66696c652e383062646532666332326635616663382e33313335333933323339333033313338333933373336333833363330333733343334333033353331333433363339333533383334333132653661373036372e6a7067.jpg'*

my tables.py
db_app.define_table('doc_images', Field('person', label='ФИО', 
writable=False), Field('doctype', 'integer'),
Field('file', 'upload', label='Документ',
  
requires=[IS_UPLOAD_FILENAME(extension='^(pdf|tiff|png|bmp|jpeg|jpg)$'),
IS_LENGTH(10485760, 1024)]), 
format='%(title)s')
line with error in controller:
load = db_app.doc_images.validate_and_insert(person=f'{f} {i} {number} 
{email}',

 doctype=document.doctype, file=document[key])

What I need to do in that case?

-- 
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/d130aeda-d91c-4b99-8c30-f5c749ad7aceo%40googlegroups.com.


[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] 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.


[web2py] How can I watch time of query?

2020-04-03 Thread Константин Комков
Hello! I thought that db._lastsql return tuple like ('text of query', time 
of query in ms), but second element it's not time.
I have hard query with time 5 sec, but in tuple I see 0.043004512786865234.


-- 
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/618dea00-5022-4d2b-b00d-c10ad51f766d%40googlegroups.com.


[web2py] Re: About menu and current page

2020-03-09 Thread Константин Комков
Alex Beskopilny, I know how to make sub menu. There is example in welcom 
web2py app. I asked about link.
Is there more elegant way?

*'#' if (request.controller == 'default' and request.function == 
'selectTimetable') else URL('default', 'selectTimetable')*



-- 
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/b5aedc9a-3b6e-4da2-b036-8d58d32651cd%40googlegroups.com.


[web2py] About menu and current page

2020-03-04 Thread Константин Комков
Hello, are somebody know how create link in menu empty if current page like 
link in menu, but not empty if page is not like in link.
I do like that:

response.menu.insert(0, (T('Editor'), False, '#', [
(T('Edit timetable'), False, '#' if (request.controller == 'default' and 
request.function == 'selectTimetable') else URL('default', 'selectTimetable')),
]))

If there is more elegant way share it please.

-- 
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/55bb4857-f9fe-43c7-b831-b82a9ceba92e%40googlegroups.com.


[web2py] Re: Many records in one transaction

2020-02-24 Thread Константин Комков
*Villas*, I can explain why I need to delete many records. I have template 
of timetable (example upper in my post). There is templates for each group 
for each faculty in university. ~40 groups = 40 templates for each faculty.
When I do timetable I need to do next operations:

   - Select all active groups for faculty (1 query);
   - Select holidays from production calendar (directory table in database, 
   1 query);
   - Get template for each group (start cycle, no query becouse get from 
   sessions);
   - Delete previous timetable becouse I don't know what is new in template 
   and I don't know it is new template or old (~400 record);
   - Select all subjects, hours for subjects and schedule of educational 
   process in a group (1 procedure);
   - Find period of teoretical occupations in a schedule;
   - There is two check of template and correct it if it is necessary 
   (updating rule in template ~2 rows);
   - Insert lesson to database in cycle start with first date of teoretical 
   occupations if date corresponds all rules in a template and not holidays 
   and hours for a subject > 0 (~400 record);
   - Create report about group (see picture).

As result we have 40 * 400 = 16000 rows for deleting and 16000 rows for 
inserting. But there is fuculty with 56 groups then ~22400 rows for delete 
and insert. Becouse I told 25000 rows it is max.
Let's talk about *IIS* settings, becouse if I do that on *Rocket *server 
all work. But on IIS without deleting at all I have problem with inserting 
5000 rows.
Thank you for attention!

-- 
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/00095928-cb3b-4694-a3d2-9f0cca0b8961%40googlegroups.com.


[web2py] Re: Many records in one transaction

2020-02-18 Thread Константин Комков
I can't solve that problem still. I have additional information also. 
Maximum count of unique rows for insert can be 25000, and before I need to 
delete maximum 25000 rows in database. Seems like it's IIS settings, 
becouse if I work with 5000 unique rows and Rocket server on local I don't 
have error. When I'm trying do that on IIS I have error. I think about 
executionTimeout in IIS config. By default that time is 110 seconds, but I 
have error after ~ 60, 70 secons. If someone have assumptions share them, 
please. It's not normal situation becouse it is import of timetable, and if 
user will wait 5 or 10 minutes it is OK.

-- 
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/936b0f64-9727-41a1-9e93-edcdc6467dad%40googlegroups.com.


[web2py] Many records in one transaction

2020-02-16 Thread Константин Комков
Hello! I do import timetables from templates. It's templates for all group 
on faculty. After import I have error or success with probability 50%.
Count of records to database is 3863 and it can be more for another 
faculties. I think that reason of error is time of answer from server. That 
time is too much.
What I need to do in that case? I don't have web2py ticket.

-- 
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/808ae66c-d47b-4c96-8f35-9d1d75018fe0%40googlegroups.com.


[web2py] Re: Question about FORM

2020-01-30 Thread Константин Комков
Thank you, for using form.vars I used form.append(INPUT()).

-- 
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/a87b08eb-3eaa-43de-8603-e3ec2f9d2f02%40googlegroups.com.


[web2py] Question about FORM

2020-01-22 Thread Константин Комков
Hello! Can somebody answer why If I use FORM() and inside FORM I create 
XML('') I don't have request.vars.test and 
form.vars.test after submit?

-- 
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/65102f28-73b4-4a63-88ee-a9123561e815%40googlegroups.com.


[web2py] Re: Using distinct with null

2020-01-15 Thread Константин Комков
*Massimo Di Pierro*, thank you it work!

-- 
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/f46703fb-584e-401b-92f5-302379c0c25e%40googlegroups.com.


[web2py] Using distinct with null

2020-01-14 Thread Константин Комков
Hello!
I have that query:
Firebird SQL
SELECT
a_wlp2.id,
s_disc_names.FULL_NAME
FROM tt_main
JOIN a_groups ON (tt_main.GROUP_ID = a_groups.id)
JOIN a_wlp2 ON ((a_groups.WLP = a_wlp2.WLP) AND (a_wlp2.SUBSPC *IS NOT 
DISTINCT FROM* tt_main.SUBSPC))
JOIN a_wlp2_distrib ON ((a_wlp2.id = a_wlp2_distrib.WLP_ITEM) AND (
a_wlp2_distrib.MODULE = tt_main.MODULE))
JOIN s_disc_names ON (a_wlp2.DISC_NAME = s_disc_names.id)
WHERE (tt_main.id = 241)
ORDER BY s_disc_names.FULL_NAME
In that query I use *IS NOT DISTINCT FROM *becouse a_wlp2.SUBSPC and tt_main
.SUBSPC can be null.

*Are there way to write that query using DAL in web2py?*

rows = db(db.tt_main.id == request.vars.group_id).select(
db.a_wlp2.id,
db.s_disc_names.FULL_NAME,
orderby=db.s_disc_names.FULL_NAME,
join=[db.a_groups.on(db.tt_main.GROUP_ID == db.a_groups.id),
  db.a_wlp2.on((db.a_groups.WLP == db.a_wlp2.WLP) & (a_wlp2.SUBSPC 
 tt_main.SUBSPC)),
  db.a_wlp2_distrib.on((db.a_wlp2.id == db.a_wlp2_distrib.WLP_ITEM) &
   (db.a_wlp2_distrib.MODULE == db.tt_main.MODULE)),
  db.s_disc_names.on(db.a_wlp2.DISC_NAME == db.s_disc_names.id)])

If I use a_wlp2.SUBSPC == tt_main.SUBSPC query don't work.

-- 
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/53f95193-fcdf-4cd8-957e-b932f56140b5%40googlegroups.com.


[web2py] Re: Take me advice, please

2020-01-05 Thread Константин Комков
Val K, thank you now I use list wich contain dicts without json and all 
work.

-- 
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/30f22666-508a-4f54-9f8d-29e2c18aaa37%40googlegroups.com.


Re: [web2py] Re: Take me advice, please

2020-01-05 Thread Константин Комков
Val K, yes I want transfer class objects in list like variable at first.
Then I tried save that variable in session, but it was unsuccess too. And
now I serialised all objects in list like that
json.dumps(my_object.__dict__) append all of them in list and save in
session.

вс, 5 янв. 2020 г., 12:19 Val K :

> You want to keep python object in memory  between requests? - it is bad
> idea. You should transform it to something that can be saved on disk or in
> db and recreate it in each request
>
> --
> 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/UrR2cxoFpDo/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/d1bffc13-b8cc-4c19-8e41-87401c105944%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/CAM7z-Vn3wBk4yeqyZkbZqV0yZpSih9zB0WUqQCT8Jp9p3-zamg%40mail.gmail.com.


[web2py] Re: Take me advice, please

2020-01-04 Thread Константин Комков
Eric, I tried use sessions but have error, becouse as I understood session 
can't store user class objects. *"Don't store user-defined classes in 
session"* - in book. Then I serialised object to json like that: 
json.dumps(temp_double_class.__dict__) and in my fubction use that code:

def importTimetable():
#form code

#parser code
if form.process().accepted:

   filesLinesList = [line.strip().decode() for line in form.vars.ttFile.
file]

double_class_list = parseExcelCsv(filesLinesList, 
int(form.vars.HALF_YEAR), int(form.vars.FAC))

   session.double_class_list = double_class_list
redirect(URL('Timetable', 'default', 'findSubjectsId'))
return dict(form=form, test=test)


def findSubjectsId():
import json
from collections import namedtuple
double_class_list = list()
for x in session.double_class_list:
double_class_list.append(json.loads(x, object_hook=lambda d: 
namedtuple('DoubleClass', d.keys())(*d.values(

test = ""
for x in double_class_list:
test += f"tt_id - {x.tt_id}, dc_number - {x.dc_number}, dc_day - {
x.dc_day}, dc_type - {x.dc_type}, " \
f"subject_id - {x.subject_id}, teacher_id - {x.teacher_id}, 
building_id - {x.building_id}, " \
f"class_room_id - {x.class_room_id}, subgroup - {x.subgroup}, 
dc_week - {x.dc_week}, " \
f"dc_queue - {x.dc_queue};"
test = XML(test)
return dict(test = test)

If somebody know more useful case share it, please.

-- 
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/f9edb4a4-0323-4162-9b91-faf86dbd9906%40googlegroups.com.


[web2py] Re: Take me advice, please

2019-12-30 Thread Константин Комков
I can give more details.
I have nine files with timetable for each faculty in excel. I saved all of 
them in csv and my task was create parser for read each class (university 
subject) to database for each group. Parser was written now, and all 
classes in my variable type of list.
Class structure:

class DoubleClass:
def __init__(self, tt_id, dc_number, dc_day, dc_type, subject_id, 
teacher_id, building_id, class_room_id,
 subgroup,  dc_week, dc_queue):
self.tt_id = tt_id
self.dc_number = dc_number
self.dc_day = dc_day
self.dc_type = dc_type
self.subject_id = subject_id
self.teacher_id = teacher_id
self.building_id = building_id
self.class_room_id = class_room_id
self.subgroup = subgroup
self.dc_week = dc_week
self.dc_queue = dc_queue

default.py

def importTimetable():
sdsds




-- 
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/920aaed8-cdbe-4cbb-931a-4efaf387f113%40googlegroups.com.


[web2py] Take me advice, please

2019-12-29 Thread Константин Комков
Hello!

How can I transfer my variable type of list, which contain my classes to 
another function in controller. I tried vars and args in URL function but 
my classes now is str type.

Thank you!

-- 
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/329c7e6f-451a-4534-a3ed-c208f16ba615%40googlegroups.com.


[web2py] Re: Something strange in my query

2019-12-09 Thread Константин Комков
I understood, that I select only one table and need take row.NAME without 
tablename. But it's intresting what is a_students attribute?

понедельник, 9 декабря 2019 г., 13:30:00 UTC+3 пользователь Константин 
Комков написал:
>
> My query return attribute 'a_students' for row, but in select I wrote '
> db.a_groups.NAME'. Why?
> Web2py 2.18.5-stable+timestamp.2019.04.08.04.22.03
> (Running on Rocket 1.2.6, Python 3.7.3)
>
> tables.py
>
> db.define_table(
>  'a_groups',
>  Field('ACADEMIC_YEAR', 'integer'),
>  Field('NAME', length=25),
>  Field('STATUS', 'integer'),
>  Field('INACTIVE', 'integer', rname='"INACTIVE"'),
>  Field('FO', 'integer'),
>  Field('WLP', 'integer'),
>  Field('FAC', 'reference t_fac'),
>  migrate=False
> )
>
> db.define_table(
>  'a_students',
>  Field('GROUP_ID', 'reference a_groups'),
>  migrate=False
> )
>
> db.define_table(
>  'tt_main',
>  Field('GROUP_ID', 'reference a_groups'),
>  Field('MODULE', 'integer'),
>  migrate=False
> )
>
> default.py
>
> groups = db((db.a_groups.FO == 1) & (db.a_groups.FAC == faculty) & 
> (db.a_groups.STATUS == 2) &
>  (db.a_groups.INACTIVE == 0)).select(db.a_groups.id, db.a_groups.NAME)
>
> for row in groups:
>  ...
>
> then I have error becouse row don't have 'a_groups'. Why I have 
> 'a_students' attribute?
>  = 1754)>, 'NAME': 'Д-А401'}>
>

-- 
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/857717bc-b7a9-434d-b36f-c0114a33c8e6%40googlegroups.com.


[web2py] Something strange in my query

2019-12-09 Thread Константин Комков
My query return attribute 'a_students' for row, but in select I wrote 
'db.a_groups.NAME'. Why?

tables.py

db.define_table(
 'a_groups',
 Field('ACADEMIC_YEAR', 'integer'),
 Field('NAME', length=25),
 Field('STATUS', 'integer'),
 Field('INACTIVE', 'integer', rname='"INACTIVE"'),
 Field('FO', 'integer'),
 Field('WLP', 'integer'),
 Field('FAC', 'reference t_fac'),
 migrate=False
)

db.define_table(
 'a_students',
 Field('GROUP_ID', 'reference a_groups'),
 migrate=False
)

db.define_table(
 'tt_main',
 Field('GROUP_ID', 'reference a_groups'),
 Field('MODULE', 'integer'),
 migrate=False
)

default.py

groups = db((db.a_groups.FO == 1) & (db.a_groups.FAC == faculty) & 
(db.a_groups.STATUS == 2) &
 (db.a_groups.INACTIVE == 0)).select(db.a_groups.id, db.a_groups.NAME)

for row in groups:
 ...

then I have error becouse row don't have 'a_groups'. Why I have 
'a_students' attribute?
, 'NAME': 'Д-А401'}>

-- 
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/737654b9-6bc0-4737-9ee5-dd216d66e54b%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] Web2py with python 3.8.0

2019-10-30 Thread Константин Комков
Hello! I can't start web2py with python 3.8.0. Are somebody have the same 
problem? Web2py with python 3.7.3 and 3.7.5 work good. Thank you.

-- 
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/3b491d2a-c24e-4fcf-8403-6bb1609c0104%40googlegroups.com.


[web2py] Re: Argument problem with left join

2019-10-30 Thread Константин Комков
You have difficult query. Try write simple query and do it more difficult 
step by step. Try left join for two tables. Is it work? Use 
dbOracle._lastsql for see sql code.

-- 
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/c835202b-6c3b-4161-b12a-b7803a5630c5%40googlegroups.com.


[web2py] Re: About mail and auth

2019-10-23 Thread Константин Комков
Maybe there are another variants, becouse I think user should have 
posibility to get letter if first letter was lost.

-- 
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/e212bf66-0815-4476-8020-477aaaddeb84%40googlegroups.com.


[web2py] Re: wfastcgi , iis & python 3 not working?

2019-10-22 Thread Константин Комков
I have Windows Server 2019, IIS 10, Python 3.7.3, web2py 2.18.5 and it's 
work.
You need to try that web.config:



  


  
  

  


  
  
  


  
  
  

  
  

  
  
  
  


  
  


  

  

  

  


-- 
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/9ee0b3c7-f96f-4fec-bbe2-e78cbb2bdc4c%40googlegroups.com.


[web2py] Re: Debugger

2019-10-22 Thread Константин Комков
If somebody use debagger, please told how I can create breakpoin and after 
that see variables. In start of my default.py I wrote *from gluon.debug 
import dbg* and I have that code:
if form.process().accepted:
if form.vars.TEACHERS_ID == '':
db.tt_on_day.insert(TIMETABLE_ID=tt_id, DATE=form.vars.DATE, 
DISC_ID=form.vars.DISC_ID, PERSON_ID=form.vars.PERSON_ID, CLASS_ROOM_ID=form
.vars.CLASS_ROOM_ID, DOUBLE_CLASS=form.vars.DOUBLE_CLASS)
else:
if form.vars.END_DATE == '':
if form.vars.DATE != '':
inWLP = False
print(*arrGraphOnModule*)
*dbg**.set_trace()*
How can I understant what now in variable arrGraphOnModule?

-- 
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/359a9322-5c5f-49a6-98d1-f9de5aaf081d%40googlegroups.com.


[web2py] Re: About response.toolbar

2019-10-22 Thread Константин Комков
Massimo Di Pierro, please, told about *db stats* or where I can find file 
for check it myself.

-- 
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/fb74001c-0fb6-4e23-98e1-c8f702650cfb%40googlegroups.com.


[web2py] Debugger

2019-10-22 Thread Константин Комков
I want add brakpoint in my app. After that I click on breakpoins button I 
have error:
Error ticket for "admin"Ticket ID

127.0.0.1.2019-10-22.11-52-19.9c598e8d-223c-4134-a4a0-27852a9c40f8
 'charmap' codec can't decode byte 0x98 in 
position 6123: character maps to Версия
web2py™ Version 2.18.5-stable+timestamp.2019.04.08.04.22.03
Python Python 3.7.3: C:\Python\python.exe (prefix: C:\Python)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.

Traceback (most recent call last):
  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py\gluon\restricted.py", line 219, 
in restricted
exec(ccode, environment)
  File 
"C:\Users\kkomkov.TIMACAD\Desktop\web2py\applications\admin\views\debug/breakpoints.html",
 line 130, in 
});
  File "C:\Python\lib\encodings\cp1251.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 6123: 
character maps to 

Error snapshot [image: help] 


UnicodeDecodeError('charmap' codec can't decode byte 0x98 in position 6123: 
character maps to )

inspect attributes
Frames
   
   - 
   
   *File C:\Users\kkomkov.TIMACAD\Desktop\web2py\gluon\restricted.py in 
   restricted at line 219* код аргументы переменные
   - 
   
   *File 
   
C:\Users\kkomkov.TIMACAD\Desktop\web2py\applications\admin\views\debug\breakpoints.html
 
   in  at line 130* код аргументы переменные
   - 
   
   *File C:\Python\lib\encodings\cp1251.py in decode at line 23* код 
   аргументы переменные
   Function argument list
   
   (self=, input=b'# -*- 
   coding: utf-8 -*-\r\n# -...r\n return 
   response.download(request, db)\r\n', final=True)
   Code listing
   
   18.
   19.
   20.
   21.
   22.
   23.
   24.
   25.
   26.
   27.
   
   def encode(self, input, final=False):
   return codecs.charmap_encode(input,self.errors,encoding_table)[0]
   
   class IncrementalDecoder(codecs.IncrementalDecoder):
   def decode(self, input, final=False):
   return codecs.charmap_decode(input,self.errors,decoding_table)[0]
   
   class StreamWriter(Codec,codecs.StreamWriter):
   pass
   
   Variables
   global codecs 
   codecs.charmap_decode 
   input b'# -*- coding: utf-8 -*-\r\n# -...r\n return 
   response.download(request, db)\r\n'
   self 
   self.errors 'strict'
   global decoding_table 
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f
 
   !"#$%&\'()*+,-./...ПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя'
   

-- 
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/8fc6fabe-669e-428c-bdeb-c863ae85230d%40googlegroups.com.


[web2py] How web2py work with blob

2019-10-17 Thread Константин Комков
In my table I have Field('GRAPH'). In database (firebird 2.5) type if this 
field is BLOB. But if in tables.py I indicate that field as blob then 
web2py return error:
 Invalid base64-encoded string: number of data 
characters (17) cannot be 1 more than a multiple of 4Версия
web2py™ Version 2.18.5-stable+timestamp.2019.04.08.04.22.03
Python Python 3.7.3: C:\Python\python.exe (prefix: C:\Python)
Error snapshot [image: help] 


Error(Invalid base64-encoded string: number of data characters (17) cannot 
be 1 more than a multiple of 4)
Function argument list

(s=b'\x01\x00\x00\x00\x03\x00\x00\x00\x00\xc0W\xe5@...0\x00\x00`\x7f\xe5@\x00\x00\x00\x00\x00\x85\xe5@',
 
altchars=None, validate=False)
Code listing

82.
83.
84.
85.
86.
87.
88.
89.
90.
91.

altchars = _bytes_from_decode_data(altchars)
assert len(altchars) == 2, repr(altchars)
s = s.translate(bytes.maketrans(altchars, b'+/'))
if validate and not re.match(b'^[A-Za-z0-9+/]*={0,2}$', s):
raise binascii.Error('Non-base64 digit found')
return binascii.a2b_base64(s)


def standard_b64encode(s):
"""Encode bytes-like object s using the standard Base64 alphabet.

Variables
global binascii 
binascii.a2b_base64 
s 
b'\x01\x00\x00\x00\x03\x00\x00\x00\x00\xc0W\xe5@...0\x00\x00`\x7f\xe5@\x00\x00\x00\x00\x00\x85\xe5@'It's
 
not problem because if I not indicate type for that field I can do my 
query. It's interesting why web2py reading base64 string, because blob is 
not always base64.

-- 
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/f5179bd6-6544-4df8-9b70-1caadacb41f1%40googlegroups.com.


[web2py] Re: About response.toolbar

2019-10-16 Thread Константин Комков
That page loads very fast. All that queries (more then 100) don't execute 
on one pages, therefore I asked what is thats queries. All of them contains 
in my app but in different functions. I use cache for first 8 queries like 
that:
if not 'edu_lvl' in globals():
def getConst():
edu_lvl = {rec.id:rec.name for rec in db(db.s_edu_level).select(db.
s_edu_level.id,db.s_edu_level.name)}
edu_inst={rec.id:rec.name for rec in db(db.s_edu_inst).select(db.
s_edu_inst.id,db.s_edu_inst.name)}
hostel={rec.id:rec.name for rec in db(db.s_hostel).select(db.
s_hostel.id,db.s_hostel.name)}
medal={rec.id:rec.name for rec in db(db.s_medal).select(db.s_medal.
id,db.s_medal.name)}
region={rec.id:rec.name for rec in db(db.s_region).select(db.
s_region.id,db.s_region.name)}
country={rec.id:rec.name for rec in db(db.s_country).select(db.
s_country.id,db.s_country.name)}
kladr_type={rec.id:rec.name for rec in db(db.s_kladr_loc_type).
select(db.s_kladr_loc_type.id,db.s_kladr_loc_type.name)}
vuzName=db(db.t_const.name == 'VUZ_KR').select(db.t_const.text).
first()
return edu_lvl,edu_inst,hostel,medal,region,country,kladr_type,
vuzName

edu_lvl,edu_inst,hostel,medal,region,country,kladr_type,vuzName = cache.
ram('consts', lambda: getConst(), time_expire=60*60*24)
Moreover that queries belong different users. It's reason why quantity of 
them more then 100. I thought that it's queries for period of time.
About my last questions, I wanted to write: are there way to put buttons in 
row like on picture.

-- 
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/e4a26ab2-3d30-4931-b418-dc72e7348635%40googlegroups.com.


Re: [web2py] Create name for additional column in query

2019-10-15 Thread Константин Комков
No problem, I understand that I need to use with_alias('my_column_name').
Thank you!

вт, 15 окт. 2019 г., 18:04 Massimiliano :

> Sorry I miss a piece:
>
> sumAuditorHours = (db.a_wlp2_distrib.LC_HOURS + db.a_wlp2_distrib.SM_HOURS
> + db.a_wlp2_distrib.LB_HOURS)
> fields = [db.s_disc_names.id.with_alias('id'),
>   db.s_disc_names.FULL_NAME-with_alias('full_name'),
>   db.a_wlp2.CHAIR.with_alias('chair'),
>   sumAuditorHours.with_alias('auditor_hours'),
>  ]
> subjects = db((db.a_groups.id == group) & (db.a_wlp2_distrib.MODULE ==
> module) & (db.a_wlp2.PARENT_ITEM != None)).select(*fields, ...
>
>
>
> On Tue, Oct 15, 2019 at 3:00 PM Massimiliano  wrote:
>
>> fields = [db.s_disc_names.id.with_alias('id'),
>>   db.s_disc_names.FULL_NAME-with_alias('full_name'),
>>   db.a_wlp2.CHAIR.with_alias('chair')
>>  ]
>> subjects = db((db.a_groups.id == group) & (db.a_wlp2_distrib.MODULE ==
>> module) & (db.a_wlp2.PARENT_ITEM != None)).select(*fields, ...
>>
>>
>>
>> On Tue, Oct 15, 2019 at 1:53 PM Константин Комков 
>> wrote:
>>
>>> I have that query:
>>> sumAuditorHours = db.a_wlp2_distrib.LC_HOURS +
>>> db.a_wlp2_distrib.SM_HOURS + db.a_wlp2_distrib.LB_HOURS
>>> subjects = db((db.a_groups.id == group) & (db.a_wlp2_distrib.MODULE ==
>>> module) & (db.a_wlp2.PARENT_ITEM != None)).select(db.s_disc_names.id
>>> ,db.s_disc_names.FULL_NAME,db.a_wlp2.CHAIR,sumAuditorHours,orderby=db.s_disc_names.FULL_NAME,
>>> join=[db.a_wlp2.on(db.a_groups.WLP == db.a_wlp2.WLP),
>>> db.a_wlp2_distrib.on(db.a_wlp2.id == db.a_wlp2_distrib.WLP_ITEM),
>>> db.s_disc_names.on(db.a_wlp2.DISC_NAME == db.s_disc_names.id)]
>>> )
>>> db._lastsql looks like:
>>> SELECT s_disc_names.id, s_disc_names.FULL_NAME, a_wlp2.CHAIR,
>>> ((a_wlp2_distrib.LC_HOURS + a_wlp2_distrib.SM_HOURS) +
>>> a_wlp2_distrib.LB_HOURS)
>>> FROM a_groups
>>> JOIN a_wlp2 ON (a_groups.WLP = a_wlp2.WLP)
>>> JOIN a_wlp2_distrib ON (a_wlp2.id = a_wlp2_distrib.WLP_ITEM)
>>> JOIN s_disc_names ON (a_wlp2.DISC_NAME = s_disc_names.id)
>>> WHERE (((a_groups.id = 2277) AND (a_wlp2_distrib.MODULE = 3)) AND
>>> (a_wlp2.PARENT_ITEM IS NOT NULL)) ORDER BY s_disc_names.FULL_NAME
>>> How can I add *as my_column_name?*
>>> Now rows looks like on picture.
>>>
>>> Thank you.
>>>
>>>
>>>
>>> --
>>> 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/871e5991-8ddb-4c85-a1a9-72accc1c5aba%40googlegroups.com
>>> <https://groups.google.com/d/msgid/web2py/871e5991-8ddb-4c85-a1a9-72accc1c5aba%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>
>>
>> --
>> Massimiliano
>>
>
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/GiDioBnqHts/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/CANPTPxKc8HqS7JsU%2ByzB8FN4%2BDV7Oz8%3DR6DET98H-mD8xDojew%40mail.gmail.com
> <https://groups.google.com/d/msgid/web2py/CANPTPxKc8HqS7JsU%2ByzB8FN4%2BDV7Oz8%3DR6DET98H-mD8xDojew%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAM7z-VkhUHg2aeYn4vML31JHAa3rGMq2zoyDBJ1xGGyZtseChg%40mail.gmail.com.


[web2py] Create name for additional column in query

2019-10-15 Thread Константин Комков
I have that query:
sumAuditorHours = db.a_wlp2_distrib.LC_HOURS + db.a_wlp2_distrib.SM_HOURS + 
db.a_wlp2_distrib.LB_HOURS
subjects = db((db.a_groups.id == group) & (db.a_wlp2_distrib.MODULE == 
module) & (db.a_wlp2.PARENT_ITEM != 
None)).select(db.s_disc_names.id,db.s_disc_names.FULL_NAME,db.a_wlp2.CHAIR,sumAuditorHours,orderby=db.s_disc_names.FULL_NAME,
join=[db.a_wlp2.on(db.a_groups.WLP == db.a_wlp2.WLP),
db.a_wlp2_distrib.on(db.a_wlp2.id == db.a_wlp2_distrib.WLP_ITEM),
db.s_disc_names.on(db.a_wlp2.DISC_NAME == db.s_disc_names.id)]
)
db._lastsql looks like:
SELECT s_disc_names.id, s_disc_names.FULL_NAME, a_wlp2.CHAIR, 
((a_wlp2_distrib.LC_HOURS + a_wlp2_distrib.SM_HOURS) + 
a_wlp2_distrib.LB_HOURS)
FROM a_groups
JOIN a_wlp2 ON (a_groups.WLP = a_wlp2.WLP)
JOIN a_wlp2_distrib ON (a_wlp2.id = a_wlp2_distrib.WLP_ITEM)
JOIN s_disc_names ON (a_wlp2.DISC_NAME = s_disc_names.id)
WHERE (((a_groups.id = 2277) AND (a_wlp2_distrib.MODULE = 3)) AND 
(a_wlp2.PARENT_ITEM IS NOT NULL)) ORDER BY s_disc_names.FULL_NAME
How can I add *as my_column_name?*
Now rows looks like on picture.

Thank you.



-- 
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/871e5991-8ddb-4c85-a1a9-72accc1c5aba%40googlegroups.com.


[web2py] About response.toolbar

2019-10-15 Thread Константин Комков
What I see on picture? What is that queries?
Are there way to put toolbar buttons in string?

Thank you.

-- 
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/b484b5a4-5971-4f3b-8218-87f379c568ee%40googlegroups.com.


[web2py] Can I use session for personal data

2019-10-15 Thread Константин Комков
In students cabinet I have 5 pages. In each page I have query to database, 
that's query is not the same now, but I can do one universal. Can I create 
class in sessions and store there personal data?
If I use cache is it store data for all or only for auth user?

Thank you.

-- 
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/9b6b87d9-fa39-474b-a296-536239fad3d9%40googlegroups.com.


[web2py] Re: Can I use SQLFORM for get id row (only read)?

2019-09-11 Thread Константин Комков
It's work:
if form.validate():
form.vars.id = db((db.tt_main.MODULE == form.vars.MODULE) & 
(db.tt_main.GROUP_ID 
== form.vars.GROUP_ID)).select(db.tt_main.id).first().id

-- 
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/4b5f1d90-3403-4446-8adc-7e26961b960d%40googlegroups.com.


[web2py] Can I use SQLFORM for get id row (only read)?

2019-09-10 Thread Константин Комков
Hello! I have SQLFORM:
db.tt_main.GROUP_ID.requires = IS_IN_DB(db((db.a_groups.id == db.tt_main.
GROUP_ID) & (db.a_groups.INACTIVE == 0) & (db.a_groups.FO == 1)),db.a_groups
.id,'%(NAME)s')
db.tt_main.MODULE.requires = IS_IN_DB(db(db.tt_main.MODULE), db.tt_main.
MODULE)
form = SQLFORM(db.tt_main,fields=['MODULE','GROUP_ID'],labels = {'MODULE':T(
'Module'),'GROUP_ID':T('Name of group')},submit_button=T('Select timetable'
))
if form.validate():
#don't work ↓ 
#form.vars.id = db.person.*select*(**dict(form.vars))
for that table of timetables:
db.define_table(
'tt_main',
Field('GROUP_ID','reference a_groups',unique=True),
Field('MODULE', 'integer',unique=True),
migrate=False
)
If I add readonly=True,record_id=True for SQLFORM None in Form on site, 
like on picture. I just want get id of timetable in user interface for 
create ability edit it.

-- 
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/ac42423d-7179-4312-8454-0cab9929b2cd%40googlegroups.com.


[web2py] Re: Interaction between two selects

2019-09-05 Thread Константин Комков
Thank you! I realised it using array, which I transferred in JS, like that:
subcategoryArr = '['
for row in rows:
subcategoryArr += '[' + str(row.id) + ',' + str(row.ID_CATEGORY) + 
'],'
subcategoryArr = subcategoryArr[0:-1]+']'
where row.id is ID of my subcategory.
And JS:
$(function() {
 for (var k = 0; k < $("#recipes_ID_SUBCATEGORY")[0].childNodes.length; k++) 
{
 $($("#recipes_ID_SUBCATEGORY")[0].childNodes[k]).css('display', 'none');
 }
 
 for (var i = 0; i < subcategory.length; i++) {
 if (subcategory[i][1]==$("#category").val()) { 
 for (var k = 0; k < $("#recipes_ID_SUBCATEGORY")[0].childNodes.length; k++) 
{
 if ($($("#recipes_ID_SUBCATEGORY")[0].childNodes[k]).val() == subcategory[i
][0]) {
 $($("#recipes_ID_SUBCATEGORY")[0].childNodes[k]).css('display', 'block');
 }
 }
 }
 }
 
 $("#category").on("change", function(){
 //hide all
 for (var k = 0; k < $("#recipes_ID_SUBCATEGORY")[0].childNodes.length; k++) 
{
 $($("#recipes_ID_SUBCATEGORY")[0].childNodes[k]).css('display', 'none');
 }
 
 for (var i = 0; i < subcategory.length; i++) {
 if (subcategory[i][1]==$("#category").val()) { 
 for (var k = 0; k < $("#recipes_ID_SUBCATEGORY")[0].childNodes.length; k++) 
{
 if ($($("#recipes_ID_SUBCATEGORY")[0].childNodes[k]).val() == subcategory[i
][0]) {
 $($("#recipes_ID_SUBCATEGORY")[0].childNodes[k]).css('display', 'block');
 }
 }
 }
 }
 });
});



-- 
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/da829943-f71e-44fa-b3fb-0a23bf326c9e%40googlegroups.com.


[web2py] Interaction between two selects

2019-08-29 Thread Константин Комков
Is there way create interaction between two selects in SQLFORM. 
I have these tables in *tables.py*:
db.define_table(
'categories',
Field('PRIORITY','integer'),
migrate=False)

db.define_table(
't_categories_names',
Field('ID_CATEGORY','reference categories',writable=False,readable=False
),
Field('LANGUAGE','reference languages'),
Field('NAME',length=30),
primarykey=['ID_CATEGORY'],
migrate=False)

db.define_table(
'subcategories',
Field('ID_CATEGORY','reference categories'),
migrate=False)

db.define_table(
't_subcategories_names',
Field('ID_SUBCATEGORY','reference subcategories'),
Field('LANGUAGE','reference languages'),
Field('NAME',length=30,unique=True),
primarykey=['ID_SUBCATEGORY'],
migrate=False)

db.define_table(
'recipes',
Field('ID_SUBCATEGORY','reference subcategories'),
Field('IMAGE','upload'),
migrate=False)
I use SQLFORM with extra field for 'category' in controller default.py:
def addRecipe():
db.recipes.ID_SUBCATEGORY.requires = IS_IN_DB(db((db.
t_subcategories_names.ID_SUBCATEGORY == db.subcategories.id) & (db.
t_subcategories_names.LANGUAGE == auth.user.language)),db.
t_subcategories_names.ID_SUBCATEGORY,'%(NAME)s')
categories = {rec.categories.id:rec.t_categories_names.NAME for rec in 
db((db.categories.id == db.t_categories_names.ID_CATEGORY) & (db.
t_categories_names.LANGUAGE == auth.user.language)).select(db.categories.id,
db.t_categories_names.NAME,orderby=db.categories.PRIORITY)}


form = SQLFORM(db.recipes,fields=['ID_SUBCATEGORY','IMAGE'],labels = {
'ID_SUBCATEGORY':T('Subcategory'),'IMAGE':T('Image')})
my_extra_element = DIV(
LABEL(
T('Category'),
_class='form-control-label col-sm-3'
),
DIV(
SELECT(
*[OPTION(value_, _value=key_) for key_, value_ in iter(
categories.items())],
_class='form-control'
),
_class='col-sm-9'
),
_class='form-group row'
)
form[0].insert(0,my_extra_element)
if form.process().accepted:
response.flash='Thanks for filling the form'
return dict(form=form)
I have result like on picture. As you can see if user have choosen 'Drinks' 
select with subcategory contain all names for all categories.
P.S. I can do interaction between two selects with jquery, but I want to 
know is there way do it with web2py tools like widget maybe with 
autocomplete or options.widget.

-- 
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/5c38b608-088c-43e4-b9fc-9841a4cdfeff%40googlegroups.com.


[web2py] Re: New questions about translation

2019-08-21 Thread Константин Комков
I can do it!) I transferred table 'languages' from tables.py to db.py, 
becouse I need use it in extra_fields when tables.py file is not still 
included.
db.py
db.define_table(
'languages',
Field('NAME',length=30)
)
auth.settings.extra_fields['auth_user']= [Field('language','reference 
languages',label=T('Language'),requires = IS_IN_DB(db,db.languages.id,
'%(NAME)s'))]
Result was like on picture, but I want to ask why I had one empty option in 
select? Is there way to exclude it?  

-- 
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/57cc8820-0e6f-4ec7-9735-e0ed3b238360%40googlegroups.com.


[web2py] Is there way to trace web2py files?

2019-08-19 Thread Константин Комков
Is there way to trace web2py files? For example, URL function is 
interesting for me and I found its description in html.py then I want to 
know how it work step by step when it's called from my app...
Also I created breakpoint in my controller and push the button like on 
picture, then I had error:
Ticket ID

127.0.0.1.2019-08-19.17-06-06.a8a926bd-ab4a-4133-ae06-b94c601fb30a
 'charmap' codec can't decode byte 0x98 in 
position 8077: character maps to Версия
web2py™ Version 2.18.5-stable+timestamp.2019.04.08.04.22.03
Python Python 3.7.3: C:\Python\python.exe (prefix: C:\Python)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.

Traceback (most recent call last):
  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py\gluon\restricted.py", line 219, 
in restricted
exec(ccode, environment)
  File 
"C:\Users\kkomkov.TIMACAD\Desktop\web2py\applications\admin\views\debug/breakpoints.html",
 line 130, in 
});
  File "C:\Python\lib\encodings\cp1251.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 8077: 
character maps to 

Error snapshot [image: help] 


UnicodeDecodeError('charmap' codec can't decode byte 0x98 in position 8077: 
character maps to )

inspect attributes
Frames
   
   - 
   
   *File C:\Users\kkomkov.TIMACAD\Desktop\web2py\gluon\restricted.py in 
   restricted at line 219* код аргументы переменные
   - 
   
   *File 
   
C:\Users\kkomkov.TIMACAD\Desktop\web2py\applications\admin\views\debug\breakpoints.html
 
   in  at line 130* код аргументы переменные
   - 
   
   *File C:\Python\lib\encodings\cp1251.py in decode at line 23* код 
   аргументы переменные
   Function argument list
   
   (self=, input=b'# -*- 
   coding: utf-8 -*-\r\n# -...r\n return 
   response.download(request, db)\r\n', final=True)
   Code listing
   
   18.
   19.
   20.
   21.
   22.
   23.
   24.
   25.
   26.
   27.
   
   def encode(self, input, final=False):
   return codecs.charmap_encode(input,self.errors,encoding_table)[0]
   
   class IncrementalDecoder(codecs.IncrementalDecoder):
   def decode(self, input, final=False):
   return codecs.charmap_decode(input,self.errors,decoding_table)[0]
   
   class StreamWriter(Codec,codecs.StreamWriter):
   pass
   
   Variables
   global codecs 
   codecs.charmap_decode 
   input b'# -*- coding: utf-8 -*-\r\n# -...r\n return 
   response.download(request, db)\r\n'
   self 
   self.errors 'strict'
   global decoding_table 
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f
 
   !"#$%&\'()*+,-./...ПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя'
   

-- 
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/031639ac-3a48-438c-bbd8-b11fa256191e%40googlegroups.com.


[web2py] Re: How can I insert image in HTML from database?

2019-08-17 Thread Константин Комков
If I use cache, for example:
def putRecipesInCache():
recipesCache = cache.ram('recipes', lambda: db().select(db.recipes.IMAGE
), time_expire=60*60*24)
return recipesCache


def index():
rows = putRecipesInCache()
image = ''
for row in rows:
if row.IMAGE is None:
image += ''
else:
import codecs
base64_data = codecs.encode(row.IMAGE.read(), 'base64')
base64_text = codecs.decode(base64_data, 'ascii')
image += '' % base64_text
return XML()

I get error:
Error snapshot [image: help] 


DatabaseError(('Cursor.read_output_blob/isc_open_blob2:\n- SQLCODE: -904\n- 
invalid database handle (no active connection)', -904, 335544324))

inspect attributes
Frames
   
   - 
   
   *File C:\web2py\gluon\restricted.py in restricted at line 219* код 
   аргументы переменные
   - 
   
   *File C:\web2py\applications\Recipes\controllers\default.py in  
   at line 226* код аргументы переменные
   - 
   
   *File C:\web2py\gluon\globals.py in  at line 421* код аргументы 
   переменные
   - 
   
   *File C:\web2py\applications\Recipes\controllers\default.py in index at 
   line 74* код аргументы переменные
   - 
   
   *File C:\web2py\applications\Recipes\controllers\default.py in 
   selectRecipes at line 146* код аргументы переменные
   - 
   
   *File C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py 
   in read at line 4764* код аргументы переменные
   - 
   
   *File C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py 
   in __ensure_open at line 4658* код аргументы переменные
   - 
   
   *File C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py 
   in __open at line 4667* код аргументы переменные
   Function argument list
   
   (self=)
   Code listing
   
   4662.
   4663.
   4664.
   4665.
   4666.
   4667.
   4668.
   4669.
   4670.
   4671.
   
  bs([ibase.isc_bpb_version1, ibase.isc_bpb_type, 1,
  ibase.isc_bpb_type_stream]))
   if db_api_error(self._isc_status):
   raise exception_from_status(DatabaseError,
   self._isc_status,
   
"Cursor.read_output_blob/isc_open_blob2:")
   # Get BLOB total length and max. size of segment
   result = ctypes.cast(ctypes.create_string_buffer(20),
buf_pointer)
   api.isc_blob_info(self._isc_status, self._blob_handle, 2,
   
   

-- 
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/1682f597-1f05-4072-a56e-adb03173d6d0%40googlegroups.com.


[web2py] Re: New questions about translation

2019-08-14 Thread Константин Комков
In the book I find three possible ways for that:
First it is customize auth_user table, but Massimo wrote that this way is 
not really recommended.
Second it is add extra_fields, but I don't know how can I add 
type 'list:string' for extra_field and work with it.
Third is modify profile function def myprofile(): return 
dict(form=auth.profile()), but for me more interesting auth.profile(), 
becouse I want add new field in auth.profile() form.
I hope somebody help me with it.

-- 
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/6fc900b2-b0f5-4317-8b5c-e5bd2239d60b%40googlegroups.com.


[web2py] Re: How can I insert image in HTML from database?

2019-08-12 Thread Константин Комков
Yes, I want get from database many images (maybe not all, but 100 or 50 
pictures). In your case for creating 1 page I need to do 101 or 51 query to 
database. I want have one query and transfer row.recipes.IMAGE as variable 
in img function. Somthing like that (but it's not work):
def index():
image = ''
rows = db().select(db.recipes.IMAGE)
for row in rows:
image += ''
image = XML(image)
return dict(image=image)

def img():
image = request.args(0)
if image:
return image.read()

-- 
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/bdc7d1ae-7dcb-4064-8a8c-32b1b35e9dea%40googlegroups.com.


[web2py] Re: How can I insert image in HTML from database?

2019-08-11 Thread Константин Комков
*Val K*, that case is work!)
def index():
image = XML('')
return dict(image=image)

def img():
row = db().select(db.recipes.IMAGE).first()
if row:
return row.IMAGE.read()
It seems very strange that return row.IMAGE.read() from img function work, 
but URL( 'default', args=row.IMAGE.read()) don't work.
I have not one image and get it in cycle. Are there variant use img 
function for it?
rows = db().select(db.recipes.IMAGE)
for row in rows:

-- 
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/adc0ecaf-d4c2-4f87-82b6-8649a4096f66%40googlegroups.com.


[web2py] Re: How can I insert image in HTML from database?

2019-08-11 Thread Константин Комков
If I have error I show it here. In case when I see error in console - "GET 
http://127.0.0.1:8000/Recipes/default/img 500 (Server Error)" I don't have 
errors in (http://127.0.0.1:8000/admin/default/errors/Recipes/old 
).
 
And if I try go to http://127.0.0.1:8000/Recipes/default/img I don't have 
error in (http://127.0.0.1:8000/admin/default/errors/Recipes/old 
)
 
too. On page I have message Server Error.

-- 
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/65b32137-e67d-4ede-a245-f2763bdea703%40googlegroups.com.


[web2py] Re: How can I insert image in HTML from database?

2019-08-10 Thread Константин Комков
Is from appadmin print screen

-- 
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/8e899847-3a7d-4126-a5c4-97dfeccafafc%40googlegroups.com.


[web2py] Re: How can I insert image in HTML from database?

2019-08-10 Thread Константин Комков
Full code which is work:
def index():
row = db().select(db.recipes.IMAGE).first()
import codecs
base64_data = codecs.encode(row.IMAGE.read(), 'base64')
base64_text = codecs.decode(base64_data, 'ascii')
image = XML('' % base64_text)
return dict(image=image)
Full code which isn't work:
def index():
image = XML('')
return dict(image=image)

def img():
row = db().select(db.recipes.IMAGE).first()
if row:
return response.stream(row.IMAGE)
Console - (GET http://127.0.0.1:8000/Recipes/default/img 500 (Server Error))

-- 
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/c877f59f-bb54-4b4e-9dc4-76a9262e7d41%40googlegroups.com.


[web2py] Re: How can I insert image in HTML from database?

2019-08-10 Thread Константин Комков
I use upload becouse if I will do query to blob field I have error and 
can't load page. In console was written - GET 
http://127.0.0.1:8000/Recipes/default/img 500 (Server Error). Previos 
message (GET http://127.0.0.1:8000/Recipes/default/img 404 (NOT FOUND).) 
was becouse I put img function inside index function.

-- 
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/c507e038-97ac-45b9-80d3-340d288a6d97%40googlegroups.com.


[web2py] Re: How can I insert image in HTML from database?

2019-08-10 Thread Константин Комков
Hmm, I restart web2py and now message is - GET 
http://127.0.0.1:8000/Recipes/default/img 404 (NOT FOUND).

-- 
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/c619c258-3ca7-49ac-9da4-187caf273c06%40googlegroups.com.


[web2py] Re: How can I insert image in HTML from database?

2019-08-10 Thread Константин Комков
In console was printed - GET http://127.0.0.1:8000/Recipes/default/img 500 
(Server Error).

-- 
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/f3c61039-c92e-4a86-bc4c-e7b6deae026e%40googlegroups.com.


[web2py] Re: How can I insert image in HTML from database?

2019-08-10 Thread Константин Комков
def img():
row = db().select(db.recipes.IMAGE).first()
if row:
return response.stream(row.IMAGE)
image = ''
>>> on HTML page no image.




-- 
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/29a63fa1-5202-4435-8f14-c05788897f72%40googlegroups.com.


Re: [web2py] Re: How can I insert image in HTML from database?

2019-08-09 Thread Константин Комков
Ok, I will register issue on github.

-- 
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/CAM7z-V%3D7AViw5bc-UEheY6Dg%3DVmGFTUN5SAR9nqtU2hYszo3Mw%40mail.gmail.com.


[web2py] Re: How can I insert image in HTML from database?

2019-08-09 Thread Константин Комков
I don't know why but if I do like that I have error:
table.py
db.define_table(
'recipes',
Field('NAME',length=512),
Field('IMAGE','*blob*'),
migrate=False
)
and query in controller:
db().select(db.recipes.IMAGE).first()
Версия
web2py™ Version 2.18.5-stable+timestamp.2019.04.08.04.22.03
Python Python 3.7.3: C:\Program Files (x86)\Python37-32\python.exe (prefix: 
C:\Program Files (x86)\Python37-32)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
  File "C:\web2py\applications\test\controllers/default.py", line 61, in 

  File "C:\web2py\gluon\globals.py", line 421, in 
self._caller = lambda f: f()
  File "C:\web2py\applications\test\controllers/default.py", line 9, in index
db().select(db.recipes.IMAGE).first()
  File "C:\web2py\gluon\packages\dal\pydal\objects.py", line 2395, in select
return adapter.select(self.query, fields, attributes)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 763, in 
select
return self._select_aux(sql, fields, attributes, colnames)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 742, in 
_select_aux
return processor(rows, fields, colnames, cacheable=cacheable)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 306, in parse
for row in rows
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 303, in 

self._parse(
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 232, in 
_parse
value = self.parse_value(value, fit, ft, blob_decode)
  File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 199, in 
parse_value
return self.parser.parse(value, field_itype, field_type)
  File "C:\web2py\gluon\packages\dal\pydal\parsers\__init__.py", line 100, in 
parse
return self.registered[field_itype](value, field_type)
  File "C:\web2py\gluon\packages\dal\pydal\parsers\__init__.py", line 75, in 
__call__
return self.call(value, field_type)
  File "C:\web2py\gluon\packages\dal\pydal\parsers\__init__.py", line 72, in 
_call
return self.f(self.parser, value)
  File "C:\web2py\gluon\packages\dal\pydal\parsers\base.py", line 37, in _blob
decoded = b64decode(to_bytes(value))
  File "C:\web2py\gluon\packages\dal\pydal\_compat.py", line 131, in to_bytes
raise TypeError('Expected bytes')
TypeError: Expected bytes

Error snapshot [image: help] 


TypeError(Expected bytes)

inspect attributes
Frames
   
   - 
   
   *File C:\web2py\gluon\restricted.py in restricted at line 219* код 
   аргументы переменные
   - 
   
   *File C:\web2py\applications\test\controllers\default.py in  at 
   line 61* код аргументы переменные
   - 
   
   *File C:\web2py\gluon\globals.py in  at line 421* код аргументы 
   переменные
   - 
   
   *File C:\web2py\applications\test\controllers\default.py in index at 
   line 9* код аргументы переменные
   - 
   
   *File C:\web2py\gluon\packages\dal\pydal\objects.py in select at line 
   2395* код аргументы переменные
   Code listing
   
   2390.
   2391.
   2392.
   2393.
   2394.
   2395.
   2396.
   2397.
   2398.
   2399.
   
   attributes.get('join', None),
   attributes.get('left', None),
   attributes.get('orderby', None),
   attributes.get('groupby', None))
   fields = adapter.expand_all(fields, tablenames)
   return adapter.select(self.query, fields, attributes)
   
   def iterselect(self, *fields, **attributes):
   adapter = self.db._adapter
   tablenames = adapter.tables(self.query,
   
   - 
   
   *File C:\web2py\gluon\packages\dal\pydal\adapters\base.py in select at 
   line 763* код аргументы переменные
   - 
   
   *File C:\web2py\gluon\packages\dal\pydal\adapters\base.py in _select_aux 
   at line 742* код аргументы переменные
   - 
   
   *File C:\web2py\gluon\packages\dal\pydal\adapters\base.py in parse at 
   line 306* код аргументы переменные
   - 
   
   *File C:\web2py\gluon\packages\dal\pydal\adapters\base.py in  
   at line 303* код аргументы переменные
   - 
   
   *File C:\web2py\gluon\packages\dal\pydal\adapters\base.py in _parse at 
   line 232* код аргументы переменные
   - 
   
   *File C:\web2py\gluon\packages\dal\pydal\adapters\base.py in parse_value 
   at line 199* код аргументы переменные
   - 
   
   *File C:\web2py\gluon\packages\dal\pydal\parsers\__init__.py in parse at 
   line 100* код аргументы переменные
   - 
   
   *File C:\web2py\gluon\packages\dal\pydal\parsers\__init__.py in __call__ 
   at line 75* код аргументы переменные
   - 
   
   *File 

[web2py] Re: How can I insert image in HTML from database?

2019-08-07 Thread Константин Комков
*Dave S*, maybe I don't see the out-of-the-box tool. I did all what were 
suggest *Rumos* and *Val K* like I understood:
row = db().select(db.recipes.IMAGE).first()
image = ''
and
tables.py
db.define_table(
'recipes',
Field('NAME',length=512),
Field('IMAGE','*upload*'),
migrate=False
)
After that I don't have error, but picture is unavailable.
HTML:

Also I tried do like that:
row = db().select(db.recipes.IMAGE).first()
stream = row.IMAGE
image = ''
And I have that HTML:


-- 
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/deee5b4e-4d55-4002-8627-a066a82f2bf4%40googlegroups.com.


[web2py] Re: How can I insert image in HTML from database?

2019-08-06 Thread Константин Комков
*Val K*, it is my table.py file:
db.define_table(
'recipes',
Field('NAME',length=512),
Field('IMAGE','upload'),
migrate=False
)
It's code in my default.py file:
row = db().select(db.recipes.IMAGE).first()

image = str(dir(row))
>>>
['IMAGE', '__bool__', '__call__', '__class__', '__contains__', '__copy__', 
'__delattr__', '__delitem__', '__dict__', '__dir__', '__doc__', '__eq__', 
'__format__', '__ge__', '__getattr__', '__getattribute__', '__getitem__', 
'__gt__', '__hash__', '__init__', '__init_subclass__', '__int__', 
'__iter__', '__le__', '__long__', '__lt__', '__module__', '__ne__', 
'__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', 
'__setitem__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 
'as_dict', 'as_json', 'as_xml', 'clear', 'copy', 'get', 'has_key', 'items', 
'iteritems', 'iterkeys', 'itervalues', 'keys', 'pop', 'update', 'values']

image = str(dir(row.IMAGE))
>>>
['_BlobReader__blob_get', '_BlobReader__blobid', '_BlobReader__bytes_read', 
'_BlobReader__charset', '_BlobReader__closed', '_BlobReader__db_handle', 
'_BlobReader__ensure_open', '_BlobReader__index', '_BlobReader__is_text', 
'_BlobReader__mode', '_BlobReader__open', '_BlobReader__opened', 
'_BlobReader__pos', '_BlobReader__python_charset', 
'_BlobReader__reset_buffer', '_BlobReader__tr_handle', '__class__', 
'__del__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', 
'__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', 
'__init__', '__init_subclass__', '__iter__', '__le__', '__lt__', 
'__module__', '__ne__', '__new__', '__next__', '__reduce__', 
'__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', 
'__subclasshook__', '__weakref__', '_blob_handle', '_isc_status', 
'blob_charset', 'blob_id', 'charset', 'close', 'closed', 'flush', 
'get_info', 'is_text', 'mode', 'next', 'read', 'readline', 'readlines', 
'seek', 'tell']

I can not do row.file.row.IMAGE


-- 
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/d8a4cfbc-65e1-4119-ac2b-25c25d2a9b22%40googlegroups.com.


[web2py] Re: How can I insert image in HTML from database?

2019-08-05 Thread Константин Комков
Hello! I can get image like that:
import codecs
base64_data = codecs.encode(row.recipes.IMAGE.read(), 'base64')
base64_text = codecs.decode(base64_data, 'ascii')
image = '' % base64_text
Thank all!

-- 
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/124be0f8-7944-4349-824a-a602a8de4a86%40googlegroups.com.


[web2py] Re: How can I insert image in HTML from database?

2019-08-03 Thread Константин Комков
Dave, I don't understand what means that string:
blob = db[somethingsomething].[copyblobltotmpfile]
Is your example only for '.jpeg' files or for another expansions too? 

-- 
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/cfd66faa-7e43-49d9-bfac-fc2e8635949f%40googlegroups.com.


Re: [web2py] Re: How can I insert image in HTML from database?

2019-08-02 Thread Константин Комков
Didn't work, errors was like in my first message. I had tried it already.

-- 
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/12d2fa50-0fce-40b8-917c-b17459d4d5eb%40googlegroups.com.


[web2py] Re: How can I insert image in HTML from database?

2019-08-02 Thread Константин Комков
What do you want to know?
tables.py
db.define_table(
'recipes',
Field('NAME',length=512),
Field('IMAGE'),
migrate=False
)
It's my database connection in db.py:
db = DAL('firebird://sysdba:masterkey@localhost/C:/HR.fdb', 
ignore_field_case=True, entity_quoting=False, pool_size=1, migrate_enabled=
False, db_codec='UTF-8')


-- 
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/3cf73bb8-3c63-47c3-88db-8f9c654798c7%40googlegroups.com.


[web2py] How can I insert image in HTML from database?

2019-08-02 Thread Константин Комков
I do like that:
row = db().select(db.recipes.IMAGE).first()
image = ''
I get error:
Версия
web2py™ Version 2.18.5-stable+timestamp.2019.04.08.04.22.03
Python Python 3.7.3: C:\Python\python.exe (prefix: C:\Python)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.

Traceback (most recent call last):
  File 
"C:\Users\kkomkov.TIMACAD\Desktop\web2py\gluon\packages\dal\pydal\objects.py", 
line 116, in __getattr__
return self.__getitem__(k)
  File 
"C:\Users\kkomkov.TIMACAD\Desktop\web2py\gluon\packages\dal\pydal\objects.py", 
line 103, in __getitem__
raise KeyError(key)
KeyError: 'file'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py\gluon\restricted.py", line 219, 
in restricted
exec(ccode, environment)
  File 
"C:\Users\kkomkov.TIMACAD\Desktop\web2py\applications\Recipes\controllers/default.py",
 line 176, in 
  File "C:\Users\kkomkov.TIMACAD\Desktop\web2py\gluon\globals.py", line 421, in 

self._caller = lambda f: f()
  File 
"C:\Users\kkomkov.TIMACAD\Desktop\web2py\applications\Recipes\controllers/default.py",
 line 12, in index
recipes = selectRecipes()
  File 
"C:\Users\kkomkov.TIMACAD\Desktop\web2py\applications\Recipes\controllers/default.py",
 line 111, in selectRecipes
image = ''
  File 
"C:\Users\kkomkov.TIMACAD\Desktop\web2py\gluon\packages\dal\pydal\objects.py", 
line 118, in __getattr__
raise AttributeError
AttributeError

Error snapshot [image: help] 


AttributeError()

inspect attributes
Frames
   
   - 
   
   *File C:\Users\kkomkov.TIMACAD\Desktop\web2py\gluon\restricted.py in 
   restricted at line 219* код аргументы переменные
   - 
   
   *File 
   
C:\Users\kkomkov.TIMACAD\Desktop\web2py\applications\Recipes\controllers\default.py
 
   in  at line 176* код аргументы переменные
   - 
   
   *File C:\Users\kkomkov.TIMACAD\Desktop\web2py\gluon\globals.py in 
at line 421* код аргументы переменные
   - 
   
   *File 
   
C:\Users\kkomkov.TIMACAD\Desktop\web2py\applications\Recipes\controllers\default.py
 
   in index at line 12* код аргументы переменные
   - 
   
   *File 
   
C:\Users\kkomkov.TIMACAD\Desktop\web2py\applications\Recipes\controllers\default.py
 
   in selectRecipes at line 111* код аргументы переменные
   
*File 
C:\Users\kkomkov.TIMACAD\Desktop\web2py\gluon\packages\dal\pydal\objects.py 
in __getattr__ at line 118* код аргументы переменные
Function argument list

(self=, k='file')
Code listing

113.
114.
115.
116.
117.
118.
119.
120.
121.
122.


def __getattr__(self, k):
try:
return self.__getitem__(k)
except KeyError:
raise AttributeError

def __copy__(self):
return Row(self)

Variables

   - builtinAttributeError 
   - If I do like that:
   rows = db().select(db.recipes.ALL)
   for row in rows:
   if row.recipes.IMAGE is None:
   image = ''
   else:
   image = ''
   - I get HTML without image:
   - 
   - 
   

-- 
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/a782e7f9-ff3d-4d0c-affb-5f80bd94f480%40googlegroups.com.


[web2py] New questions about translation

2019-08-02 Thread Константин Комков
Messages in flash have uncorrect translate, like on picture 1.
db.py
if auth.user_id is not None:
if auth.user.language is not None:
if auth.user.language == 1:
T.force('en')
elif auth.user.language == 2:
T.force('ru')
else:
T.force('ru')
else:
T.force('ru')


auth.settings.extra_fields['auth_user']= [Field('language','integer',label=T
('Language'))]
auth.define_tables(username=False, signature=False)
Now if I open profile I see field language, like on picture 2. I created 
table 'LANGUAGES' with 'id' and 'NAME' and foreign key in table 
'AUTH_USER'. How can I change field input on select with languages names?


-- 
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/daa27991-0518-4d2b-9240-15e540aacbeb%40googlegroups.com.


[web2py] Re: How can I get value from my extra_fields?

2019-08-01 Thread Константин Комков
I did'n try to login/logout. I do it and all work!

-- 
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/abcd46d1-225c-42bd-a7f9-3ea23d4cb4a1%40googlegroups.com.


Re: [web2py] How can I get value from my extra_fields?

2019-08-01 Thread Константин Комков
It's query to database I thought that I can get it from session like
auth.user. Thank you for answer!

чт, 1 авг. 2019 г., 21:21 Val K :

> Try db.auth_user(auth.user_id).language
>
> --
> 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/7cgw04bcOiA/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/2b60f329-b68f-4cc5-b5a2-fc9f23483d74%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/CAM7z-V%3Drr9yfMqZmLeWTdw%3D-s42HsehwzG8cpO%3DkiJyLzdb_oQ%40mail.gmail.com.


[web2py] How can I get value from my extra_fields?

2019-08-01 Thread Константин Комков
I added field 'language' im my auth_user table in database. My file db.py 
contain:
auth = Auth(db, host_names=configuration.get('host.names'))

*auth*
*.settings.extra_fields['auth_user']= [Field('language')]*
auth.define_tables(username=False, signature=False)
How can I get value of language for current login user?
myStr = ''
for a in auth.user:
myStr += a+': '+str(auth.user.get(a))+''
myStr >>>
id: 1
first_name: Константин
last_name: Комков
email: t...@gmail.com
registration_key: 
reset_password_key: 
registration_id:
test = str(auth.settings.extra_fields.get('auth_user')[0])
test >>>
auth_user.language

-- 
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/58233646-4ca0-4b19-9e33-90536918a66e%40googlegroups.com.


[web2py] Questions about translations and pluralization

2019-07-30 Thread Константин Комков
1. If I want use plural for book without numbers what I need to do?
I want to write word - books.

2. If I write
T("You have %s %%{book}", symbols=10)
I get: You have 10 books
If I want to change language, like 
T.force('ru')
I get: 'You have 10 book'. I want to get: 'У меня есть 10 книг'
What I need to write in laguages/ru.py?

3. If I add to words in laguages/ru.py, like:
'add':'добавить',
'word':'слово',
I wrote:
T.force('ru')
T("add word")
I got: 'add word'
If I write:
T("add")+" "+T("word")
I get: 'добавить слово'. Are there way to translate both words in time?

4. If I want to get uppercase letter I tried use something like that:

%%{[][]}

but nothing work. How can I get: 'Add' or 'Добавить'?

Thank you!





-- 
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/0f0f53ee-24a6-461f-8468-f6430d649af9%40googlegroups.com.


[web2py] Re: Como editar um decoratordo web2py

2019-07-30 Thread Константин Комков
As variant, you can write decorator by yourself, like:
def yourDecorator(fun):
def decorated():

if (auth.user_id is not None):
redirect(URL('yourController','yourFunction'))
else:
return fun()
return decorated

@yourDecorator
def yourFunction():


-- 
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/421eafd7-87ab-4f8e-8838-82ddfa873911%40googlegroups.com.


[web2py] Re: Are there beautiful way to add variable in script?

2019-07-29 Thread Константин Комков
Dave S, thank you it's what I looked for. In russian Book that helpers was 
missed.

-- 
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/44e1a408-98ad-4dac-b548-8c83202ff148%40googlegroups.com.


[web2py] Are there beautiful way to add variable in script?

2019-07-29 Thread Константин Комков
Are there beautiful way to add variable in script?
I know that ways:
1. It's very simple, but it's not useful to write many javascript code in 
controller.
controller.py
XML('console.log('+myVariable+');'),
2. In that case I have 2 script files in HTML. First contain my variable, 
second contain javascript code and get variable from first. It's not good 
too.
controller.py
def index():
jsScript = XML('')
myVariable = '[[1,1,"text text"],[1,2,"text text"],...,[12,20,"tex 
text"]]'
return dict(jsScript=jsScript,myVariable=myVariable)
index.html

var myVariable = '{{=myVariable}}';

{{=jsScript}}
Also I can write all js code in first script tag, but that practice is not 
normal too. I want have python files with python code, html files with html 
and js files with javascript. I tried add {{=myVariable}} in js file, but 
it's not work, as I think becouse it's static folder.





-- 
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/a7a1ac4a-ddb3-45e9-aa71-3afae84aee2e%40googlegroups.com.


[web2py] Keywords in welcome app can't be available

2019-07-28 Thread Константин Комков
Hello!
Keywords in welcome app can't be available.
HTML


**




-- 
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/a7bb81fd-22ad-4dc1-91dc-ee47c9c78974%40googlegroups.com.


[web2py] Re: Sometging wrong with utf-8

2019-07-19 Thread Константин Комков
That error was created becouse in 'cuisines' table field NAME have charset 
'NONE' and collate 'NONE'. 
>
>
>- 
>
>

-- 
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/97b942c7-a604-402c-be89-f709796338dd%40googlegroups.com.


[web2py] Re: Sometging wrong with utf-8

2019-07-19 Thread Константин Комков
rows = db(
(db.recipes.ID_CUISINE==db.cuisines.id)
).select(db.recipes.ALL)
db._lastsql >>>
('SELECT recipes.ID_CUISINE, recipes.DESCRIPTION, recipes.ID_AUTHOR, 
recipes.ID_CATEGORY, recipes.EXPIRATION_DATE, recipes.IMAGE FROM recipes, 
cuisines WHERE (recipes.ID_CUISINE = cuisines.id);', 0.04505515098571777)
rows = db(
(db.recipes.ID_CUISINE==db.cuisines.id)
).select(db.recipes.ALL,db.cuisines.NAME)
db._lastsql >>> Error: 'utf-8' codec can't decode byte 0xf0
rows = db(db.recipes).select(join=db.cuisines.on(db.recipes.ID_CUISINE == db
.cuisines.id))
db._lastsql >>> Error: 'utf-8' codec can't decode byte 0xf0
my tables:
db.define_table(
'recipes',
Field('ID_CUISINE','integer'),
Field('DESCRIPTION'),
Field('ID_AUTHOR','integer'),
Field('ID_CATEGORY','integer'),
Field('EXPIRATION_DATE'),
Field('IMAGE'),
primarykey=['ID_CUISINE','ID_AUTHOR','ID_CATEGORY'],
migrate=False
)

db.define_table(
'cuisines',
Field('NAME','string'),
migrate=False
)

-- 
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/d9c4ad66-a03a-47ec-b616-baa030f03a49%40googlegroups.com.


[web2py] Sometging wrong with utf-8

2019-07-18 Thread Константин Комков
rows = db(
 (db.recipes.ID_CUISINE==db.cuisines.id) & 
 (db.recipes.ID_AUTHOR==db.authors.id) & 
 (db.recipes.ID_CATEGORY==db.categories.id)
 ).select(db.cuisines.NAME,db.authors.NAME,db.categories.NAME,db.recipes.ALL
)
Ticket ID

127.0.0.1.2019-07-18.22-56-57.1cf3eb52-85aa-418d-b7f9-51ac287014a9
 'utf-8' codec can't decode byte 0xf0 in 
position 0: invalid continuation byteВерсия
web2py™ Version 2.18.5-stable+timestamp.2019.04.08.04.22.03
Python Python 3.7.3: C:\Program Files (x86)\Python37-32\python.exe (prefix: 
C:\Program Files (x86)\Python37-32)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.

Traceback (most recent call last):
  File "D:\Загрузки\web2py_src\web2py\gluon\restricted.py", line 219, in 
restricted
exec(ccode, environment)
  File 
"D:\Загрузки\web2py_src\web2py\applications\Recipes\controllers/default.py", 
line 89, in 
  File "D:\Загрузки\web2py_src\web2py\gluon\globals.py", line 421, in 
self._caller = lambda f: f()
  File 
"D:\Загрузки\web2py_src\web2py\applications\Recipes\controllers/default.py", 
line 19, in index
).select(db.cuisines.NAME,db.authors.NAME,db.categories.NAME,db.recipes.ALL)
  File "D:\Загрузки\web2py_src\web2py\gluon\packages\dal\pydal\objects.py", 
line 2395, in select
return adapter.select(self.query, fields, attributes)
  File 
"D:\Загрузки\web2py_src\web2py\gluon\packages\dal\pydal\adapters\base.py", line 
763, in select
return self._select_aux(sql, fields, attributes, colnames)
  File 
"D:\Загрузки\web2py_src\web2py\gluon\packages\dal\pydal\adapters\base.py", line 
719, in _select_aux
rows = self._select_aux_execute(sql)
  File 
"D:\Загрузки\web2py_src\web2py\gluon\packages\dal\pydal\adapters\base.py", line 
714, in _select_aux_execute
return self.cursor.fetchall()
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py", 
line 3730, in fetchall
return [row for row in self]
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py", 
line 3730, in 
return [row for row in self]
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py", 
line 3488, in next
row = self.fetchone()
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py", 
line 3690, in fetchone
return self._ps._fetchone()
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py", 
line 3359, in _fetchone
return self.__xsqlda2tuple(self._out_sqlda)
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py", 
line 2677, in __xsqlda2tuple
value = b2u(value, self.__python_charset)
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py", 
line 479, in b2u
return st.decode(charset)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 0: invalid 
continuation byte

Error snapshot [image: help] 


UnicodeDecodeError('utf-8' codec can't decode byte 0xf0 in position 0: 
invalid continuation byte)

inspect attributes
Frames
   
   - 
   
   *File D:\Загрузки\web2py_src\web2py\gluon\restricted.py in restricted at 
   line 219* код аргументы переменные
   - 
   
   *File 
   D:\Загрузки\web2py_src\web2py\applications\Recipes\controllers\default.py 
   in  at line 89* код аргументы переменные
   - 
   
   *File D:\Загрузки\web2py_src\web2py\gluon\globals.py in  at line 
   421* код аргументы переменные
   - 
   
   *File 
   D:\Загрузки\web2py_src\web2py\applications\Recipes\controllers\default.py 
   in index at line 19* код аргументы переменные
   - 
   
   *File D:\Загрузки\web2py_src\web2py\gluon\packages\dal\pydal\objects.py 
   in select at line 2395* код аргументы переменные
   - 
   
   *File 
   D:\Загрузки\web2py_src\web2py\gluon\packages\dal\pydal\adapters\base.py in 
   select at line 763* код аргументы переменные
   - 
   
   *File 
   D:\Загрузки\web2py_src\web2py\gluon\packages\dal\pydal\adapters\base.py in 
   _select_aux at line 719* код аргументы переменные
   - 
   
   *File 
   D:\Загрузки\web2py_src\web2py\gluon\packages\dal\pydal\adapters\base.py in 
   _select_aux_execute at line 714* код аргументы переменные
   - 
   
   *File C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py 
   in fetchall at line 3730* код аргументы переменные
   - 
   
   *File C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py 
   in  at line 3730* код аргументы переменные
   - 
   
   *File C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py 
   in next at line 3488* код аргументы переменные
   - 
   
   *File C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py 
   in fetchone at line 3690* код аргументы переменные
   - 
   
   *File C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py 
   in _fetchone at line 3359* код аргументы переменные
   - 
  

[web2py] Re: Entity_quoting and Firebird

2019-07-18 Thread Константин Комков
I understand - when web2py created auth tables automatically in welcome app 
I didn't add *entity_quoting=False*. 

-- 
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/b4b20c14-9df2-4fe9-93b0-829eac7e1729%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Entity_quoting and Firebird

2019-07-17 Thread Константин Комков
I created empty firebird database. Then I included it in welcome app. 
Web2py created auth tables. Then I registered in welcome app. I want to use 
this database in my app, but if I include it like:
db = DAL(configuration.get('db.uri'),pool_size=1,migrate_enabled=False,
entity_quoting=False,check_reserved=['all'])
I heve error:
 ('Error while preparing SQL 
statement:\n- SQLCODE: -204\n- Dynamic SQL Error\n- SQL error code = 
-204\n- Table unknown\n- AUTH_USER\n- At line 1, column 233', -204, 
335544569)Версия
web2py™ Version 2.18.5-stable+timestamp.2019.04.08.04.22.03
Python Python 3.7.3: C:\Program Files (x86)\Python37-32\python.exe (prefix: 
C:\Program Files (x86)\Python37-32)
If I do like that (without entity_quoting):
db = DAL(configuration.get('db.uri'),pool_size=1,migrate_enabled=False,
check_reserved=['all'])
I can login.
Why?


-- 
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/90f8daec-f5b1-4ee5-9d45-885ad792c803%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Surname and name begins with a lower case letter after registration

2019-06-26 Thread Константин Комков
When I register like new user I write *K*onstantin *K*omkov, but after 
registration I see *k*onstantin *k*omkov. How can I change it?

-- 
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/349179fa-a124-4a71-b53e-01626f295427%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Hiding an element or text after login

2019-06-26 Thread Константин Комков
Check that your conditions and pass quantity coincides. Becouse your code 
correct work in my app.

-- 
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/2b866459-d38d-4143-b957-af7fc83f597f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Error in app: the variable was lost

2019-06-24 Thread Константин Комков
Ohh, sorry. I found that error - my mistake.

   - 
   

-- 
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/84331933-6861-47fd-8616-53c0eb68c320%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Error in app: the variable was lost

2019-06-22 Thread Константин Комков
Yes, but only on monday(

сб, 22 июн. 2019 г., 16:41 Anthony :

> Can you show the full traceback?
>
> On Saturday, June 22, 2019 at 3:25:23 AM UTC-4, Константин Комков wrote:
>>
>> In my controller I have function:
>> def send_app():
>> if session.abit_email is None:redirect('
>> https://oas.timacad.ru/application', client_side=True)
>> const = {rec.NAME:rec.TEXT for rec in 
>> db((db.t_const.NAME=='RECTOR_RANKU')
>> | (db.t_const.NAME=='PREDSEDU') | (db.t_const.NAME=='VUZ')).select(
>> db.t_const.NAME,db.t_const.TEXT)}
>> rectorRank = const['RECTOR_RANKU']
>> rectorName = const['PREDSEDU']
>> *vuzName* = const['VUZ']
>> statement=create_application_for_edit(rectorRank,rectorName,vuzName)
>> ...
>> and it's code create_application_for_edit function:
>> def create_application_for_edit(rectorRank,rectorName,vuzName):
>> ...
>> if session.edu_course_name!='Без курсов':
>> edu = edu + 'Закончил(-а) подготовительные курсы {0}: {1}.
>> '.format(*vuzName*,session.edu_course_name)
>> ...
>> Today I see one user get error 10 times:
>> NameError(name 'vuzName' is not defined)
>> After that I see automatic letter from him on email. It means that error
>> was and something happened and error was gone and that user can send
>> automatic letter from my function. How it is possible?
>>
>> --
> 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/CtsITs1D4po/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/da61f285-7624-4783-900a-a25a03171570%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/da61f285-7624-4783-900a-a25a03171570%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAM7z-Vmh9CbBgPWYFKp9txkd4O2Wo_hCmPdDeOyG8ehzpUXwzQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Error in app: the variable was lost

2019-06-22 Thread Константин Комков
In my controller I have function:
def send_app():
if session.abit_email is 
None:redirect('https://oas.timacad.ru/application', client_side=True)
const = {rec.NAME:rec.TEXT for rec in 
db((db.t_const.NAME=='RECTOR_RANKU') | (db.t_const.NAME=='PREDSEDU') | 
(db.t_const.NAME=='VUZ')).select(db.t_const.NAME,db.t_const.TEXT)}
rectorRank = const['RECTOR_RANKU']
rectorName = const['PREDSEDU']
*vuzName* = const['VUZ']
statement=create_application_for_edit(rectorRank,rectorName,vuzName)
...
and it's code create_application_for_edit function:
def create_application_for_edit(rectorRank,rectorName,vuzName):
...
if session.edu_course_name!='Без курсов':
edu = edu + 'Закончил(-а) подготовительные курсы {0}: {1}. 
'.format(*vuzName*,session.edu_course_name)
...
Today I see one user get error 10 times:
NameError(name 'vuzName' is not defined) 
After that I see automatic letter from him on email. It means that error 
was and something happened and error was gone and that user can send 
automatic letter from my function. How it is possible? 

-- 
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/ee17ac90-9ba0-41c7-90a6-2883bfb499c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Error in app: cannot unpack non-iterable NoneType object

2019-06-22 Thread Константин Комков
*Val K*, I know that & is betwice operator) I can not return ('My message', 
oper and abit) becouse string 'My message' is different like:
if ((oper==True) & (abit==True)):
   return ('My message 1',True)
   elif ((oper==True) & (abit==False)):
   return ('My message 2',False)
   elif ((oper==False) & (abit==True)):
   return ('My message 3',False)
I want to know what I need to do for function mail return me true and if it 
return me false i repeat call that function (maybe 5 times like call to 
databese in web2py) for improve that:
Now I get return ('My message',True) in 25 percent of the time.


 

-- 
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/c0d274ad-be80-401b-b7e0-6e62e5c1d06d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Error in app: cannot unpack non-iterable NoneType object

2019-06-20 Thread Константин Комков
I need add more information. Can error may be caused if my function don't 
have one condition:
def send_application(msg,entrant_XML):
#Letter for operator
try:
oper = mail.send('opera...@domen.ru','Theme','Letter 
text...',attachments = files)
except Exception:
oper = False

#Letter for entrant
try:
abit = mail.send(session.abit_email,'Theme','Letter text...')
except Exception:
abit = False

if ((oper==True) & (abit==True)):
return ('My message',True)
elif ((oper==True) & (abit==False)):
return ('My message',False)
elif ((oper==False) & (abit==True)):
return ('My message',False)
Here I don't have that:
else ((False) & (False)):
return ('My message',False)
Now I get return ('My message',True) in 25 percent of the time. How can I 
improve that result? Maybe I need take several attemts, but without sending 
two the same letter on one email. We have own mail server.


-- 
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/7c083f22-d1f5-45c5-8f8d-94629eceecca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Error in json.loads

2019-06-20 Thread Константин Комков
P.S. *Val K*, If I do like that in controller and in js as you told all 
work. *Thank you!* But I don't understant why I need use json.loads twice...
>
>
>- 
>
> import json
a = json.loads(request.vars.data)
a = json.loads(a)
cgCount = len(a.get('fac'))


-- 
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/8befe82a-87d0-4466-83ee-ed61e3149a5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Error in json.loads

2019-06-20 Thread Константин Комков
If i do like that:
jQuery.ajax({
   type: "POST",
   url: "{{=URL('useCalc','sess')}}",
   data: {data: myStrJson},
   cache: false
   });
I have error in controller:

import json
a = json.loads(request.vars.data)
cgCount = len(*a.get('fac'))*

AttributeError('str' object has no attribute 'get')

*Variavles*
a : 'data={"fo":["очная","очная","очная"],"fac":["Мех...йство и 
водопользование"],"bud":["Да","Да","Да"]}'
json : I think you 
take me good advice about js object, but now it is python string, not 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/84ba580c-32e2-4cc1-8ec2-4a2506520bc3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Error in app: cannot unpack non-iterable NoneType object

2019-06-20 Thread Константин Комков
I have that string in controller:
res,flag=send_application(msg,entrant_XML)
and send_application function:
def send_application(msg,entrant_XML):
 #my code
 return('My message',False)
I get error:
Ticket ID

46.73.180.207.2019-06-20.10-47-49.e820b49a-8731-495f-9156-0d75ad265046
 cannot unpack non-iterable NoneType objectВерсия
web2py™ Version 2.18.5-stable+timestamp.2019.04.08.04.22.03
Python Python 3.7.3: C:\Python\python.exe (prefix: C:\Python)Traceback

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

Traceback (most recent call last):
  File ".\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
  File "C:\inetpub\wwwroot\applications\application\controllers/bak.py", line 
2101, in 
  File ".\gluon\globals.py", line 421, in 
self._caller = lambda f: f()
  File "C:\inetpub\wwwroot\applications\application\controllers/bak.py", line 
1625, in send_app
res,flag=send_application(msg,entrant_XML)
TypeError: cannot unpack non-iterable NoneType object

Error snapshot [image: help] 


TypeError(cannot unpack non-iterable NoneType object)

inspect attributes
Frames
   
   - 
   
   *File C:\inetpub\wwwroot\gluon\restricted.py in restricted at line 219* 
   код аргументы переменные
   - 
   
   *File C:\inetpub\wwwroot\applications\application\controllers\bak.py in 
at line 2101* код аргументы переменные
   - 
   
   *File C:\inetpub\wwwroot\gluon\globals.py in  at line 421* код 
   аргументы переменные
   - 
   
   *File C:\inetpub\wwwroot\applications\application\controllers\bak.py in 
   send_app at line 1625* код аргументы переменные
   Function argument list
   
   ()
   Code listing
   
   1620.
   1621.
   1622.
   1623.
   1624.
   1625.
   1626.
   1627.
   1628.
   1629.
   
   )
   )
   if form.process(formname='form',onvalidation=check_agreement).accepted:
   msg=create_application(rectorRank,rectorName,vuzName)
   entrant_XML=create_XML_entrant(form.vars.abit_pass)
   res,flag=send_application(msg,entrant_XML)
   if flag:
   heading = ''
   statement = ''
   clear_abit_app()
   
   Variables
   res undefined
   flag undefined
   global send_application 
   msg 'My text'
   entrant_XML '\n \n 
   \n \n '
   

-- 
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/783569fd-af3d-47fa-b75c-704b551f1de2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Error in json.loads

2019-06-20 Thread Константин Комков
JS
console.log('data={'+fo.slice(0,-1)+'],'+fac.slice(0,-1)+'],'+dir.slice(0,-1
)+'],'+cg_id.slice(0,-1)+'],'+comp_group.slice(0,-1)+'],'+bud.slice(0,-1)+
']}');
I get that json string:
JSON string (from console.log(); in google chrome)
data={"fo":["очная","очная","очная"],"fac":["Мелиорации, водного хозяйства 
и строительства имени А.Н.Костякова","Мелиорации, водного хозяйства и 
строительства имени А.Н.Костякова","Механики и энергетики имени 
В.П.Горячкина"],"dir":["Строительство","Гидромелиорация","Агроинженерия"],
"cg_id":["6","32","29"],"comp_group":["Строительство","Гидромелиорация","Агроинженерия.
 
Тех. системы в агробизнесе; Тех. сервис в АПК; Машины и оборудование для 
хран. и перераб. с.-х. продукции"],"bud":["Да","Да","Да"]}
If I do it:
jQuery.ajax({
type: "POST",
url: "{{=URL('useCalc','sess')}}",
data: 
'data={'+fo.slice(0,-1)+'],'+fac.slice(0,-1)+'],'+dir.slice(0,-1)+'],'+cg_id.slice(0,-1)+'],'+comp_group.slice(0,-1)+'],'+bud.slice(0,-1)+']}',
cache: false
});
Controller:
import json
a = json.loads(request.vars.data)
I have error:
Ticket ID

91.210.96.2.2019-06-20.09-46-31.de5115b4-e6fb-4b0f-92dd-22ce59c495da
 Unterminated string starting at: 
line 1 column 440 (char 439)Версия
web2py™ Version 2.18.5-stable+timestamp.2019.04.08.04.22.03
Python Python 3.7.3: C:\Python\python.exe (prefix: C:\Python)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.

Traceback (most recent call last):
  File ".\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
  File "C:\inetpub\wwwroot\applications\application\controllers/useCalc.py", 
line 663, in 
  File ".\gluon\globals.py", line 421, in 
self._caller = lambda f: f()
  File "C:\inetpub\wwwroot\applications\application\controllers/useCalc.py", 
line 642, in sess
a = json.loads(request.vars.data)
  File "C:\Python\lib\json\__init__.py", line 348, in loads
return _default_decoder.decode(s)
  File "C:\Python\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Python\lib\json\decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 
440 (char 439)

Error snapshot [image: help] 


JSONDecodeError(Unterminated string starting at: line 1 column 440 (char 
439))

inspect attributes
Frames
   
   - 
   
   *File C:\inetpub\wwwroot\gluon\restricted.py in restricted at line 219* 
   код аргументы переменные
   - 
   
   *File C:\inetpub\wwwroot\applications\application\controllers\useCalc.py 
   in  at line 663* код аргументы переменные
   - 
   
   *File C:\inetpub\wwwroot\gluon\globals.py in  at line 421* код 
   аргументы переменные
   - 
   
   *File C:\inetpub\wwwroot\applications\application\controllers\useCalc.py 
   in sess at line 642* код аргументы переменные
   - 
   
   *File C:\Python\lib\json\__init__.py in loads at line 348* код аргументы 
   переменные
   - 
   
   *File C:\Python\lib\json\decoder.py in decode at line 337* код аргументы 
   переменные
   - 
   
   *File C:\Python\lib\json\decoder.py in raw_decode at line 353* код 
   аргументы переменные
   Function argument list
   
   (self=, 
   s='{"fo":["очная","очная","очная"],"fac":["Мелиорац...ексов","Агроинженерия. 
   Тех. системы в агробизнесе', idx=0)
   Code listing
   
   347.
   348.
   349.
   350.
   351.
   352.
   353.
   354.
   355.
   356.
   
   
   This can be used to decode a JSON document from a string that may
   have extraneous data at the end.
   
   """
   try:
   obj, end = self.scan_once(s, idx)
   except StopIteration as err:
   raise JSONDecodeError("Expecting value", s, err.value) from None
   return obj, end
   
   Variables
   obj undefined
   end undefined
   self 
   self.scan_once <_json.Scanner object>
   s '{"fo":["очная","очная","очная"],"fac":["Мелиорац...ексов","Агроинженерия. 
   Тех. системы в агробизнесе'
   idx 0
   

-- 
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/d33d1a31-d794-42fa-b6a3-0ae0ac2220dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: I broke something

2019-06-18 Thread Константин Комков
Leonel Câmara, told me delete all errors and session files when I change 
web2py version. As I think that can be useful in my situation. I deleted 
all errors in all apps and now don't see new errors. I will be wait and 
check apps errors tomorrow. Thank you, Jim S and 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/3b4e5f7c-4c49-432f-a35a-f51c4d429edb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: I broke something

2019-06-18 Thread Константин Комков
Also I see that error:
Ticket ID

10.250.10.160.2019-06-18.11-10-10.65f5c525-97e7-4cf4-985b-eea6fd89e420
Версия
web2py™ Version 2.18.5-stable+timestamp.2019.04.08.04.22.03
Python Python 3.7.3: C:\Python\python.exe (prefix: C:\Python)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.

Traceback (most recent call last):
  File ".\gluon\main.py", line 444, in wsgibase
serve_controller(request, response, session)
  File ".\gluon\main.py", line 179, in serve_controller
page = run_controller_in(request.controller, request.function, environment)
  File ".\gluon\compileapp.py", line 657, in run_controller_in
ccode = getcfs(layer, filename, lambda: compile2(code, filename))
  File ".\gluon\cfs.py", line 50, in getcfs
data = filter()
  File ".\gluon\compileapp.py", line 657, in 
ccode = getcfs(layer, filename, lambda: compile2(code, filename))
  File ".\gluon\restricted.py", line 205, in compile2
return compile(code, layer, 'exec')
  File "C:\inetpub\wwwroot\applications\stud\controllers/appadmin.py", line 270
except Exception, e:
^
SyntaxError: invalid syntax

Error snapshot [image: help] 


SyntaxError(invalid syntax (controllers/appadmin.py, line 270))

inspect attributes
Frames
   
   - 
   
   *File C:\inetpub\wwwroot\gluon\main.py in wsgibase at line 444* код 
   аргументы переменные
   - 
   
   *File C:\inetpub\wwwroot\gluon\main.py in serve_controller at line 179* 
   код аргументы переменные
   - 
   
   *File C:\inetpub\wwwroot\gluon\compileapp.py in run_controller_in at 
   line 657* код аргументы переменные
   - 
   
   *File C:\inetpub\wwwroot\gluon\cfs.py in getcfs at line 50* код аргументы
переменные
   - 
   
   *File C:\inetpub\wwwroot\gluon\compileapp.py in  at line 657* код
аргументы переменные
   - 
   
   *File C:\inetpub\wwwroot\gluon\restricted.py in compile2 at line 205* код
аргументы переменные
   Function argument list
   
   (code='# -*- coding: utf-8 -*-\n\n# #...n 
   ul_main\n\nresponse._vars=response._caller(hooks)', 
   layer=r'C:\inetpub\wwwroot\applications\stud\controllers/appadmin.py')
   Code listing
   
   200.
   201.
   202.
   203.
   204.
   205.
   206.
   207.
   208.
   209.
   
   output = ""
   return output
   
   
   def compile2(code, layer):
   return compile(code, layer, 'exec')
   
   
   def restricted(ccode, environment=None, layer='Unknown', scode=None):
   """
   
   Variables
   builtincompile 
   code '# -*- coding: utf-8 -*-\n\n# #...n 
   ul_main\n\nresponse._vars=response._caller(hooks)'
   layer r'C:\inetpub\wwwroot\applications\stud\controllers/appadmin.py'
   

-- 
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/b5139753-1f20-4252-ba1b-078a5fac2095%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   >