[web2py] Re: [ISSUE] can't see db from database administration menu

2017-11-03 Thread Kirill Shatalaev

I suppose this is bug 1727 

Try to update to latest dev.

четверг, 2 ноября 2017 г., 3:59:32 UTC+4 пользователь Арслан Ибатуллин 
написал:
>
> Hi, i'm newbee on web-development, so if i click on every db(even in new 
> created app), web2py gives me traceback: 
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] pycharm and web2py - setup project

2017-08-14 Thread Kirill Shatalaev
Richard, as you can see at 2:20, parameter info is NOT working (indexing is 
finished, view->parameter info or ctrl+p is not working too)
After that I've added pyDAL package (2:43)
And ONLY then it starting to work, yes (3:26).

Pycharm is professional version, 2017.2.1

понедельник, 14 августа 2017 г., 17:21:45 UTC+4 пользователь Richard 
написал:
>
> hmm... I don't understand why you say it not working... Once the pycharm 
> indexing end, at the end of your vid you have autocomplete working no???
>
> I do have last pycharm version 
>
> PyCharm 2017.2
> Build *#PY-172.3317.103*, built on July 25, 2017
> JRE: 1.8.0_152-release-915-b5 amd64
> JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
> Linux 4.4.0-89-generic
>
> Richard
>
> On Mon, Aug 14, 2017 at 5:11 AM, Kirill Shatalaev  > wrote:
>
>> Richard, how did you do that?
>>
>> This is my scrincast on a clean installation and without any virtual 
>> environment. Does not work.
>>
>> https://youtu.be/51mmwUSJ_VM
>>
>>
>> пятница, 11 августа 2017 г., 17:57:46 UTC+4 пользователь Richard написал:
>>>
>>> Kirill, I just try to create a new project and the autocompletion was 
>>> working, so I guess the issue is limited to virtual environement...
>>>
>>>
>>> -- 
>> 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+un...@googlegroups.com .
>> 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.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] pycharm and web2py - setup project

2017-08-14 Thread Kirill Shatalaev
Richard, how did you do that?

This is my scrincast on a clean installation and without any virtual 
environment. Does not work.

https://youtu.be/51mmwUSJ_VM


пятница, 11 августа 2017 г., 17:57:46 UTC+4 пользователь Richard написал:
>
> Kirill, I just try to create a new project and the autocompletion was 
> working, so I guess the issue is limited to virtual environement...
>
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] pycharm and web2py - setup project

2017-08-10 Thread Kirill Shatalaev
I created an issue, but I m afraid web2py is not their main stream...

четверг, 10 августа 2017 г., 22:07:43 UTC+4 пользователь Richard написал:
>
> You may consider looking here if it a known bug and report it if not : 
> https://youtrack.jetbrains.com/issues/PY
>
> On Thu, Aug 10, 2017 at 1:20 PM, Kirill Shatalaev  > wrote:
>
>> Just tried with python 2.7, it creates new project from scratch and 
>> downloads web2py automatically. Still no autocomplete and parameters.
>>
>> четверг, 10 августа 2017 г., 17:47:42 UTC+4 пользователь Richard написал:
>>>
>>> Have you try with python 2.7 if it works... And are you using the 
>>> pycharm project creation tool to configure your web2py environnement?? You 
>>> can try with their tool before trying to make it work with virtual 
>>> environnement...
>>>
>>> Richard
>>>
>>> On Tue, Aug 8, 2017 at 5:18 PM, Kirill Shatalaev  
>>> wrote:
>>>
>>>> Hello, I have Pycharm 2017.2 (Professional version).
>>>>
>>>> And autocompletion and Parameter info (ctrl+p) does not work out of the 
>>>> box for my project.
>>>>
>>>> But, when I install pyDAL package on my project interpreter options, 
>>>> and it starts to work (see attached screenshot).
>>>>
>>>> This is not the right way: using pydal as a separate package; this 
>>>> causes troubles. For example, 2.15.3 web2py crashing on start if pyDAL is 
>>>> installed to my venv as additional package.
>>>>
>>>> What can I do to make autocompletion and parameter info usable?
>>>>
>>>> -- 
>>>> 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+un...@googlegroups.com.
>>>> 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+un...@googlegroups.com .
>> 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.
For more options, visit https://groups.google.com/d/optout.


