[web2py] search in sqlform.grid

2020-02-20 Thread ulbish
Hello!
I use search in SQLFORM.grid. If you want to find empty dates, nothing 
happens, since the query generated in sqlhtml.py (subquery variable, line 
2429) contains "= NULL", while "IS NULL" is correct. Am I doing something 
wrong or is this a mistake?

web2py 2.9.12
mySQL 5.6.36

-- 
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/bdecd4fd-3b00-470a-a6d6-b32a1a9b2856%40googlegroups.com.


[web2py] Re: py4web and record versioning

2020-02-20 Thread Carlos Hanson
Consider it done.


On Thursday, February 20, 2020 at 8:02:45 PM UTC-8, Massimo Di Pierro wrote:
>
> No obvious solution yet but will prioritize this. Would you mind opening 
> an issue on github about this?
>
> On Wednesday, 19 February 2020 12:33:32 UTC-8, Carlos Hanson wrote:
>>
>> It looks like table inheritance is affected by the same issue:
>>
>>
>> monster = db.Table(db, 'monster', Field('color'), Field('size'))
>> db.define_table('thing', Field('name'), monster)
>>
>>
>> The following traceback is the same as the error using 
>> _enable_record_versioning() starting at *table = self.lazy_define_table*:
>>
>> Traceback (most recent call last):
>>   File "", line 1, in 
>>   File "/home/chanson/py/py4web/apps/thing/__init__.py", line 7, in 
>> 
>> from . models import db
>>   File "/home/chanson/py/py4web/apps/thing/models.py", line 9, in 
>> db.define_table('thing', Field('name'), monster)
>> *  File 
>> "/home/chanson/.local/share/virtualenvs/py4web-recc_4-8/lib/python3.6/site-packages/pydal/base.py",
>>  
>> line 656, in define_table*
>> *table = self.lazy_define_table(tablename, *fields, **kwargs)*
>> *  File 
>> "/home/chanson/.local/share/virtualenvs/py4web-recc_4-8/lib/python3.6/site-packages/pydal/base.py",
>>  
>> line 676, in lazy_define_table*
>> *if field.requires is DEFAULT:*
>> *  File 
>> "/home/chanson/.local/share/virtualenvs/py4web-recc_4-8/lib/python3.6/site-packages/threadsafevariable/__init__.py",
>>  
>> line 16, in __get__*
>> *return getattr(self.storage, "%s.%s" % (id(instance), id(self)))*
>> *  File "src/gevent/local.py", line 408, in 
>> gevent._local.local.__getattribute__*
>> AttributeError: 'gevent._local.local' object has no attribute 
>> '139976984026752.139976984930736'
>>
>>
>>
>> On Tuesday, February 18, 2020 at 8:07:25 PM UTC-8, Carlos Hanson wrote:
>>>
>>> Greetings,
>>>
>>> I just started using py4web, and I'm very excited to do so. 
>>>
>>> Has there been any more thought on this issue? I was partially into a 
>>> new web2py app in which I use _enable_record_versioning(), and I am 
>>> migrating it to py4web.
>>>
>>> Thanks.
>>>
>>>
>>> On Saturday, August 17, 2019 at 10:34:21 PM UTC-7, Massimo Di Pierro 
>>> wrote:

 Sorry for the late response. I just run into this myself. Do not have a 
 good solution at this time, unless we make pydal aware of 
 ThreadSafeVariable(s). Maybe we have to.

 On Wednesday, 31 July 2019 05:05:50 UTC-7, Manuel Vio wrote:
>
> Ok, I narrowed the problem a bit:
>
> In py4web/core.py, around line 207, there is this adjustment in order 
> to make some variables threadsafe:
>
> # make sure some variables in pydal are thread safe
> for _ in ['readable', 'writable', 'default', 'update', 'requires']:
> setattr(pydal.DAL.Field, _, threadsafevariable.ThreadSafeVariable())
>
> Turns out that PyDAL's _enable_record_versioning(), in order to create 
> the archive table, clones all original fields with their properties. Or, 
> at 
> least, it tries to: it seems that copy() fails to correctly transfer 
> threadsafevariable informations when dealing with those variables.
> I guess that when cloned field's requires attribute is accessed those 
> information are not valid anymore and py4web throws the aforementioned 
> exception.
> I was able to circumvent this error adding an explicit copy of the 
> attribute in pydal, but still I'm not sure if this could eventually lead 
> to 
> thread problems:
>
> for field in self:
> nfk = same_db or not field.type.startswith('reference')
> clone = field.clone(unique=False, type=field.type if nfk else 'bigint'
> )
> clone.requires = copy.copy(field.requires)
> clones.append(
> clone
> )
>
>
> Any thougths?
>


-- 
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/af3187cb-b898-4e03-8532-c06f1d9b7148%40googlegroups.com.


[web2py] Re: pydal bug!

2020-02-20 Thread Massimo Di Pierro
do

auth.inject = False

On second thought. This should be default because can be an information 
leak issue.

On Thursday, 20 February 2020 07:47:00 UTC-8, Ramos wrote:
>
> this is the result 
> [image: image.png]
> of this code . Why do i get user ???
> @action('colors')
> @action.uses( session, db, T, auth.user)
> def colors():
>
> return {'colors': ['red', 'blue', 'green']}
>

-- 
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/93375b2d-b080-40b4-a72a-59b423324aa4%40googlegroups.com.


[web2py] Re: py4web and record versioning

2020-02-20 Thread Massimo Di Pierro
No obvious solution yet but will prioritize this. Would you mind opening an 
issue on github about this?

On Wednesday, 19 February 2020 12:33:32 UTC-8, Carlos Hanson wrote:
>
> It looks like table inheritance is affected by the same issue:
>
>
> monster = db.Table(db, 'monster', Field('color'), Field('size'))
> db.define_table('thing', Field('name'), monster)
>
>
> The following traceback is the same as the error using 
> _enable_record_versioning() starting at *table = self.lazy_define_table*:
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/home/chanson/py/py4web/apps/thing/__init__.py", line 7, in 
> 
> from . models import db
>   File "/home/chanson/py/py4web/apps/thing/models.py", line 9, in 
> db.define_table('thing', Field('name'), monster)
> *  File 
> "/home/chanson/.local/share/virtualenvs/py4web-recc_4-8/lib/python3.6/site-packages/pydal/base.py",
>  
> line 656, in define_table*
> *table = self.lazy_define_table(tablename, *fields, **kwargs)*
> *  File 
> "/home/chanson/.local/share/virtualenvs/py4web-recc_4-8/lib/python3.6/site-packages/pydal/base.py",
>  
> line 676, in lazy_define_table*
> *if field.requires is DEFAULT:*
> *  File 
> "/home/chanson/.local/share/virtualenvs/py4web-recc_4-8/lib/python3.6/site-packages/threadsafevariable/__init__.py",
>  
> line 16, in __get__*
> *return getattr(self.storage, "%s.%s" % (id(instance), id(self)))*
> *  File "src/gevent/local.py", line 408, in 
> gevent._local.local.__getattribute__*
> AttributeError: 'gevent._local.local' object has no attribute 
> '139976984026752.139976984930736'
>
>
>
> On Tuesday, February 18, 2020 at 8:07:25 PM UTC-8, Carlos Hanson wrote:
>>
>> Greetings,
>>
>> I just started using py4web, and I'm very excited to do so. 
>>
>> Has there been any more thought on this issue? I was partially into a new 
>> web2py app in which I use _enable_record_versioning(), and I am migrating 
>> it to py4web.
>>
>> Thanks.
>>
>>
>> On Saturday, August 17, 2019 at 10:34:21 PM UTC-7, Massimo Di Pierro 
>> wrote:
>>>
>>> Sorry for the late response. I just run into this myself. Do not have a 
>>> good solution at this time, unless we make pydal aware of 
>>> ThreadSafeVariable(s). Maybe we have to.
>>>
>>> On Wednesday, 31 July 2019 05:05:50 UTC-7, Manuel Vio wrote:

 Ok, I narrowed the problem a bit:

 In py4web/core.py, around line 207, there is this adjustment in order 
 to make some variables threadsafe:

 # make sure some variables in pydal are thread safe
 for _ in ['readable', 'writable', 'default', 'update', 'requires']:
 setattr(pydal.DAL.Field, _, threadsafevariable.ThreadSafeVariable())

 Turns out that PyDAL's _enable_record_versioning(), in order to create 
 the archive table, clones all original fields with their properties. Or, 
 at 
 least, it tries to: it seems that copy() fails to correctly transfer 
 threadsafevariable informations when dealing with those variables.
 I guess that when cloned field's requires attribute is accessed those 
 information are not valid anymore and py4web throws the aforementioned 
 exception.
 I was able to circumvent this error adding an explicit copy of the 
 attribute in pydal, but still I'm not sure if this could eventually lead 
 to 
 thread problems:

 for field in self:
 nfk = same_db or not field.type.startswith('reference')
 clone = field.clone(unique=False, type=field.type if nfk else 'bigint')
 clone.requires = copy.copy(field.requires)
 clones.append(
 clone
 )


 Any thougths?

