[web2py] Re: custom filter in grid

2017-08-10 Thread 黄祥
in grid search form field you can use :

table.table_datetime >= "2017-04-04 00:00:00" and table.table_datetime <= 
"2017-04-04 24:00:00"
table.table_datetime >= "2017-04-04 00:00" and table.table_datetime <= 
"2017-04-04 24:00"
table.table_datetime >= "2017-04-04 00" and table.table_datetime <= 
"2017-04-04 24"

or

table.table_datetime >= "2017-04-04 00:00:00" and table.table_datetime < 
"2017-04-05 00:00:00"
table.table_datetime >= "2017-04-04 00:00" and table.table_datetime < 
"2017-04-05 00:00"
table.table_datetime >= "2017-04-04 00" and table.table_datetime < 
"2017-04-05 00"

best regards,
stifan

-- 
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] custom filter in grid

2017-08-10 Thread Carlos Cesar Caballero Díaz
Hi guys, I have a datetime field but I need (using the grid) filter it 
as a date field, so, if I put something like:


mydatetime = 2017-04-04

I need to show all records with datetimes that belongs to this day.

Greetings.

--
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] keyError : ‘fields’

2017-08-10 Thread Lazaro Aulan
Hello everyone!

We are running a small application in web2py 2.14.6

Checking the application with 2.15.3 we got a error on 

web2py-2.15.3/gluon/packages/dal/pydal/objects.py  in line 2946, in  
__getstate__, 
del ret['fields']
keyError : ‘fields’
...
2944def __getstate__(self):
2945ret = self.__dict__.copy()
2946del ret['fields']
2947return ret
…

we changed line 2496  to:
ret.pop('fields', 0)
or to
if ret.get('fields'):
del ret['fields']

the question is.

What is wrong with ‘fields’ ?

Thank.

-- 
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] How to assemble project from Bitbucket on local server

2017-08-10 Thread shazianusra
Hi All,

I got a project shared to me on Bitbucket from client as his projects is 
built using web2py. I need few guidelines that how to assemble a project 
shared on Bitbucket. I've downloaded it and now need to set it as its in 
production.

Please Advise.

-- 
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: update_or_insert question...

2017-08-10 Thread Anthony


2017-08-10 18:06 GMT+01:00 António Ramos :
>
>> better explanation
>>
>> first execution 
>> id=db.entities.update_or_insert( ((db.entities.type==5) & 
>> (db.entities.entity=="xaaa")),entity="xaaa",type=5)
>>
>> record inserted
>>
>>
>> id=db.entities.update_or_insert( ((db.entities.type==5) & 
>> (db.entities.entity=="xaaa")),entity="othertext",type=5)
>>
>> No record inserted , id=None
>>
>
If id=None, that indicates and update was done rather than an insert. 

the tried again
>
> id=db.entities.update_or_insert( ((db.entities.type==5) & 
> (db.entities.entity=="xaaa")),entity="othertext",type=5)
> and record inserted and not updated
>

Well, assuming the id=None returned from the previous attempt indicated an 
update, that means there is no longer a record with entity="xaaa", so this 
third call will now insert a new record with that value, as expected.

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.


Re: [web2py] pycharm and web2py - setup project

2017-08-10 Thread Richard Vézina
I guess it related to the refactoring that occur around importing stuff in
web2py which was particular... It has been reworked in version 2.15.x

You may have a look at the web2py repo for having a look at how it change...

We should inform PyCharm devs about this change if the issue is coming from
there, which I kind of pretty sure thinking about it...

Richard

On Thu, Aug 10, 2017 at 2:07 PM, Richard Vézina  wrote:

> 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+unsubscr...@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-10 Thread Richard Vézina
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+unsubscr...@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] Re: update_or_insert question...

2017-08-10 Thread António Ramos
the tried again

id=db.entities.update_or_insert( ((db.entities.type==5) &
(db.entities.entity=="xaaa")),entity="othertext",type=5)
and record inserted and not updated

why?

2017-08-10 18:06 GMT+01:00 António Ramos :

> better explanation
>
> first execution
> id=db.entities.update_or_insert( ((db.entities.type==5) &
> (db.entities.entity=="xaaa")),entity="xaaa",type=5)
>
> record inserted
>
>
> id=db.entities.update_or_insert( ((db.entities.type==5) &
> (db.entities.entity=="xaaa")),entity="othertext",type=5)
>
> No record inserted , id=None
>
> 2017-08-10 18:02 GMT+01:00 António Ramos :
>
>> Hello with the next controller
>>
>> def test()
>> id=db.entities.update_or_insert( ((db.entities.type==5) &
>> (db.entities.entity=="aaas")),entity="aaasasdasd",type=5)
>> return dict(id=id)
>>
>> i get a record inserted for the first time
>> If if execute it again it does not update but creates another record
>>
>> What could be wrong ?
>>
>>
>> regards
>>
>
>

-- 
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: update_or_insert question...

2017-08-10 Thread António Ramos
better explanation

first execution
id=db.entities.update_or_insert( ((db.entities.type==5) &
(db.entities.entity=="xaaa")),entity="xaaa",type=5)

record inserted


id=db.entities.update_or_insert( ((db.entities.type==5) &
(db.entities.entity=="xaaa")),entity="othertext",type=5)

No record inserted , id=None

2017-08-10 18:02 GMT+01:00 António Ramos :

> Hello with the next controller
>
> def test()
> id=db.entities.update_or_insert( ((db.entities.type==5) &
> (db.entities.entity=="aaas")),entity="aaasasdasd",type=5)
> return dict(id=id)
>
> i get a record inserted for the first time
> If if execute it again it does not update but creates another record
>
> What could be wrong ?
>
>
> regards
>

-- 
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] update_or_insert question...

2017-08-10 Thread António Ramos
Hello with the next controller

def test()
id=db.entities.update_or_insert( ((db.entities.type==5) &
(db.entities.entity=="aaas")),entity="aaasasdasd",type=5)
return dict(id=id)

i get a record inserted for the first time
If if execute it again it does not update but creates another record

What could be wrong ?


regards

-- 
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 Richard Vézina
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+unsubscr...@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] CSS and SQLFORM.GRID

2017-08-10 Thread Chinh Dang
Clear your browser cache and try again. If still doesn't work, make sure
your custom css file loads after the others.

On Aug 9, 2017 4:03 PM, "LC LC"  wrote:

Hello,

I use my own css file, but when i try to use in my view {{=records}} the
code generates web2py style  class ..
note : in my controller i use sqlform.grid

the purpose is to custom the grid with the css used. i don ont know if i am
clear ...

thanks

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

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