[web2py] pycharm and web2py - setup project

2017-08-08 Thread Kirill Shatalaev
Hello, I have Pycharm 2017.2 (Professional version).

And autocompletion and Parameter info (ctrl+p) does not work out of the box 
for my project.

But, when I install pyDAL package on my project interpreter options, and it 
starts to work (see attached screenshot).

This is not the right way: using pydal as a separate package; this causes 
troubles. For example, 2.15.3 web2py crashing on start if pyDAL is 
installed to my venv as additional package.

What can I do to make autocompletion and parameter info usable?

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Error in appadmin (database admin) on python 3

2017-08-08 Thread Kirill Shatalaev
#1727 on web2py

понедельник, 7 августа 2017 г., 18:20:30 UTC+4 пользователь Massimo Di 
Pierro написал:
>
> please open a ticket in web2py or pydal, I can fix this in either place.
>
>
>>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Error in appadmin (database admin) on python 3

2017-08-06 Thread Kirill Shatalaev
Hello, when using python3 and database admin, I got this error:

 name 'unicode' is not defined

You need to click on any table name (for example, 
http://127.0.0.1:8000/mysite/appadmin/select/db?query=db.auth_user.id%3E0).

I think this is python3 unicode -> str specific related trouble.



-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Error with database admin and backsticks in table/field names

2016-10-12 Thread Kirill Shatalaev

>
> Can you post your table declarations?  Taking a quick look at the sql.log 
> (and I'm not a mysql user), but the index declarations look different 
> between Oct 06 and Oct  10:
>
>
>
# -*- coding: utf-8 -*-

db.define_table('component_group',
Field('name', 'string', length=30, required=True),
format='%(name)s')


db.define_table('component_manufacturer',
Field('name', 'string', length=30, required=True),
format='%(name)s')


db.define_table('component_state',
Field('name', 'string', length=10, required=True),
format='%(name)s')


db.define_table('component',
Field('name', 'string', length=50, required=True),
Field('alcoholic', 'boolean', default=False),
Field('alcohol_by_vol', 'integer', default=0),
Field('component_group', db.component_group, required=True),
Field('component_manufacturer', db.component_manufacturer, 
required=True, default=1),
Field('component_state', db.component_state),
format='%(name)s')


db.define_table('component_measurements',
Field('name', 'string', length=15),
Field('component_state', db.component_state),
format='%(name)s')


db.define_table('plural_case',
Field('name', 'string', length=15, required=True),
format='%(name)s')


db.define_table('measurement_plurals',
Field('plural_form', 'string', length=15),
Field('plural_case', db.plural_case),
Field('component_measurement', db.component_measurements),

format='%(plural_form)s')
 

 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Error with database admin and backsticks in table/field names

2016-10-11 Thread Kirill Shatalaev

 

> What version of web2py is this happening on?
>

web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2016
Version 2.14.6-stable+timestamp.2016.05.10.00.21.47

 

> Does this happen just with your app, or with the welcome app as well?
>

With my app. Welcome is not affected, but it uses sqlite, and my app uses 
mysql. Backticks is mysql special chars, you can use  it if you want to use 
mysql reserved words in your table name of field name (i.e., "select", but 
I do not have such names on my model.

So there is a setting on scaffolding db.py:

db = DAL(myconf.get('db.uri'),
 pool_size=myconf.get('db.pool_size'),
 migrate_enabled=myconf.get('db.migrate'),
 check_reserved=['all'])


check_reserved = all, not sure if this trouble related with it? Maybe my 
table or field names intersect with reserved words in other databases?

This is a part of my sql.log, so 2016-10-06 everything is OK.

2016-10-12, I defined some additional tables in model, nothing more 
changed. And now I'm in this tick troubles.

timestamp: 2016-10-06T22:50:05.440741
CREATE TABLE component_manufacturer(
id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(30),
PRIMARY KEY (id)
) ENGINE=InnoDB CHARACTER SET utf8;
success!
timestamp: 2016-10-06T22:54:05.131029
CREATE TABLE component(
id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(50),
alcoholic CHAR(1),
alcohol_by_vol INT,
component_group INT  , INDEX component_group__idx (component_group), 
FOREIGN KEY (component_group) REFERENCES component_group (id) ON DELETE CASCADE,
component_manufacturer INT  , INDEX component_manufacturer__idx 
(component_manufacturer), FOREIGN KEY (component_manufacturer) REFERENCES 
component_manufacturer (id) ON DELETE CASCADE,
PRIMARY KEY (id)
) ENGINE=InnoDB CHARACTER SET utf8;
success!
timestamp: 2016-10-12T00:08:19.416900
ALTER TABLE `auth_permission` ADD `record_id__tmp` INTEGER;
success!
UPDATE `auth_permission` SET `record_id__tmp`=`record_id`;
success!
ALTER TABLE `auth_permission` DROP COLUMN `record_id`;
success!
ALTER TABLE `auth_permission` ADD `record_id` INTEGER;
success!
UPDATE `auth_permission` SET `record_id`=`record_id__tmp`;
success!
ALTER TABLE `auth_permission` DROP COLUMN `record_id__tmp`;
success!
success!
timestamp: 2016-10-12T00:08:22.863067
CREATE TABLE `component_state`(
`id` INT AUTO_INCREMENT NOT NULL,
`name` VARCHAR(10),
PRIMARY KEY (`id`)
) ENGINE=InnoDB CHARACTER SET utf8;
success!
timestamp: 2016-10-12T00:08:22.874621
ALTER TABLE `component` ADD `component_state` INT  , ADD INDEX 
`component_state__idx` (`component_state`), ADD FOREIGN KEY (`component_state`) 
REFERENCES `component_state` (`id`) ON DELETE CASCADE;
success!
timestamp: 2016-10-12T00:08:24.065036
ALTER TABLE `component` ADD `alcohol_by_vol__tmp` INTEGER;
success!
UPDATE `component` SET `alcohol_by_vol__tmp`=`alcohol_by_vol`;
success!
ALTER TABLE `component` DROP COLUMN `alcohol_by_vol`;
success!
ALTER TABLE `component` ADD `alcohol_by_vol` INTEGER;
success!
UPDATE `component` SET `alcohol_by_vol`=`alcohol_by_vol__tmp`;
success!
ALTER TABLE `component` DROP COLUMN `alcohol_by_vol__tmp`;
success!
success!
timestamp: 2016-10-12T00:08:28.920658
CREATE TABLE `component_measurements`(
`id` INT AUTO_INCREMENT NOT NULL,
`name` VARCHAR(15),
`component_state` INT  , INDEX `component_state__idx` (`component_state`), 
FOREIGN KEY (`component_state`) REFERENCES `component_state` (`id`) ON DELETE 
CASCADE,
PRIMARY KEY (`id`)
) ENGINE=InnoDB CHARACTER SET utf8;
success!
timestamp: 2016-10-12T00:08:28.932209
CREATE TABLE `measurement_plurals`(
`id` INT AUTO_INCREMENT NOT NULL,
`plural_form` VARCHAR(15),
`component_measurement` INT  , INDEX `component_measurement__idx` 
(`component_measurement`), FOREIGN KEY (`component_measurement`) REFERENCES 
`component_measurements` (`id`) ON DELETE CASCADE,
PRIMARY KEY (`id`)
) ENGINE=InnoDB CHARACTER SET utf8;
success!
timestamp: 2016-10-12T01:13:15.007933
CREATE TABLE `plural_case`(
`id` INT AUTO_INCREMENT NOT NULL,
`name` VARCHAR(15),
PRIMARY KEY (`id`)
) ENGINE=InnoDB CHARACTER SET utf8;
success!
timestamp: 2016-10-12T01:13:15.053358
ALTER TABLE `measurement_plurals` ADD `plural_case` INT  , ADD INDEX 
`plural_case__idx` (`plural_case`), ADD FOREIGN KEY (`plural_case`) REFERENCES 
`plural_case` (`id`) ON DELETE CASCADE;
success!



-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Error with database admin and backsticks in table/field names

2016-10-11 Thread Kirill Shatalaev

>
>
>
> Where do you see this?  In the appadmin/select page, where queries are 
> entered?  (the default query is db.tablename.id > 0) 
>
> (path is https:...server/appadmin/select/db?query=db.logtable.id%3E0, 
> where %3E encodes '>')
>
> /dps
>
>
Yes, exactly.
Table header links to:
http://127.0.0.1:8000/barlist/appadmin/select/db?orderby=`component`.`id`
If I remove '`' from url, sort query works as expected.
 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Error with database admin and backsticks in table/field names

2016-10-11 Thread Kirill Shatalaev

Hello.

Dont know why, but I see tables and fields surrounded by backsticks on 
appadmin.

For example:

`component`.`id`  `component`.`name`
So, when I try to sort table ckicking by field name, I get error:

Traceback (most recent call last):
  File 
"/home/ksh/PycharmProjects/barlist/web2py/applications/barlist/controllers/appadmin.py",
 line 266, in select
orderby=eval_in_global_env(orderby))
  File 
"/home/ksh/PycharmProjects/barlist/web2py/applications/barlist/controllers/appadmin.py",
 line 95, in eval_in_global_env
exec ('_ret=%s' % text, {}, global_env)
  File "", line 1
_ret=db.`component`.`id`
^
SyntaxError: invalid syntax


How can be this fixed? I use no mysql reserved keywords on table's/field's 
names, as far as I know.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: crud.delete and record versioning error

2016-09-08 Thread Kirill Shatalaev
So, is CRUD going to be deprecated?

вторник, 6 сентября 2016 г., 18:39:03 UTC+4 пользователь Massimo Di Pierro 
написал:
>
> please do not use crud. it has not been supported in long time. just use 
> db(...).delete()
>
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: crud.delete and record versioning error

2016-09-04 Thread Kirill Shatalaev

Well it seems to me del table[record_id] does not work with record 
versioning according to this old discussion:

https://groups.google.com/d/topic/web2py/XqNkiPQq8v4/discussion

So I changed in controller crud.delete to db().delete() 

But I think this is a bug on gluon, am I right?

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] crud.delete and record versioning error

2016-09-04 Thread Kirill Shatalaev
Hello.

In my controller I have

def delete_comment():
try:
comment_id = int(request.args(0))
post_id = get_post_id_by_comment(comment_id)
commented_post_url = get_post_url(post_id)
print commented_post_url
comment = get_comment(comment_id)
except:
raise HTTP(404)
query = ((db.commenting.post_id == post_id) &
 (db.commenting.comment_id == db.comments.id) &
 (db.comments.created_on < comment.comments.created_on))
previous_comment = db(query).select(db.comments.id, 
orderby=~db.comments.created_on).first()
post_url = get_post_url(post_id)
if previous_comment:
redirect_after_delete = URL(c='default', f='show_comment', 
args=[previous_comment.id])
else:
redirect_after_delete = URL(c='default', f='index', 
args=post_url['post_url_assembled'])
confirmation_form = FORM(INPUT(_type='submit', _value=T('Yes')))
confirmation_form.add_button(T('No'), URL(c='default', f='show_comment', 
args=[comment_id]))
if confirmation_form.process().accepted:
crud.delete(db.comments, comment_id, redirect_after_delete,
message=T('Comment deleted'))
return dict(form=confirmation_form, comment_id=comment_id)


Everything works fine. 
I enabled record versioning in my app and now I got this error:

Traceback (most recent call last):
  File "/home/ksh/PycharmProjects/promo/web2py/gluon/restricted.py", line 227, 
in restricted
exec ccode in environment
  File 
"/home/ksh/PycharmProjects/promo/web2py/applications/promedol/controllers/manage.py"
 , 
line 423, in 
  File "/home/ksh/PycharmProjects/promo/web2py/gluon/globals.py", line 417, in 

self._caller = lambda f: f()
  File 
"/home/ksh/PycharmProjects/promo/web2py/applications/promedol/controllers/manage.py"
 , 
line 319, in delete_comment
message=T('Comment deleted'))
  File "/home/ksh/PycharmProjects/promo/web2py/gluon/tools.py", line 5013, in 