>>>

-- 
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/0e39aaa8-753d-41b9-965e-a04c19ec14ac%40googlegroups.com.


[web2py] Re: buefy for bulma /py4web

2020-02-20 Thread Massimo Di Pierro
I only picked bulma because it is truly js agnostic. 

On Tuesday, 18 February 2020 10:03:46 UTC-8, Ramos wrote:
>
> py4web has bulma out of the box
> so i guess buefy is more advisable than vuetify to use with py4web right ?
>
> https://buefy.org/  
>

-- 
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/2e57d257-0478-48cf-8be2-56e704b072aa%40googlegroups.com.


[web2py] Re: ERROR on Request

2020-02-20 Thread Massimo Di Pierro
in py4web request is the bottlepy request. 
https://bottlepy.org/docs/dev/api.html#the-request-object
There is no now.

You can use datetime.timetime.now()

On Tuesday, 18 February 2020 08:34:51 UTC-8, Maurice Waka wrote:
>
> BUT 
> Now I get this:
>
> Field('modified_on', 'datetime', default=request.now, update=request.now),
>   File "/usr/local/lib/python3.6/dist-packages/bottle.py", line 1400, in 
> __getattr__
> raise AttributeError('Attribute %r not defined.' % name)
> AttributeError: Attribute 'now' not defined.
>
>
> On Tuesday, February 18, 2020 at 7:13:27 PM UTC+3, Maurice Waka wrote:
>>
>> Thanks @Lovdie
>>
>> got 
>>
>>
>> from py4web import request,
>>
>> On Tuesday, February 18, 2020 at 6:58:10 PM UTC+3, Maurice Waka wrote:
>>>
>>> In py4web, I cant use this syntax:
>>> default = request.now
>>>
>>>
>>> Error:
>>>
>>> Field('modified_on', 'datetime', default=request.now),# 
>>> update=request.now),
>>> NameError: name 'request' is not defined
>>>
>>>

-- 
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/ebc49b2d-ed20-4fd9-9aa0-ee94a7f4cfde%40googlegroups.com.


[web2py] Re: Future of web2py

2020-02-20 Thread Massimo Di Pierro
It will continue fix bugs. I will add new features as long the same 
features overlap with py4web.
Honestly web2py has not needed much attention in a while.
I do recommend that people move their apps to py4web simply because I 
believe the latter is better.

On Tuesday, 18 February 2020 07:36:24 UTC-8, Clemens wrote:

> Hello Massimo,
>
> I've understood, that py4web is the future. But I have one important 
> question: Will web2py further maintained? And how long will it be 
> maintained? I'm asking, because I've developed an application on web2py and 
> I need to plan when it has to be migrated/re-implemented. And what do you 
> think will be a factor (e.g. in percentage of the original implementation 
> effort) to switch an application from web2py to py4web?
>
> Thanks in advance for a short answer!
>
> Best regards
> Clemens
>