delete
del table[record_id]
  File 
"/home/ksh/venv/web2py/local/lib/python2.7/site-packages/pydal/objects.py", 
line 604, in __delitem__
raise SyntaxError('No such record: %s' % key)
SyntaxError: No such record: 1007911

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: TAG helper and unnamed argument

2016-08-30 Thread Kirill Shatalaev

>
>
> So, @Kirill, there's no way but ending up with _pubdate='' will give you a 
> syntactically equivalent markup.
>
>
>>>
Well, I see now. Sleazy, but correct. Thank you.

P.S. Not sure about others, but we russians have joke about man visiting 
doctor and "sleazy"...

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] TAG helper and unnamed argument

2016-08-29 Thread Kirill Shatalaev

So, how to do some like:

1 day ago


I tried:


TAG.time('1 day ago', _pubdate=True,
 _datetime=str(datetime.year) + '-' + '%02d' % datetime.month + '-' + '%02d' % 
datetime.day)


And got:


1 day ago


Here I can read:

http://www.web2py.com/init/simple_examples/hello5


"attributes without value like "READONLY" can be created with the argument 
"_readonly=ON"."


But not _pubdate=True, nor _pubdate=ON (wich is deprecated and just an alias 
for True according to chapter 5) does not work for me and generates 
pubdate="pubdate".






-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Retrieve custom form input/select value in case of errors

2016-08-25 Thread Kirill Shatalaev


It's not nice and I don't know how I can say to web2py to add the 
> error-wrapper after the input-group. Do you know that?
>
>
On the controller
form.accept(hideerror=True)

On the view you have to display errors yourself

{{if form.errors.daily_distance:}}
  ... write your own html/javascript

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] restrict direct access to .load component views views

2016-08-21 Thread Kirill Shatalaev

Hello.

In the book we see:

We can access it at the URL

1

http://127.0.0.1:8000/test/comments/post.load


But in production I do not want user to access this directly! It must be 
callable only from template {{=LOAD}}

How must I restrict this, by webserver (apache deny, for example) rules?

Or web2py has a mechanism to do this?

If component loaded via AJAX I can perform check something like:

if not request.ajax:
raise HTTP(404)

But wat can I do if component is not AJAX-driven?

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: upload field and IS_IMAGE

2016-08-19 Thread Kirill Shatalaev


пятница, 19 августа 2016 г., 3:48:12 UTC+4 пользователь 黄祥 написал:
>
> pls try :
> requires = IS_EMPTY_OR([IS_LENGTH(16384), IS_IMAGE() ] )
>
> best regards,
> stifan
>

Man, thanks!!! I completely forgot about this validator. Need to sleep 
more...

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] upload field and IS_IMAGE