-- 
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/155aa8d4-7785-4a38-a529-624cb2b36b47%40googlegroups.com.


[web2py] Re: MySQL server has gone away - py4web

2020-02-20 Thread Massimo Di Pierro
Can you check which version of pydal you are using?
Need to decide whether to make this the default behavior

On Tuesday, 18 February 2020 03:35:47 UTC-8, Marcello wrote:
>
> Hi Massimo,
>
> Great !
> Now worked fine...
>
> Thanks
>
>
> On Tuesday, February 18, 2020 at 12:22:04 AM UTC-3, Massimo Di Pierro 
> wrote:
>>
>> sorry. My bad. try:
>>
>> +self._adapter.reconnect()  
>>
>> On Sunday, 16 February 2020 19:17:25 UTC-8, Marcello wrote:
>>>
>>> I got this error:
>>>
>>>   File "/home/parra/py4web/py4web/core.py", line 239, in on_request
>>> db._adapter.reconnect()
>>> NameError: name 'db' is not defined
>>>
>>>
>>>
>>>
>>> On Sunday, February 16, 2020 at 10:22:48 PM UTC-3, Massimo Di Pierro 
>>> wrote:

 The db fixture should automatiically try reconnect.

 To help me debug can you edit py4web/core.py and add the line below:

  class DAL(pydal.DAL, Fixture):
  def on_request(self):
  threadsafevariable.ThreadSafeVariable.restore(ICECUBE)
 + db._adapter.reconnect()  

 Does it solve the problem?


 On Saturday, 15 February 2020 04:15:38 UTC-8, Marcello wrote:
>
> I'm with lastest version...
>
> Shouldn't reconnect to db every page load ???
> If the server stays 1 hour without serving pages, a reconnection is 
> needed... or not ?
>
>
>
>
> On Saturday, February 15, 2020 at 8:30:58 AM UTC-3, Massimo Di Pierro 
> wrote:
>>
>> My guess is that there is some timeout in the mysql config example.
>> Can you repro with latest py4web?
>>
>> On Friday, 14 February 2020 14:31:58 UTC-8, Marcello wrote:
>>>
>>> Hi,
>>>
>>> Any informatiion about this ?
>>> Nobody using py4web with mysql ??
>>>
>>>
>>>
>>> On Tuesday, February 11, 2020 at 6:58:11 PM UTC-3, Marcello wrote:

 Hello,

 I'm trying py4web and found something stragne.
 Don't know if I'm making something wrong.

 I'm having "MySQL server has gone away" error if I wait some time 
 (about 10 minutes) betweeen page reloads...

 I tested same thing with web2py and this problem did not happen...

 Is it a bug or a problem here ?


 Thanks
 Marcello

>>>

-- 
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/0039ff48-b72b-48b3-a36b-9866d0e4666d%40googlegroups.com.


[web2py] Re: Setting a background images with jQuery

2020-02-20 Thread Paco Bernal
Think that this will work for sure, I am using something similar


> $(document).ready(function(){
> $(".background2").css("background", "url('{{=URL('static', 
> 'images/background.jpg)}}')");
> });
> 
>

Well, the code I use is

('body').css({'background-image':'url({{=URL('static','images/%s' % 
> pic)}})'});
>

for showing a random picture in the login screen
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/fa97f3ea-dcc3-4b01-b8de-0d53c582%40googlegroups.com.


[web2py] Setting a background images with jQuery

2020-02-20 Thread Paco Bernal
Maybe you can try with https://domain/static/images/background1.jpg in the 
array because you need to get the picture from the server and the URL you are 
using does not point to any picture in front side 
I think... 

-- 
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/3d1d4ac9-8a04-4ada-989a-3a3aa0cb0d76%40googlegroups.com.


Re: [web2py] py4web jwt ?

2020-02-20 Thread Val K
As I know py2web already stores _session_token as jwt, no? 