2016-08-18 Thread Kirill Shatalaev
Hello.

I have in model:

Field('avatar', 'upload', required=False, autodelete=True, label=T('Avatar'),
  uploadfolder=os.path.join(request.folder, 'static/images/avatars'),
  requires=[IS_LENGTH(16384), IS_IMAGE()])


Well, the logic is simple: "avatar is not necessary, but when it uploaded, it 
must be image size of <= 16KiB".


But I *can not* submit form without image uploading, error is "Invalid Image" 
always.


Is it a bug or I do not understand something?


-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: XML(sanitize=True) and incorrect HTML

2016-06-15 Thread Kirill Shatalaev
Opened #1363

вторник, 14 июня 2016 г., 22:25:05 UTC+4 пользователь Anthony написал:
>
>
> Feel free to file a Github issue.
>
> Anthony
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] XML(sanitize=True) and incorrect HTML

2016-06-14 Thread Kirill Shatalaev
Hello.

XML crashes while trying to sanitize some sorts of incorrect html.

For example:

a = '' # wrong html
b = XML(a, sanitize=True)

 pop from empty list

I suppose this is a severe bug.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Request Password not working correct

2016-05-07 Thread Kirill Shatalaev
Hi friend.

I got same trouble. The reason is an empty translations strings. Check the 
strings:

'Click on the link %(link)s to reset your password'

'Password reset' 


The first is for message body, the second for subject.


понедельник, 5 января 2015 г., 20:49:34 UTC+4 пользователь Ramashish Gaurav 
написал:
>
> Hi all,
>
> I have deployed my app on internet. At initial stage, every thing was 
> working great. No bugs. When a user would register himself, a confirmation 
> email would be successfully sent to the user's registered email id. Even 
> the 'Lost Password' option was working correct. Now I made some changes in 
> my app few days ago. I cannot remember at which places. Now following bug 
> came up. 
>
> When the user goes for 'Lost Password' option, he is successfully 
> redirected to 'request_reset_password' page. There is a form to accept the 
> users email id. The default title "Request reset password" which used to 
> appear earlier does not appears now on the 'request_reset_password' page. 
> Neither the value of button "Request reset password' appears on it. Instead 
> an empty value is there on the submit button. Now when the user submits his 
> email id, there is a mail generated at "my_e...@gmail.com " 
> but with no link and no subject i.e. an empty mail. Also the mail generated 
> at "my_e...@gmail.com " is not sent to "user_...@gmail.com 
> ". I don't know what to do now to debug it. I am not finding 
> a place to start with. However the confirmation email sent during 
> registering process is still working right. Only the reset password email 
> is not working. Also :
>
> auth.settings.reset_password_requires_verification = True
>
> is done in db.py .
>
> Please help me debug this error. (If it is internal error and cannot be 
> debugged, then can you please give me an alternative way to implement reset 
> password 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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Strange trouble with password reset

2016-05-05 Thread Kirill Shatalaev
I've found a trouble: empty translation string. But I did not edit 
translations. Is it a bug?

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Strange trouble with password_reset

2016-05-04 Thread Kirill Shatalaev
Hello, I'm using web2py 2.14.5-stable+timestamp.2016.04.14.03.26.16

mail = logging for testing purposes.

So, controller:

def user():
return dict(form=auth())


Registering new user goes as it must. Email verification (this is console 
output):


2016-05-05 01:21:14,601 - web2py - WARNING - email not sent

From: nore...@example.com
To: h...@bb.com
Subject: Email verification

Click on the link 
http://127.0.0.1:8000/myblog/default/user/verify_email/17b4d0ed-4af0-4c28-ae77-e6d9b14e109b
 to verify your email



Click this link, so user successfully registered and can login.

But when I try to retrieve_password this is result email:

2016-05-05 01:24:46,313 - web2py - WARNING - email not sent

From: nore...@example.com
To: h...@bb.com
Subject: 

None


So its subject and body is absolutely empty. The reset password key is 
created for user  h...@bb.com and I can see it on my database.

What can I do to fix 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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: for those of us who do not understand ...

2016-03-26 Thread Kirill Shatalaev
Hello.

Did you inspect it with some tool like auto css-checker?
There is no font-weight:strong; font-weight:string; on css specification.
And some typos

четверг, 3 марта 2016 г., 11:27:57 UTC+4 пользователь Massimo Di Pierro 
написал:
>
> A damn simple and easy css framework ... stupid.css
>
> https://t.co/9vB48IjYJK
>
> No promise of backward compatibility is made, but comments and suggestions 
> for improvement are welcome.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: using FORM with new line layout

2014-08-20 Thread Kirill Shatalaev
You are on the wrong way, if you want to do this in the *controller*.
Due to MVC, you have to customize your form's appearance in your *view*


понедельник, 18 августа 2014 г., 2:37:22 UTC+4 пользователь sid datta 
написал:
>
>
> HI - I wanted to customize the layout and use FORM.
>
> So a simple example - where I would like to have 2 input boxes and a 3 rd 
> submit button each on its own line. I wanted to do this in the controller - 
> so
>
> form = 
> FORM(INPUT(_name='fname'),INPUT(_name='lname'),INPUT(_type='Submit'))
>
> this puts all the 3 on the same line - how do i split this into different 
> lines??
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.