On Thursday, February 20, 2020 at 10:00:00 PM UTC+3, Kevin Keller wrote:
>
> With a Spa the routing is done in Javascript in the Browser.
>
> So Javascript or Vue / React etc need. To check if the user has a access 
> or id_token and if not redirect to the login page to obtain it.
>
> Doing crud and be able to secure those crud rest routes will be critical 
> for productivity. 
>
> So we need a simple jwt token minting engine that at least can spit out a 
> access token for prototyping and and easy way to switch over to other IAM 
> solutions with py4web for production that can do the token minting. 
>
> That is something I am currently working on the whole oidc auth part make 
> it easy and I also want to make it available for web2py. 
>
> I have updated and got the oauth2 login provider working with Okta 
> yesterday and web2py. 
>
> Will share this. Code asap and sent a push to git to have that provider 
> updated and at some providers for different IAM solutions for both web2py 
> and py4web going forward. 
>
> Will try to share an example with py4web asap once I have something 
> working. 
>
> Will probaly be on the. Weekend. 
>
>
>
>
>
>
> On Thu, 20 Feb 2020, 10:42 Val K, > wrote:
>
>> check request.content_type - is that 'application/json' ?
>>
>> On Thursday, February 20, 2020 at 9:28:43 PM UTC+3, Ramos wrote:
>>>
>>> getting this from py4web as an api. 
>>> [image: image.png]
>>> Is not what i would like to see from a SPA standpoint.
>>>
>>> Regards
>>> António
>>>
>>>
>>> Em qui., 20 de fev. de 2020 às 18:03, Val K  
>>> escreveu:
>>>
 It seems it depends on request.content_type 

 https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35

 -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to the Google 
 Groups "web2py-users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to web...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/web2py/9608a9ab-d338-4580-9d02-31b9b9a30782%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 web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/77ac539d-a83e-4931-ae79-424c3a4711fd%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/1e3387f6-bf14-406f-9c6b-306a06630961%40googlegroups.com.


Re: [web2py] py4web jwt ?

2020-02-20 Thread Kevin Keller
With a Spa the routing is done in Javascript in the Browser.

So Javascript or Vue / React etc need. To check if the user has a access or
id_token and if not redirect to the login page to obtain it.

Doing crud and be able to secure those crud rest routes will be critical
for productivity.

So we need a simple jwt token minting engine that at least can spit out a
access token for prototyping and and easy way to switch over to other IAM
solutions with py4web for production that can do the token minting.

That is something I am currently working on the whole oidc auth part make
it easy and I also want to make it available for web2py.

I have updated and got the oauth2 login provider working with Okta
yesterday and web2py.

Will share this. Code asap and sent a push to git to have that provider
updated and at some providers for different IAM solutions for both web2py
and py4web going forward.

Will try to share an example with py4web asap once I have something
working.

Will probaly be on the. Weekend.






On Thu, 20 Feb 2020, 10:42 Val K,  wrote:

> check request.content_type - is that 'application/json' ?
>
> On Thursday, February 20, 2020 at 9:28:43 PM UTC+3, Ramos wrote:
>>
>> getting this from py4web as an api.
>> [image: image.png]
>> Is not what i would like to see from a SPA standpoint.
>>
>> Regards
>> António
>>
>>
>> Em qui., 20 de fev. de 2020 às 18:03, Val K  escreveu:
>>
>>> It seems it depends on request.content_type
>>>
>>> https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35
>>>
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/9608a9ab-d338-4580-9d02-31b9b9a30782%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/77ac539d-a83e-4931-ae79-424c3a4711fd%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/CADHCKLTo0Dd0ttzt71c9-ALME%2BeYS0-JkX6nV641eOCbTH780g%40mail.gmail.com.


Re: [web2py] py4web jwt ?

2020-02-20 Thread Val K
check request.content_type - is that 'application/json' ?

On Thursday, February 20, 2020 at 9:28:43 PM UTC+3, Ramos wrote:
>
> getting this from py4web as an api. 
> [image: image.png]
> Is not what i would like to see from a SPA standpoint.
>
> Regards
> António
>
>
> Em qui., 20 de fev. de 2020 às 18:03, Val K  > escreveu:
>
>> It seems it depends on request.content_type 
>>
>> https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/9608a9ab-d338-4580-9d02-31b9b9a30782%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/77ac539d-a83e-4931-ae79-424c3a4711fd%40googlegroups.com.


Re: [web2py] py4web jwt ?

2020-02-20 Thread António Ramos
getting this from py4web as an api.
[image: image.png]
Is not what i would like to see from a SPA standpoint.

Regards
António


Em qui., 20 de fev. de 2020 às 18:03, Val K  escreveu:

> It seems it depends on request.content_type
>
> https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35
>
> --
> 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/9608a9ab-d338-4580-9d02-31b9b9a30782%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/CAEM0BxMwtYztWzkpacrh9zBdMhU3t1C7budbPu24NkdxXeThww%40mail.gmail.com.


[web2py] py4web jwt ?

2020-02-20 Thread Val K
It seems it depends on request.content_type 
https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35

-- 
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/9608a9ab-d338-4580-9d02-31b9b9a30782%40googlegroups.com.


[web2py] py4web jwt ?

2020-02-20 Thread Val K
+1 autoredirect should be an option

-- 
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/69e76d33-e2d4-4316-9322-e703a431b4b1%40googlegroups.com.


[web2py] Setting a background images with jQuery

2020-02-20 Thread mostwanted
I cant seem to be able set a background image with jQuery using css in 
web2py, I have been trying to create a background slide but all i am 
getting is white canvas!
I dont know why this is happening!


 
var images=new Array('images/fairytale.jpg','images/gamaila.jpg',
'images/gathuli.png');
var nextimage=0;
doSlideshow();

function doSlideshow(){
if(nextimage>=images.length){nextimage=0;}
$('.background')
.css('background-image','url("'+images[nextimage++]+'")')
.fadeIn(500,function(){
setTimeout(doSlideshow,1000);
});
}



Even a simple script such as this one cant do it, i'm suspecting there is 
something wrong with way i'm calling the images, the path i'm giving, 
please help

$(document).ready(function(){
$(".background2").css("background", "url(' ../images/background.jpg ')");
});


Regards;

Mostwanted

-- 
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/75196d5a-ed8d-4035-8f2c-624caaa3e8dd%40googlegroups.com.


[web2py] py4web

2020-02-20 Thread Val K
You can press "reload apps" in the dashboard

-- 
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/aa8ec5cd-a145-4c99-9265-fd34e589254b%40googlegroups.com.


[web2py] py4web jwt ?

2020-02-20 Thread António Ramos
this code  from the docs...

@action('index')
@action.uses(auth.user)def index():

return {"ok":1}

Here @action.uses(auth.user) tells py4web that this action requires a
logged in user and should redirect to login if no user is logged in.



this redirect is good for an full web2py app.

What if i have a SPA in vue ?

In case the user is not logged it it should not redirect to login page
because the apps is a outsider vue spa. How to return an error to vue spa ??

regards


António

-- 
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/CAEM0BxNvNyYjk40qBKoUVF6cpD1%3DQuBaBA4b2dD2Rck0emFHoA%40mail.gmail.com.


[web2py] pydal bug!

2020-02-20 Thread António Ramos
this is the result
[image: image.png]
of this code . Why do i get user ???
@action('colors')
@action.uses( session, db, T, auth.user)
def colors():

return {'colors': ['red', 'blue', 'green']}

-- 
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/CAEM0BxMg0MVC_3xGodGBOLEJ4djz-via6Yz%2Bj3_M8MbqX7F4cA%40mail.gmail.com.


[web2py] py4web

2020-02-20 Thread António Ramos
Any time i change controllers.py i have to stop and restart the server. why
??

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEM0BxOYTMhZB1QkyX-dQsRMWX7h3jYzsbAcYzFnfDvwTnnQqw%40mail.gmail.com.