Re: [web2py] downloading old web2py version from github

2015-05-06 Thread Richard Vézina
I mean "can't start"

:)

Richard

On Wed, May 6, 2015 at 7:12 PM, Richard  wrote:

> Hello,
>
> I was wanting to get an old version of web2py for some tests purposes and
> discover that even the old version of web2py downloaded from github lead to
> the issue related to new modulized dal (aka pydal)... Is this normal, I
> mean that the old version get affected ?
>
> How some one supposed to have access to an earlier fully working web2py
> version?
>
> Notice also that actually we can start web2py shell like so : python
> web2py.py -S welcome -M
>
> It fails with this message :
>
> Traceback (most recent call last):
>   File "/.../web2py/version_210-4/web2py/gluon/restricted.py", line 227,
> in restricted
> exec ccode in environment
>   File "applications/welcome/models/db.py", line 20, in 
> db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size',
> cast=int), check_reserved=['all'])
>   File
> "/.../web2py/version_210-4/web2py/gluon/packages/dal/pydal/base.py", line
> 171, in __call__
> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>   File
> "/.../web2py/version_210-4/web2py/gluon/packages/dal/pydal/base.py", line
> 457, in __init__
> raise RuntimeError("Failure to connect, tried %d times:\n%s" %
> (attempts, tb))
> RuntimeError: Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File
> "/.../web2py/version_210-4/web2py/gluon/packages/dal/pydal/base.py", line
> 435, in __init__
> self._adapter = ADAPTERS[self._dbname](**kwargs)
>   File
> "/.../web2py/version_210-4/web2py/gluon/packages/dal/pydal/adapters/base.py",
> line 53, in __call__
> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>   File
> "/.../web2py/version_210-4/web2py/gluon/packages/dal/pydal/adapters/sqlite.py",
> line 78, in __init__
> if do_connect: self.reconnect()
>   File
> "/.../web2py/version_210-4/web2py/gluon/packages/dal/pydal/connection.py",
> line 105, in reconnect
> self.connection = f()
>   File
> "/.../web2py/version_210-4/web2py/gluon/packages/dal/pydal/adapters/sqlite.py",
> line 76, in connector
> return self.driver.Connection(dbpath, **driver_args)
> OperationalError: unable to open database file
>
> --
> 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] downloading old web2py version from github

2015-05-06 Thread Richard
Hello,

I was wanting to get an old version of web2py for some tests purposes and 
discover that even the old version of web2py downloaded from github lead to 
the issue related to new modulized dal (aka pydal)... Is this normal, I 
mean that the old version get affected ?

How some one supposed to have access to an earlier fully working web2py 
version?

Notice also that actually we can start web2py shell like so : python 
web2py.py -S welcome -M

It fails with this message :

Traceback (most recent call last):
  File "/.../web2py/version_210-4/web2py/gluon/restricted.py", line 227, in 
restricted
exec ccode in environment
  File "applications/welcome/models/db.py", line 20, in 
db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', 
cast=int), check_reserved=['all'])
  File "/.../web2py/version_210-4/web2py/gluon/packages/dal/pydal/base.py", 
line 171, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
  File "/.../web2py/version_210-4/web2py/gluon/packages/dal/pydal/base.py", 
line 457, in __init__
raise RuntimeError("Failure to connect, tried %d times:\n%s" % 
(attempts, tb))
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
  File "/.../web2py/version_210-4/web2py/gluon/packages/dal/pydal/base.py", 
line 435, in __init__
self._adapter = ADAPTERS[self._dbname](**kwargs)
  File 
"/.../web2py/version_210-4/web2py/gluon/packages/dal/pydal/adapters/base.py", 
line 53, in __call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
  File 
"/.../web2py/version_210-4/web2py/gluon/packages/dal/pydal/adapters/sqlite.py", 
line 78, in __init__
if do_connect: self.reconnect()
  File 
"/.../web2py/version_210-4/web2py/gluon/packages/dal/pydal/connection.py", 
line 105, in reconnect
self.connection = f()
  File 
"/.../web2py/version_210-4/web2py/gluon/packages/dal/pydal/adapters/sqlite.py", 
line 76, in connector
return self.driver.Connection(dbpath, **driver_args)
OperationalError: unable to open database file

-- 
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: how do i get a web2py application from git and and install so i can run it

2015-05-06 Thread 黄祥
just extract the the zip and put it on folder 'web2py/applications '

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] Re: Show tables

2015-05-06 Thread 黄祥
for show two tables in 1 page i think you can use components, and please 
ensure that use set the different formname for each of your grids
ref:
http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid-signature
http://web2py.com/books/default/chapter/29/12/components-and-plugins#LOAD

for user permissions, i think you can set it on the grid something like
create = auth.has_membership(group_id = 'Admin')
or
create = auth.has_permission('create', db.table1, 0, auth.user.id)

ref:
http://web2py.com/books/default/chapter/29/09/access-control#Authorization

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] Re: After changing db adapter "relation 'auth_user' already exists"

2015-05-06 Thread Niphlod
the whole uri is inspected to determine the prefix of .table files, so when 
you change the adapter, a migration is triggered.
that being said, it's pretty easy to regenerate .table files ... 
- set fake_migrate_all=True
- hit appadmin one time
- remove fake_migrate_all=True
voilà.
Optionally you can delete old .table files (the ones pertaining the "old" 
uri)

On Wednesday, May 6, 2015 at 4:18:59 PM UTC+2, Ian W. Scott wrote:
>
> To work around my earlier unicode problem (I submitted an issue on Github) 
> I switched from the pg8000 adapter to the psycopg2 adapter for my postgre 
> database. Everything works fine as long as I have migrate set to False. But 
> if I set migrate=True I get this error:
>
> (relation "auth_user" already 
> exists )
>
> This is strange because the dal shouldn't be trying to perform any 
> migrations. Nothing in the model definitions or the db structure was 
> changed. The only change was the db adapter. Thinking my .table files might 
> have been corrupted, I tried doing a fake migrate by setting migrate=False 
> and fake_migrate_all=True, then switching both values again. But nothing 
> has changed. I'm still getting the same error as long as migrations are 
> turned on.
>
> Here's the full traceback:
>
> Traceback (most recent call last):
>  File "/home/ian/web/web2py-dev/gluon/restricted.py", line 227, in restricted
>  exec ccode in environment
>  File "/home/ian/web/web2py-dev/applications/paideia/models/db.py" 
> , line 192, in 
> 
>  auth.define_tables() # creates all needed tables
>  File "/home/ian/web/web2py-dev/gluon/tools.py", line 1893, in define_tables
>  format='%(first_name)s %(last_name)s (%(id)s)'))
>  File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/base.py", line 817, 
> in define_table
>  table = self.lazy_define_table(tablename,*fields,**args)
>  File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/base.py", line 856, 
> in lazy_define_table
>  polymodel=polymodel)
>  File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/adapters/base.py", 
> line 463, in create_table
>  self.create_sequence_and_triggers(query,table)
>  File 
> "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/adapters/postgres.py", 
> line 86, in create_sequence_and_triggers
>  self.execute(query)
>  File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/adapters/base.py", 
> line 1326, in execute
>  return self.log_execute(*a, **b)
>  File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/adapters/base.py", 
> line 1320, in log_execute
>  ret = self.cursor.execute(command, *a[1:], **b)
> ProgrammingError: relation "auth_user" already exists
>
>

-- 
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: cache.redis server unavailable = traceback. Bug?

2015-05-06 Thread Niphlod
I was thinking about a major overhaul of the connection algorithm. Redis is 
improving quickly and more and more connection options are made available 
at each release. Both redis_cache and redis_sessions should be able to work 
on a "redis-like" connection object. In that rewrite I'd add this "flag" 
too. File a bug anyway on github so it gets tracked

On Wednesday, May 6, 2015 at 4:15:44 PM UTC+2, Jose C wrote:
>
> Hmm, I see your point and use case.  But... ;)   given that there are 
> references in the manual (and probably in reality the majority of use 
> cases) to caching views, or db queries, etc.  how about then, as an 
> enhancement, to add an init flag to cache.redis along the lines of 
> `die_if_server_unavailable = True`  to force a halt with the traceback.  Or 
> else if set to False, fail silently and gracefully (key didn't exist 
> behaviour, re-execute function)  and let the system keep running?  
> Obviously the flag name itself is up for debate.
>
> Would this not provide the best of both worlds and max flexibility?  If 
> you (as the cache.redis creator) agree I'll take a stab at adding that 
> functionality to redis_cache.py and issue a PR.
>
>
>

-- 
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] deploment on an obsolete Debian 5 server

2015-05-06 Thread Niphlod
we don't support python 2.5 from some time.. it's possible that "I 
can't import" is a result of "tried and failed" rather than "didn't find 
it".

On Wednesday, May 6, 2015 at 7:50:18 PM UTC+2, Alan Etkin wrote:
>
> > Alan, if you need to update the interpreter you can look at backports: 
> > http://backports.debian.org/ 
>
> Great! I'll check it asap 
>
> Thanks all for the help 
>

-- 
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: web2py-mongodb-engine

2015-05-06 Thread Ron Chatterjee
Here is another tutorial from django:


*http://docs.mongodb.org/manual/tutorial/write-a-tumblelog-application-with-django-mongodb-engine/*


Pretty cool. Wondering if we can have a web2py version implementing the 
same with mongodb.  Any thoughts any one?



On Tuesday, May 5, 2015 at 4:49:08 PM UTC-4, Ron Chatterjee wrote:
>
> I was wondering about creating an object inside an object. As shown in the 
> link above:
>
> {
>   'created_on': ISODate('...'),
>   'author_name' : 'Bob',
>'author_email': 'b...@example.org',
>   'text' : 'The cake is a lie'
> }
>
>
> instead of that dict someone can also write it as:
>
>
> {
>   'created_on': ISODate('...'),
>   'author' : {
> 'name': 'Bob',
> 'email': 'b...@example.org'
>   },
>   'text' : 'The cake is a lie'}
>
>
>
> Django handles with "EmbeddedModelField". How does web2py handles that? I 
> am thinking there must be a way.
>
>
> On Tuesday, May 5, 2015 at 12:58:48 PM UTC-4, Cássio Botaro wrote:
>>
>> Actually DAL have experimental mongodb support.
>> You can see 
>> http://www.web2pyslices.com/slice/show/1580/save-the-earth-from-a-total-data-mess-with-mongodbadapter
>>
>

-- 
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] deploment on an obsolete Debian 5 server

2015-05-06 Thread Alan Etkin
> Alan, if you need to update the interpreter you can look at backports:
> http://backports.debian.org/

Great! I'll check it asap

Thanks all for the help

-- 
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] Re: deploment on an obsolete Debian 5 server

2015-05-06 Thread Alan Etkin
> Did you download the source file from the web2py site or github?  If github
> there is this issue to take into account due to pydal being a submodule.

I tried the zipped package from www.web2py.com, I'm quite sure it
ships pydal also

-- 
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] deploment on an obsolete Debian 5 server

2015-05-06 Thread Michele Comitini
Alan, if you need to update the interpreter you can look at backports:
http://backports.debian.org/

2015-05-06 19:06 GMT+02:00 Alan Etkin :

> I was testing the last stable source code installation of the framework on
> a debian lenny don't know what else 5.0 server, but if you start it using
> the built-in web server on a terminal it throws a funny error message
> stating it can't find pydal
>
> Has anyone tried to deploy web2py on that kind of server?
> Should I use a compiled newer version of python?
>
> The default O.S. interpreter is 2.5
>
> 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.


Re: [web2py] Re: Brainstorming

2015-05-06 Thread Ron Chatterjee
Thanks. Looks like lot of Json format data. Reminds me of mongodb.

On Wednesday, May 6, 2015 at 1:20:17 PM UTC-4, Richard wrote:
>
> https://github.com/mdipierro/w3
>
> This is Massimo's example of Ractive.js integration into web2py workflow
>
> Richard
>
> On Wed, May 6, 2015 at 1:11 PM, Ron Chatterjee  > wrote:
>
>> I thought there is an example to share. Sorry.
>>
>>
>> On Wednesday, May 6, 2015 at 1:07:52 PM UTC-4, Richard wrote:
>>>
>>> @Ron, we are talking!!
>>>
>>> :)
>>>
>>> Richard
>>>
>>> On Wed, May 6, 2015 at 12:58 PM, Ron Chatterjee  
>>> wrote:
>>>
 Can we take a sneak peak at that, whats upcoming?:-)


 On Wednesday, May 6, 2015 at 12:43:03 PM UTC-4, JorgeH wrote:
>
> React.js is not that new.
>
> They are pretty similar.
>
> Here is an article from May 6th 2014. Exactly 365 days ago.
>
>
> http://blog.ractivejs.org/posts/whats-the-difference-between-react-and-ractive/
>
> Massimo is already implementing ractive.js into web2py with impressive 
> accomplishes.
>
>
> http://www.ractivejs.org/
>
> On Wednesday, May 6, 2015 at 11:06:38 AM UTC-5, mcm wrote:
>>
>> IMHO ReactJS is no newer than Ractive.js.  It's being backed by 
>> facebook since a while ago.  I like the author's philosophy (read 
>> independence ) and design simplicity of Ractive.js, things that I 
>> appreciate even more in web2py, but that's a matter of personal taste :-)
>>
>> 2015-05-06 17:23 GMT+02:00 Ron Chatterjee :
>>
>>> That will be a cool concept!:-). I would love to see its done.
>>>
>>> On Wednesday, May 6, 2015 at 11:16:58 AM UTC-4, Ramos wrote:

 We are talking about integrating web2py with javascript ui 
 frameworks


 2015-05-06 16:09 GMT+01:00 Ron Chatterjee :

> What is this post is all about regarding web2py? Just went over my 
> head! 
>
> On Wednesday, May 6, 2015 at 10:38:39 AM UTC-4, Richard wrote:
>>
>> I think it will be difficult to make everyone happy with a given 
>> choice...
>>
>> Michele "agnostic" point is good even if in pratice it may be 
>> difficult (let say BS2 for instance we were maried with it until 
>> recently)
>>
>> Ractive.js as Massimo imaged is Ractive.js is to Angular.js what 
>> web2py is to Django
>>
>> The main issue with Ractive.js is it documentation which is not 
>> to bad actually but difficult to apprend, but it lacks of concreate 
>> examples...
>>
>> The user base seem limited and the project don't seem to be 
>> really active...
>>
>> I would have a welcome based on W3 repo that Massimo publish on 
>> github showing how to properly integrate with Ractive.js
>>
>> How to structure correctly the code remain to me a challenge
>>
>> Richard
>>
>> On Wed, May 6, 2015 at 7:45 AM, Ramos  wrote:
>>
>>> There is a new kid on the block
>>>
>>> Reactjs
>>>
>>> Any experiment with it and web2py ?
>>> Seems a lot less complex than angularjs
>>>
>>> Regards
>>>
>>>
>>> Em quinta-feira, 3 de julho de 2014 09:46:06 UTC+1, Mirek 
>>> Zvolský escreveu:

 Here is a project which lists and compares a little javascript 
 frameworks:
 todomvc.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+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 (Sourc

[web2py] Re: deploment on an obsolete Debian 5 server

2015-05-06 Thread Jose C
Did you download the source file from the web2py site or github?  If github 
there is this issue 
 to take into 
account due to pydal being a submodule.

-- 
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] Re: Brainstorming

2015-05-06 Thread Richard Vézina
https://github.com/mdipierro/w3

This is Massimo's example of Ractive.js integration into web2py workflow

Richard

On Wed, May 6, 2015 at 1:11 PM, Ron Chatterjee 
wrote:

> I thought there is an example to share. Sorry.
>
>
> On Wednesday, May 6, 2015 at 1:07:52 PM UTC-4, Richard wrote:
>>
>> @Ron, we are talking!!
>>
>> :)
>>
>> Richard
>>
>> On Wed, May 6, 2015 at 12:58 PM, Ron Chatterjee 
>> wrote:
>>
>>> Can we take a sneak peak at that, whats upcoming?:-)
>>>
>>>
>>> On Wednesday, May 6, 2015 at 12:43:03 PM UTC-4, JorgeH wrote:

 React.js is not that new.

 They are pretty similar.

 Here is an article from May 6th 2014. Exactly 365 days ago.


 http://blog.ractivejs.org/posts/whats-the-difference-between-react-and-ractive/

 Massimo is already implementing ractive.js into web2py with impressive
 accomplishes.


 http://www.ractivejs.org/

 On Wednesday, May 6, 2015 at 11:06:38 AM UTC-5, mcm wrote:
>
> IMHO ReactJS is no newer than Ractive.js.  It's being backed by
> facebook since a while ago.  I like the author's philosophy (read
> independence ) and design simplicity of Ractive.js, things that I
> appreciate even more in web2py, but that's a matter of personal taste :-)
>
> 2015-05-06 17:23 GMT+02:00 Ron Chatterjee :
>
>> That will be a cool concept!:-). I would love to see its done.
>>
>> On Wednesday, May 6, 2015 at 11:16:58 AM UTC-4, Ramos wrote:
>>>
>>> We are talking about integrating web2py with javascript ui frameworks
>>>
>>>
>>> 2015-05-06 16:09 GMT+01:00 Ron Chatterjee :
>>>
 What is this post is all about regarding web2py? Just went over my
 head!

 On Wednesday, May 6, 2015 at 10:38:39 AM UTC-4, Richard wrote:
>
> I think it will be difficult to make everyone happy with a given
> choice...
>
> Michele "agnostic" point is good even if in pratice it may be
> difficult (let say BS2 for instance we were maried with it until 
> recently)
>
> Ractive.js as Massimo imaged is Ractive.js is to Angular.js what
> web2py is to Django
>
> The main issue with Ractive.js is it documentation which is not to
> bad actually but difficult to apprend, but it lacks of concreate 
> examples...
>
> The user base seem limited and the project don't seem to be really
> active...
>
> I would have a welcome based on W3 repo that Massimo publish on
> github showing how to properly integrate with Ractive.js
>
> How to structure correctly the code remain to me a challenge
>
> Richard
>
> On Wed, May 6, 2015 at 7:45 AM, Ramos  wrote:
>
>> There is a new kid on the block
>>
>> Reactjs
>>
>> Any experiment with it and web2py ?
>> Seems a lot less complex than angularjs
>>
>> Regards
>>
>>
>> Em quinta-feira, 3 de julho de 2014 09:46:06 UTC+1, Mirek Zvolský
>> escreveu:
>>>
>>> Here is a project which lists and compares a little javascript
>>> frameworks:
>>> todomvc.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+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+un...@goog

Re: [web2py] Re: Sublime Text web2py plugin

2015-05-06 Thread Gergely Orosz
Can you see any error on Sublime Console when run any command?

2015. május 6., szerda 16:12:36 UTC+2 időpontban JorgeH a következőt írta:
>
> I installed in win 7.
>
> Haven´t been able to get it working.
>
> On Wednesday, May 6, 2015 at 7:09:38 AM UTC-5, Gergely Orosz wrote:
>>
>> You should use command palette again
>> Search for SublimeREPL: Web2py {your application name}
>> It should start interactive console for your web2py application
>>
>> 2015. május 6., szerda 12:34:17 UTC+2 időpontban Ramos a következőt írta:
>>>
>>> On more question.
>>> i installed sublime repl but how do i get the web2py interactive console 
>>> ?
>>>
>>> thank u
>>>
>>> 2015-05-06 11:25 GMT+01:00 António Ramos :
>>>
 From the controller i can open the view

 From the view i should open the controller , not the view again...

 thank u

 2015-05-06 11:22 GMT+01:00 António Ramos :

> I have seen the light
>
> Keep working on it. Its very good...
>
> 2015-05-06 10:06 GMT+01:00 Gergely Orosz :
>
>> Once you installed the plugin restart Sublime Text
>> After that you can use the command palette to check the available 
>> commands
>> All prefixed all web2py related command with W2P 
>> if you press CTRL+SHIFT+P and start type W2P you will see all the 
>> available commands
>>
>> 2015. május 6., szerda 10:44:20 UTC+2 időpontban Ramos a következőt 
>> írta:
>>>
>>> Thank you
>>> You say it can start and stop the server ...
>>> how ?
>>>
>>> 2015-05-06 6:52 GMT+01:00 Gergely Orosz :
>>>
 Hi Ramos,

 You should add a web2py application folder to a Sublime Text 
 prokeject
 1. Open Sublime go to the Project menu
 2. Choose Add folder to project option
 3. Browse your web2py application you like to work on

 You are ready to use the W2P plugin

 I am going to make the video tutorial on the weekend and also going 
 to update the plugin read with these steps

 Thank you letting me know

 2015. május 5., kedd 13:16:36 UTC+2 időpontban Ramos a következőt 
 írta:
>
> i installed it and get the message to add web2py to the project
>
> what project?
>
> you should do a 1 minute video to show how to use it
>
> thank u
>
> 2015-05-05 7:43 GMT+01:00 Gergely Orosz :
>
>> Thank you Massimo,
>>
>> I am going to improve it continuously
>>
>> 2015. május 4., hétfő 18:24:34 UTC+2 időpontban Massimo Di Pierro 
>> a következőt írta:
>>>
>>> Nice. Thank you! I added link form the web2py examples/ app.
>>>
>>> On Monday, 4 May 2015 05:28:55 UTC-5, Gergely Orosz wrote:

 Hi 4 All,

 I've started to develop a web2py plugin for Sublime Text 3.
 I've implemented a few command I found very useful on my daily 
 work.
 If you have any idea how can I make it better and useful please 
 visit the below link and submit your feature request there
 Thanks in advance

 You can find the plugin: https://bitbucket.org/kfog/w2p

 If you have any question please feel free to ask here or on the 
 Issue tracker

 All the best
 Greg

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

Re: [web2py] Keeping track of connected users (websocket_messaging.py)

2015-05-06 Thread Richard Vézina
Last year we develop over websocket contrib a tool like that and it turns
that we had to create a thread that was doing that, I mean maintain a list
of connected user... We create a basic back and forth websocket message
format so we can ping every users connected and wait for a response from
them if they are still online... This give you the basic idea how to
implement something... At start I expect that there were a build solution
for this in websocket contrib and toranado, but the person that I mandate
for analysing that and found a solution said that wasn't available and
implement something... So, I don't know if the path he follow was the right
one. But as far as I have been able to go throught that topic, websocket
contrib is noting more then a basic connecting tool that allow you to start
multiplexing using tornado from web2py...

If you feel you are able to review the code of what we did and improve it,
I can share it here, so I know if we take the right path or not... Since
the person who develop that is gone, I can't help more than sharing with
you her works...

Richard

On Wed, May 6, 2015 at 6:58 AM, Samuel Sowah  wrote:

> Hello,
> Please if I'd like to keep track of users who are connected to a
> particular group, for example
> 
>$(document).ready(function(){
>   var data;
>   $.web2py.web2py_websocket('ws://
> official-notebook.com:/realtime/mygroup
> ',function(e){data=eval('('+e.data+')')});
>});
> 
>
> so that I can list the connected users, and then remove them from the list
> when they disconnect, how would I achieve that?
>
> --
> 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] Re: Brainstorming

2015-05-06 Thread Ron Chatterjee
I thought there is an example to share. Sorry.


On Wednesday, May 6, 2015 at 1:07:52 PM UTC-4, Richard wrote:
>
> @Ron, we are talking!!
>
> :)
>
> Richard
>
> On Wed, May 6, 2015 at 12:58 PM, Ron Chatterjee  > wrote:
>
>> Can we take a sneak peak at that, whats upcoming?:-)
>>
>>
>> On Wednesday, May 6, 2015 at 12:43:03 PM UTC-4, JorgeH wrote:
>>>
>>> React.js is not that new.
>>>
>>> They are pretty similar.
>>>
>>> Here is an article from May 6th 2014. Exactly 365 days ago.
>>>
>>>
>>> http://blog.ractivejs.org/posts/whats-the-difference-between-react-and-ractive/
>>>
>>> Massimo is already implementing ractive.js into web2py with impressive 
>>> accomplishes.
>>>
>>>
>>> http://www.ractivejs.org/
>>>
>>> On Wednesday, May 6, 2015 at 11:06:38 AM UTC-5, mcm wrote:

 IMHO ReactJS is no newer than Ractive.js.  It's being backed by 
 facebook since a while ago.  I like the author's philosophy (read 
 independence ) and design simplicity of Ractive.js, things that I 
 appreciate even more in web2py, but that's a matter of personal taste :-)

 2015-05-06 17:23 GMT+02:00 Ron Chatterjee :

> That will be a cool concept!:-). I would love to see its done.
>
> On Wednesday, May 6, 2015 at 11:16:58 AM UTC-4, Ramos wrote:
>>
>> We are talking about integrating web2py with javascript ui frameworks
>>
>>
>> 2015-05-06 16:09 GMT+01:00 Ron Chatterjee :
>>
>>> What is this post is all about regarding web2py? Just went over my 
>>> head! 
>>>
>>> On Wednesday, May 6, 2015 at 10:38:39 AM UTC-4, Richard wrote:

 I think it will be difficult to make everyone happy with a given 
 choice...

 Michele "agnostic" point is good even if in pratice it may be 
 difficult (let say BS2 for instance we were maried with it until 
 recently)

 Ractive.js as Massimo imaged is Ractive.js is to Angular.js what 
 web2py is to Django

 The main issue with Ractive.js is it documentation which is not to 
 bad actually but difficult to apprend, but it lacks of concreate 
 examples...

 The user base seem limited and the project don't seem to be really 
 active...

 I would have a welcome based on W3 repo that Massimo publish on 
 github showing how to properly integrate with Ractive.js

 How to structure correctly the code remain to me a challenge

 Richard

 On Wed, May 6, 2015 at 7:45 AM, Ramos  wrote:

> There is a new kid on the block
>
> Reactjs
>
> Any experiment with it and web2py ?
> Seems a lot less complex than angularjs
>
> Regards
>
>
> Em quinta-feira, 3 de julho de 2014 09:46:06 UTC+1, Mirek Zvolský 
> escreveu:
>>
>> Here is a project which lists and compares a little javascript 
>> frameworks:
>> todomvc.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+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+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 (Rep

Re: [web2py] Re: Brainstorming

2015-05-06 Thread Richard Vézina
@Ron, we are talking!!

:)

Richard

On Wed, May 6, 2015 at 12:58 PM, Ron Chatterjee 
wrote:

> Can we take a sneak peak at that, whats upcoming?:-)
>
>
> On Wednesday, May 6, 2015 at 12:43:03 PM UTC-4, JorgeH wrote:
>>
>> React.js is not that new.
>>
>> They are pretty similar.
>>
>> Here is an article from May 6th 2014. Exactly 365 days ago.
>>
>>
>> http://blog.ractivejs.org/posts/whats-the-difference-between-react-and-ractive/
>>
>> Massimo is already implementing ractive.js into web2py with impressive
>> accomplishes.
>>
>>
>> http://www.ractivejs.org/
>>
>> On Wednesday, May 6, 2015 at 11:06:38 AM UTC-5, mcm wrote:
>>>
>>> IMHO ReactJS is no newer than Ractive.js.  It's being backed by facebook
>>> since a while ago.  I like the author's philosophy (read independence ) and
>>> design simplicity of Ractive.js, things that I appreciate even more in
>>> web2py, but that's a matter of personal taste :-)
>>>
>>> 2015-05-06 17:23 GMT+02:00 Ron Chatterjee :
>>>
 That will be a cool concept!:-). I would love to see its done.

 On Wednesday, May 6, 2015 at 11:16:58 AM UTC-4, Ramos wrote:
>
> We are talking about integrating web2py with javascript ui frameworks
>
>
> 2015-05-06 16:09 GMT+01:00 Ron Chatterjee :
>
>> What is this post is all about regarding web2py? Just went over my
>> head!
>>
>> On Wednesday, May 6, 2015 at 10:38:39 AM UTC-4, Richard wrote:
>>>
>>> I think it will be difficult to make everyone happy with a given
>>> choice...
>>>
>>> Michele "agnostic" point is good even if in pratice it may be
>>> difficult (let say BS2 for instance we were maried with it until 
>>> recently)
>>>
>>> Ractive.js as Massimo imaged is Ractive.js is to Angular.js what
>>> web2py is to Django
>>>
>>> The main issue with Ractive.js is it documentation which is not to
>>> bad actually but difficult to apprend, but it lacks of concreate 
>>> examples...
>>>
>>> The user base seem limited and the project don't seem to be really
>>> active...
>>>
>>> I would have a welcome based on W3 repo that Massimo publish on
>>> github showing how to properly integrate with Ractive.js
>>>
>>> How to structure correctly the code remain to me a challenge
>>>
>>> Richard
>>>
>>> On Wed, May 6, 2015 at 7:45 AM, Ramos  wrote:
>>>
 There is a new kid on the block

 Reactjs

 Any experiment with it and web2py ?
 Seems a lot less complex than angularjs

 Regards


 Em quinta-feira, 3 de julho de 2014 09:46:06 UTC+1, Mirek Zvolský
 escreveu:
>
> Here is a project which lists and compares a little javascript
> frameworks:
> todomvc.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+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+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.googl

[web2py] deploment on an obsolete Debian 5 server

2015-05-06 Thread Alan Etkin
I was testing the last stable source code installation of the framework on 
a debian lenny don't know what else 5.0 server, but if you start it using 
the built-in web server on a terminal it throws a funny error message 
stating it can't find pydal

Has anyone tried to deploy web2py on that kind of server?
Should I use a compiled newer version of python?

The default O.S. interpreter is 2.5

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.


[web2py] Re: web2py 2.10.4 and static / fonts

2015-05-06 Thread Jose C
Could it be a browser support issue?

Check out the link for more info and browser support of different font 
files.  Also consider the bit at the end of the link about using @import to 
load all the formats from a CDN (like Google).

HTH,
Jose C

-- 
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] Re: Brainstorming

2015-05-06 Thread Ron Chatterjee
Can we take a sneak peak at that, whats upcoming?:-)

On Wednesday, May 6, 2015 at 12:43:03 PM UTC-4, JorgeH wrote:
>
> React.js is not that new.
>
> They are pretty similar.
>
> Here is an article from May 6th 2014. Exactly 365 days ago.
>
>
> http://blog.ractivejs.org/posts/whats-the-difference-between-react-and-ractive/
>
> Massimo is already implementing ractive.js into web2py with impressive 
> accomplishes.
>
>
> http://www.ractivejs.org/
>
> On Wednesday, May 6, 2015 at 11:06:38 AM UTC-5, mcm wrote:
>>
>> IMHO ReactJS is no newer than Ractive.js.  It's being backed by facebook 
>> since a while ago.  I like the author's philosophy (read independence ) and 
>> design simplicity of Ractive.js, things that I appreciate even more in 
>> web2py, but that's a matter of personal taste :-)
>>
>> 2015-05-06 17:23 GMT+02:00 Ron Chatterjee :
>>
>>> That will be a cool concept!:-). I would love to see its done.
>>>
>>> On Wednesday, May 6, 2015 at 11:16:58 AM UTC-4, Ramos wrote:

 We are talking about integrating web2py with javascript ui frameworks


 2015-05-06 16:09 GMT+01:00 Ron Chatterjee :

> What is this post is all about regarding web2py? Just went over my 
> head! 
>
> On Wednesday, May 6, 2015 at 10:38:39 AM UTC-4, Richard wrote:
>>
>> I think it will be difficult to make everyone happy with a given 
>> choice...
>>
>> Michele "agnostic" point is good even if in pratice it may be 
>> difficult (let say BS2 for instance we were maried with it until 
>> recently)
>>
>> Ractive.js as Massimo imaged is Ractive.js is to Angular.js what 
>> web2py is to Django
>>
>> The main issue with Ractive.js is it documentation which is not to 
>> bad actually but difficult to apprend, but it lacks of concreate 
>> examples...
>>
>> The user base seem limited and the project don't seem to be really 
>> active...
>>
>> I would have a welcome based on W3 repo that Massimo publish on 
>> github showing how to properly integrate with Ractive.js
>>
>> How to structure correctly the code remain to me a challenge
>>
>> Richard
>>
>> On Wed, May 6, 2015 at 7:45 AM, Ramos  wrote:
>>
>>> There is a new kid on the block
>>>
>>> Reactjs
>>>
>>> Any experiment with it and web2py ?
>>> Seems a lot less complex than angularjs
>>>
>>> Regards
>>>
>>>
>>> Em quinta-feira, 3 de julho de 2014 09:46:06 UTC+1, Mirek Zvolský 
>>> escreveu:

 Here is a project which lists and compares a little javascript 
 frameworks:
 todomvc.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+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+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] Re: Sublime Text web2py plugin

2015-05-06 Thread Gergely Orosz
Have you run W2P: Add SublimeREPL support after installed the SublimeREPL 
plugin
It will setup the interactive shell for you

2015. május 6., szerda 15:05:31 UTC+2 időpontban Ramos a következőt írta:
>
> Dont see it on my windows 7
> I have sublime 3
>
>
>
>
>
> 2015-05-06 13:09 GMT+01:00 Gergely Orosz  >:
>
>> You should use command palette again
>> Search for SublimeREPL: Web2py {your application name}
>> It should start interactive console for your web2py application
>>
>> 2015. május 6., szerda 12:34:17 UTC+2 időpontban Ramos a következőt írta:
>>>
>>> On more question.
>>> i installed sublime repl but how do i get the web2py interactive console 
>>> ?
>>>
>>> thank u
>>>
>>> 2015-05-06 11:25 GMT+01:00 António Ramos :
>>>
 From the controller i can open the view

 From the view i should open the controller , not the view again...

 thank u

 2015-05-06 11:22 GMT+01:00 António Ramos :

> I have seen the light
>
> Keep working on it. Its very good...
>
> 2015-05-06 10:06 GMT+01:00 Gergely Orosz :
>
>> Once you installed the plugin restart Sublime Text
>> After that you can use the command palette to check the available 
>> commands
>> All prefixed all web2py related command with W2P 
>> if you press CTRL+SHIFT+P and start type W2P you will see all the 
>> available commands
>>
>> 2015. május 6., szerda 10:44:20 UTC+2 időpontban Ramos a következőt 
>> írta:
>>>
>>> Thank you
>>> You say it can start and stop the server ...
>>> how ?
>>>
>>> 2015-05-06 6:52 GMT+01:00 Gergely Orosz :
>>>
 Hi Ramos,

 You should add a web2py application folder to a Sublime Text 
 prokeject
 1. Open Sublime go to the Project menu
 2. Choose Add folder to project option
 3. Browse your web2py application you like to work on

 You are ready to use the W2P plugin

 I am going to make the video tutorial on the weekend and also going 
 to update the plugin read with these steps

 Thank you letting me know

 2015. május 5., kedd 13:16:36 UTC+2 időpontban Ramos a következőt 
 írta:
>
> i installed it and get the message to add web2py to the project
>
> what project?
>
> you should do a 1 minute video to show how to use it
>
> thank u
>
> 2015-05-05 7:43 GMT+01:00 Gergely Orosz :
>
>> Thank you Massimo,
>>
>> I am going to improve it continuously
>>
>> 2015. május 4., hétfő 18:24:34 UTC+2 időpontban Massimo Di Pierro 
>> a következőt írta:
>>>
>>> Nice. Thank you! I added link form the web2py examples/ app.
>>>
>>> On Monday, 4 May 2015 05:28:55 UTC-5, Gergely Orosz wrote:

 Hi 4 All,

 I've started to develop a web2py plugin for Sublime Text 3.
 I've implemented a few command I found very useful on my daily 
 work.
 If you have any idea how can I make it better and useful please 
 visit the below link and submit your feature request there
 Thanks in advance

 You can find the plugin: https://bitbucket.org/kfog/w2p

 If you have any question please feel free to ask here or on the 
 Issue tracker

 All the best
 Greg

>>>  -- 
>> 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/web2p

Re: [web2py] Re: Brainstorming

2015-05-06 Thread JorgeH
React.js is not that new.

They are pretty similar.

Here is an article from May 6th 2014. Exactly 365 days ago.

http://blog.ractivejs.org/posts/whats-the-difference-between-react-and-ractive/

Massimo is already implementing ractive.js into web2py with impressive 
accomplishes.


http://www.ractivejs.org/

On Wednesday, May 6, 2015 at 11:06:38 AM UTC-5, mcm wrote:
>
> IMHO ReactJS is no newer than Ractive.js.  It's being backed by facebook 
> since a while ago.  I like the author's philosophy (read independence ) and 
> design simplicity of Ractive.js, things that I appreciate even more in 
> web2py, but that's a matter of personal taste :-)
>
> 2015-05-06 17:23 GMT+02:00 Ron Chatterjee  >:
>
>> That will be a cool concept!:-). I would love to see its done.
>>
>> On Wednesday, May 6, 2015 at 11:16:58 AM UTC-4, Ramos wrote:
>>>
>>> We are talking about integrating web2py with javascript ui frameworks
>>>
>>>
>>> 2015-05-06 16:09 GMT+01:00 Ron Chatterjee :
>>>
 What is this post is all about regarding web2py? Just went over my 
 head! 

 On Wednesday, May 6, 2015 at 10:38:39 AM UTC-4, Richard wrote:
>
> I think it will be difficult to make everyone happy with a given 
> choice...
>
> Michele "agnostic" point is good even if in pratice it may be 
> difficult (let say BS2 for instance we were maried with it until recently)
>
> Ractive.js as Massimo imaged is Ractive.js is to Angular.js what 
> web2py is to Django
>
> The main issue with Ractive.js is it documentation which is not to bad 
> actually but difficult to apprend, but it lacks of concreate examples...
>
> The user base seem limited and the project don't seem to be really 
> active...
>
> I would have a welcome based on W3 repo that Massimo publish on github 
> showing how to properly integrate with Ractive.js
>
> How to structure correctly the code remain to me a challenge
>
> Richard
>
> On Wed, May 6, 2015 at 7:45 AM, Ramos  wrote:
>
>> There is a new kid on the block
>>
>> Reactjs
>>
>> Any experiment with it and web2py ?
>> Seems a lot less complex than angularjs
>>
>> Regards
>>
>>
>> Em quinta-feira, 3 de julho de 2014 09:46:06 UTC+1, Mirek Zvolský 
>> escreveu:
>>>
>>> Here is a project which lists and compares a little javascript 
>>> frameworks:
>>> todomvc.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+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+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] Two SQLFORMs side by side?

2015-05-06 Thread Richard Vézina
Let say the FK field is field2 :

Field('field2','reference main_table',  # Better syntax thand
"db.main_table"
 widget=AutocompleteWidgetSelectOrAddOption(
request=request,
field=db.main_table.field1,
 # which is you reprensting field
id_field=db.main_table.id,
limitby=(0, 10),  # how
much records you want in the dropbox
min_length=6,  # when you
want the autocomplete pop in or how many caracters user have to entered
before the autocomplete kickin
form_title=T('Add new
title'),
controller="controler name
that contains the below function",
function="your add function
name",
button_text=T('Add new'),
placeholder=T('Start
typing...'))

Richard

On Wed, May 6, 2015 at 12:34 PM, LoveWeb2py  wrote:

> Thank you, Richard. I think i'm getting closer. Could you show me an
> example of how you apply this to a specific field in SQLFORM?
>
> Going back to my original model:
>
> db.define_table('main_table',
> Field('field1','string'),
> Field('field2','string'),
> migrate=False)
>
> db.define_table('second_table',
> Field('field1','db.main_table'),
> Field('field2','db.main_table')
> migrate=False)
>
> How could I integrate your widget with field 2 for a SQLFORM?
>
>
>
>
>
>
> On Wednesday, May 6, 2015 at 9:40:02 AM UTC-4, Richard wrote:
>>
>> The id field and what field you want to show as a representation of the
>> id field of the referenced table...
>>
>> Start by putting the widget class in model file even if it not a good
>> thing to see if you can make it works...
>>
>> In the module I have these imports :
>>
>> from gluon.html import *
>> from gluon.sqlhtml import *
>> from gluon import current
>> from gluon.compileapp import LOAD
>>
>>
>> Which may not be related to the widget class...
>>
>> Richard
>>
>>
>> On Tue, May 5, 2015 at 4:28 PM, LoveWeb2py  wrote:
>>
>> Hi Richard,
>>
>> I'm trying to get this setup, but am receiving an error self.url =
>> URL(args=request.args)\nNameError: global name \'URL\' is not defined\n'.
>> I'm wondering if this is because the gluon hasn't been imported yet.
>>
>> Also, could you ellaborate more on this?
>>
>>
>> field=db.table.representing_field,
>>
>> id_field=db.table.id_field,
>>
>> id_field should be the foreignkey table if I am not mistaking?
>> db.table.representing field, and db.table2.id_field (with foreign key) does
>> that sound right?
>>
>>
>> On Wednesday, April 29, 2015 at 10:04:35 AM UTC-4, Richard wrote:
>>
>> *# In a modules :*
>>
>> class AutocompleteWidgetSelectOrAddOption(object):
>> _class = 'string'
>>
>> def __init__(self,
>>  request,
>>  field,
>>  id_field=None,
>>  db=None,
>>  orderby=None,
>>  limitby=(0, 10),
>>  keyword='_autocomplete_%(fieldname)s',
>>  min_length=2,
>>  #
>> -
>>  # From : SelectOrAddOption
>>  controller=None, function=None, form_title=None,
>>  button_text = None, dialog_width=1000,
>>  #
>> -
>>  placeholder=None
>>  ):
>> self.request = request
>> self.keyword = keyword % dict(fieldname=field.name)
>> self.db = db or field._db
>> self.orderby = orderby
>> self.limitby = limitby
>> self.min_length = min_length
>> self.fields = [field]
>> self.placeholder = placeholder
>> if id_field:
>> self.is_reference = True
>> self.fields.append(id_field)
>> else:
>> self.is_reference = False
>> if hasattr(request, 'application'):
>> self.url = URL(args=request.args)
>> self.callback()
>> else:
>> self.url = request
>> #
>> --
>> # From : SelectOrAddOption
>> if form_title is None:
>> self.form_title = current.T('Add New')
>> else:
>> self.form_title = current.T(form_title)
>> if button_text is None:
>> self.button_text = current.T('Add')
>> else:
>> self.button_text = current.T(button_text)
>> self.dialog_width = dialog_width
>>
>> self.controller = controller
>> self.function = function
>>

Re: [web2py] Two SQLFORMs side by side?

2015-05-06 Thread LoveWeb2py
Thank you, Richard. I think i'm getting closer. Could you show me an 
example of how you apply this to a specific field in SQLFORM?

Going back to my original model:

db.define_table('main_table',
Field('field1','string'),
Field('field2','string'),
migrate=False)

db.define_table('second_table',
Field('field1','db.main_table'),
Field('field2','db.main_table')
migrate=False)

How could I integrate your widget with field 2 for a SQLFORM?






On Wednesday, May 6, 2015 at 9:40:02 AM UTC-4, Richard wrote:
>
> The id field and what field you want to show as a representation of the id 
> field of the referenced table...
>
> Start by putting the widget class in model file even if it not a good 
> thing to see if you can make it works...
>
> In the module I have these imports : 
>
> from gluon.html import *
> from gluon.sqlhtml import *
> from gluon import current
> from gluon.compileapp import LOAD
>
>
> Which may not be related to the widget class...
>
> Richard
>
>
> On Tue, May 5, 2015 at 4:28 PM, LoveWeb2py  > wrote:
>
> Hi Richard,
>
> I'm trying to get this setup, but am receiving an error self.url = 
> URL(args=request.args)\nNameError: global name \'URL\' is not defined\n'. 
> I'm wondering if this is because the gluon hasn't been imported yet.
>
> Also, could you ellaborate more on this?
>
> 
> field=db.table.representing_field,
> id_field=db.table.id_field,
>
> id_field should be the foreignkey table if I am not mistaking? 
> db.table.representing field, and db.table2.id_field (with foreign key) does 
> that sound right?
>
>
> On Wednesday, April 29, 2015 at 10:04:35 AM UTC-4, Richard wrote:
>
> *# In a modules :*
>
> class AutocompleteWidgetSelectOrAddOption(object):
> _class = 'string'
>
> def __init__(self,
>  request,
>  field,
>  id_field=None,
>  db=None,
>  orderby=None,
>  limitby=(0, 10),
>  keyword='_autocomplete_%(fieldname)s',
>  min_length=2,
>  # 
> -
>  # From : SelectOrAddOption
>  controller=None, function=None, form_title=None,
>  button_text = None, dialog_width=1000,
>  # 
> -
>  placeholder=None
>  ):
> self.request = request
> self.keyword = keyword % dict(fieldname=field.name)
> self.db = db or field._db
> self.orderby = orderby
> self.limitby = limitby
> self.min_length = min_length
> self.fields = [field]
> self.placeholder = placeholder
> if id_field:
> self.is_reference = True
> self.fields.append(id_field)
> else:
> self.is_reference = False
> if hasattr(request, 'application'):
> self.url = URL(args=request.args)
> self.callback()
> else:
> self.url = request
> # 
> --
> # From : SelectOrAddOption
> if form_title is None:
> self.form_title = current.T('Add New')
> else:
> self.form_title = current.T(form_title)
> if button_text is None:
> self.button_text = current.T('Add')
> else:
> self.button_text = current.T(button_text)
> self.dialog_width = dialog_width
>
> self.controller = controller
> self.function = function
> # 
> --
>
> def callback(self):
> if self.keyword in self.request.vars:
> field = self.fields[0]
> rows = self.db(field.like(self.request.vars[self.keyword]+'%')
>).select(orderby=self.orderby, 
> limitby=self.limitby, *self.fields)
> if rows:
> if self.is_reference:
> id_field = self.fields[1]
> raise HTTP(200, SELECT(_id=self.keyword, 
> _class='autocomplete',
>_size=len(rows), 
> _multiple=(len(rows) == 1),
>*[OPTION(s[field.name], 
> _value=s[id_field.name],
> _selected=(k == 0))
>  for k, s in 
> enumerate(rows)]).xml())
> else:
> raise HTTP(200, SELECT(_id=self.keyword, 
> _class='autocomplete',
>_size=len(rows), 
> _multiple=(len(rows) == 1),
>*[OPTION(s[field.name],
>  

Re: [web2py] Re: Brainstorming

2015-05-06 Thread Michele Comitini
IMHO ReactJS is no newer than Ractive.js.  It's being backed by facebook
since a while ago.  I like the author's philosophy (read independence ) and
design simplicity of Ractive.js, things that I appreciate even more in
web2py, but that's a matter of personal taste :-)

2015-05-06 17:23 GMT+02:00 Ron Chatterjee :

> That will be a cool concept!:-). I would love to see its done.
>
> On Wednesday, May 6, 2015 at 11:16:58 AM UTC-4, Ramos wrote:
>>
>> We are talking about integrating web2py with javascript ui frameworks
>>
>>
>> 2015-05-06 16:09 GMT+01:00 Ron Chatterjee :
>>
>>> What is this post is all about regarding web2py? Just went over my head!
>>>
>>> On Wednesday, May 6, 2015 at 10:38:39 AM UTC-4, Richard wrote:

 I think it will be difficult to make everyone happy with a given
 choice...

 Michele "agnostic" point is good even if in pratice it may be difficult
 (let say BS2 for instance we were maried with it until recently)

 Ractive.js as Massimo imaged is Ractive.js is to Angular.js what web2py
 is to Django

 The main issue with Ractive.js is it documentation which is not to bad
 actually but difficult to apprend, but it lacks of concreate examples...

 The user base seem limited and the project don't seem to be really
 active...

 I would have a welcome based on W3 repo that Massimo publish on github
 showing how to properly integrate with Ractive.js

 How to structure correctly the code remain to me a challenge

 Richard

 On Wed, May 6, 2015 at 7:45 AM, Ramos  wrote:

> There is a new kid on the block
>
> Reactjs
>
> Any experiment with it and web2py ?
> Seems a lot less complex than angularjs
>
> Regards
>
>
> Em quinta-feira, 3 de julho de 2014 09:46:06 UTC+1, Mirek Zvolský
> escreveu:
>>
>> Here is a project which lists and compares a little javascript
>> frameworks:
>> todomvc.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+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.
>

-- 
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] Re: Is it possible to create a webservice funcion for login (instead of basic authentication)?

2015-05-06 Thread Lisandro
Thanks! I like this solution, I will give it a try.


El miércoles, 6 de mayo de 2015, 12:34:13 (UTC-3), mcm escribió:
>
> if you do not want to use basic auth, a common pattern is  having a 
> service that generates a temporary token and then having the client pass 
> the token with each call.
>
> @service.xmlrpc
> def get_auth_token(user, password):
>...
>return token
>
> @service.xmlrpc
> def aservicemethod(token, ...):
> check_token(...)
>
> you can create a decorator to call check_token in a more elegant and 
> readable fashion ;-)
>
>
> 2015-05-05 20:51 GMT+02:00 Niphlod >:
>
>> usually services do not make use of session cookies, that are the ones 
>> web2py checks. A service should use something like basic authentication...
>>
>>
>> On Tuesday, May 5, 2015 at 6:57:23 PM UTC+2, Lisandro wrote:
>>>
>>> I'm creating a XMLRPC webservice with web2py, everything works perfect. 
>>> In order to restrict access to the webservice, acordingly to the docs, 
>>> you have to decorate the function that instantiates the webservice, for 
>>> example:
>>>
>>> @auth.requires_login()
>>> def call():
>>> return service()
>>>
>>>
>>> @service.xmlrpc
>>> def check():
>>> return auth.user.email
>>>
>>> So, in order to connect to this webservice, you would have to pass the 
>>> user and password in the url, like this:
>>> http://user:email@domain/default/call/xmlrpc
>>> And then you would be able to run the function "check()" of the 
>>> webservice.
>>>
>>> So far all good. But what if I want to create a public webservice, and 
>>> include a function for login (taking user and email as arguments)? The 
>>> function should login the user and next calls to other functions should be 
>>> able to check if user is logged in.
>>>
>>> I've tried this with no success:
>>>
>>> def call():
>>> return service()
>>>
>>>
>>> @service.xmlrpc
>>> def login(data):
>>> user = auth.login_bare(data['email'], data['password'])
>>> if not user:
>>> return False
>>> else:
>>> auth.login_user(user)
>>> return True
>>>
>>>
>>> @service.xmlrpc
>>> def check():
>>> if auth.is_logged_in():
>>> return auth.user.email
>>> else:
>>> return False
>>>
>>> However this doesn't work. I can succesfully connect to the webservice, 
>>> and I can succesfully execute "login()" function, but then inmediately I 
>>> execute "check()" function and I always receive False, so the session isn't 
>>> created.
>>>
>>> For the testing client I'm using class ServerProxy from python 
>>> xmlrpclib. 
>>> I know this is easy to fix (using the first of the two examples shown 
>>> here), but not all clients support basic authentication and I'm trying to 
>>> figure out what to do for those cases. Thanks in advance!
>>>
>>  -- 
>> 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] Re: Is it possible to create a webservice funcion for login (instead of basic authentication)?

2015-05-06 Thread Michele Comitini
if you do not want to use basic auth, a common pattern is  having a service
that generates a temporary token and then having the client pass the token
with each call.

@service.xmlrpc
def get_auth_token(user, password):
   ...
   return token

@service.xmlrpc
def aservicemethod(token, ...):
check_token(...)

you can create a decorator to call check_token in a more elegant and
readable fashion ;-)


2015-05-05 20:51 GMT+02:00 Niphlod :

> usually services do not make use of session cookies, that are the ones
> web2py checks. A service should use something like basic authentication...
>
>
> On Tuesday, May 5, 2015 at 6:57:23 PM UTC+2, Lisandro wrote:
>>
>> I'm creating a XMLRPC webservice with web2py, everything works perfect.
>> In order to restrict access to the webservice, acordingly to the docs,
>> you have to decorate the function that instantiates the webservice, for
>> example:
>>
>> @auth.requires_login()
>> def call():
>> return service()
>>
>>
>> @service.xmlrpc
>> def check():
>> return auth.user.email
>>
>> So, in order to connect to this webservice, you would have to pass the
>> user and password in the url, like this:
>> http://user:email@domain/default/call/xmlrpc
>> And then you would be able to run the function "check()" of the
>> webservice.
>>
>> So far all good. But what if I want to create a public webservice, and
>> include a function for login (taking user and email as arguments)? The
>> function should login the user and next calls to other functions should be
>> able to check if user is logged in.
>>
>> I've tried this with no success:
>>
>> def call():
>> return service()
>>
>>
>> @service.xmlrpc
>> def login(data):
>> user = auth.login_bare(data['email'], data['password'])
>> if not user:
>> return False
>> else:
>> auth.login_user(user)
>> return True
>>
>>
>> @service.xmlrpc
>> def check():
>> if auth.is_logged_in():
>> return auth.user.email
>> else:
>> return False
>>
>> However this doesn't work. I can succesfully connect to the webservice,
>> and I can succesfully execute "login()" function, but then inmediately I
>> execute "check()" function and I always receive False, so the session isn't
>> created.
>>
>> For the testing client I'm using class ServerProxy from python xmlrpclib.
>> I know this is easy to fix (using the first of the two examples shown
>> here), but not all clients support basic authentication and I'm trying to
>> figure out what to do for those cases. Thanks in advance!
>>
>  --
> 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] Re: Brainstorming

2015-05-06 Thread Ron Chatterjee
That will be a cool concept!:-). I would love to see its done.

On Wednesday, May 6, 2015 at 11:16:58 AM UTC-4, Ramos wrote:
>
> We are talking about integrating web2py with javascript ui frameworks
>
>
> 2015-05-06 16:09 GMT+01:00 Ron Chatterjee  >:
>
>> What is this post is all about regarding web2py? Just went over my head! 
>>
>> On Wednesday, May 6, 2015 at 10:38:39 AM UTC-4, Richard wrote:
>>>
>>> I think it will be difficult to make everyone happy with a given 
>>> choice...
>>>
>>> Michele "agnostic" point is good even if in pratice it may be difficult 
>>> (let say BS2 for instance we were maried with it until recently)
>>>
>>> Ractive.js as Massimo imaged is Ractive.js is to Angular.js what web2py 
>>> is to Django
>>>
>>> The main issue with Ractive.js is it documentation which is not to bad 
>>> actually but difficult to apprend, but it lacks of concreate examples...
>>>
>>> The user base seem limited and the project don't seem to be really 
>>> active...
>>>
>>> I would have a welcome based on W3 repo that Massimo publish on github 
>>> showing how to properly integrate with Ractive.js
>>>
>>> How to structure correctly the code remain to me a challenge
>>>
>>> Richard
>>>
>>> On Wed, May 6, 2015 at 7:45 AM, Ramos  wrote:
>>>
 There is a new kid on the block

 Reactjs

 Any experiment with it and web2py ?
 Seems a lot less complex than angularjs

 Regards


 Em quinta-feira, 3 de julho de 2014 09:46:06 UTC+1, Mirek Zvolský 
 escreveu:
>
> Here is a project which lists and compares a little javascript 
> frameworks:
> todomvc.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+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.


Re: [web2py] Re: Brainstorming

2015-05-06 Thread António Ramos
We are talking about integrating web2py with javascript ui frameworks


2015-05-06 16:09 GMT+01:00 Ron Chatterjee :

> What is this post is all about regarding web2py? Just went over my head!
>
> On Wednesday, May 6, 2015 at 10:38:39 AM UTC-4, Richard wrote:
>>
>> I think it will be difficult to make everyone happy with a given choice...
>>
>> Michele "agnostic" point is good even if in pratice it may be difficult
>> (let say BS2 for instance we were maried with it until recently)
>>
>> Ractive.js as Massimo imaged is Ractive.js is to Angular.js what web2py
>> is to Django
>>
>> The main issue with Ractive.js is it documentation which is not to bad
>> actually but difficult to apprend, but it lacks of concreate examples...
>>
>> The user base seem limited and the project don't seem to be really
>> active...
>>
>> I would have a welcome based on W3 repo that Massimo publish on github
>> showing how to properly integrate with Ractive.js
>>
>> How to structure correctly the code remain to me a challenge
>>
>> Richard
>>
>> On Wed, May 6, 2015 at 7:45 AM, Ramos  wrote:
>>
>>> There is a new kid on the block
>>>
>>> Reactjs
>>>
>>> Any experiment with it and web2py ?
>>> Seems a lot less complex than angularjs
>>>
>>> Regards
>>>
>>>
>>> Em quinta-feira, 3 de julho de 2014 09:46:06 UTC+1, Mirek Zvolský
>>> escreveu:

 Here is a project which lists and compares a little javascript
 frameworks:
 todomvc.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+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] Re: Brainstorming

2015-05-06 Thread Ron Chatterjee
What is this post is all about regarding web2py? Just went over my head! 

On Wednesday, May 6, 2015 at 10:38:39 AM UTC-4, Richard wrote:
>
> I think it will be difficult to make everyone happy with a given choice...
>
> Michele "agnostic" point is good even if in pratice it may be difficult 
> (let say BS2 for instance we were maried with it until recently)
>
> Ractive.js as Massimo imaged is Ractive.js is to Angular.js what web2py is 
> to Django
>
> The main issue with Ractive.js is it documentation which is not to bad 
> actually but difficult to apprend, but it lacks of concreate examples...
>
> The user base seem limited and the project don't seem to be really 
> active...
>
> I would have a welcome based on W3 repo that Massimo publish on github 
> showing how to properly integrate with Ractive.js
>
> How to structure correctly the code remain to me a challenge
>
> Richard
>
> On Wed, May 6, 2015 at 7:45 AM, Ramos > 
> wrote:
>
>> There is a new kid on the block
>>
>> Reactjs
>>
>> Any experiment with it and web2py ?
>> Seems a lot less complex than angularjs
>>
>> Regards
>>
>>
>> Em quinta-feira, 3 de julho de 2014 09:46:06 UTC+1, Mirek Zvolský 
>> escreveu:
>>>
>>> Here is a project which lists and compares a little javascript 
>>> frameworks:
>>> todomvc.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+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] Re: Brainstorming

2015-05-06 Thread António Ramos
I didnt say Ractive.js

I wrote

React.JS

https://www.youtube.com/watch?v=rFvZydtmsxM

2015-05-06 15:38 GMT+01:00 Richard Vézina :

> I think it will be difficult to make everyone happy with a given choice...
>
> Michele "agnostic" point is good even if in pratice it may be difficult
> (let say BS2 for instance we were maried with it until recently)
>
> Ractive.js as Massimo imaged is Ractive.js is to Angular.js what web2py is
> to Django
>
> The main issue with Ractive.js is it documentation which is not to bad
> actually but difficult to apprend, but it lacks of concreate examples...
>
> The user base seem limited and the project don't seem to be really
> active...
>
> I would have a welcome based on W3 repo that Massimo publish on github
> showing how to properly integrate with Ractive.js
>
> How to structure correctly the code remain to me a challenge
>
> Richard
>
>
> On Wed, May 6, 2015 at 7:45 AM, Ramos  wrote:
>
>> There is a new kid on the block
>>
>> Reactjs
>>
>> Any experiment with it and web2py ?
>> Seems a lot less complex than angularjs
>>
>> Regards
>>
>>
>> Em quinta-feira, 3 de julho de 2014 09:46:06 UTC+1, Mirek Zvolský
>> escreveu:
>>>
>>> Here is a project which lists and compares a little javascript
>>> frameworks:
>>> todomvc.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.
>> 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] IS_IN_DB() multiple tables

2015-05-06 Thread Richard Vézina
A set which you have, but your validator has wrong syntax :

IS_IN_DB(db(db.ipaddress.status=='Free'),db.ipaddress.ip, '%(ip)s')

free_ip_set = db(db.ipaddress.status=='Free')
IS_IN_DB(free_ip_set, 'ipaddress.ip', '%(ip)s')

Try this... You define the set before you server table and after the
ipaddress table..

Richard

On Tue, May 5, 2015 at 9:46 AM,  wrote:

> Hi All,
>
> I have very basic dtabasae where in one table i have IPs which are used in
> second table:
>
> db.define_table('ipaddress',
>Field('ip', unique=True, length=200,requires=IS_NOT_EMPTY()),
>Field('subnet', length=200, requires=IS_NOT_EMPTY() ),
>Field('status', length=200, default="Free",
> requires=IS_IN_SET(['Free','Used'])),
>format = '%(ip)s')
>
> db.define_table('server',
>Field('servername', length=200),
>Field('port', length=200, requires=IS_NOT_EMPTY()),
>Field('ipaddress', unique=True, length=200,
> requires=IS_IN_DB(db(db.ipaddress.status=='Free'),db.ipaddress.ip,
> '%(ip)s')),
>
>
> The problem i'm having is that with grid i can delete and add new values
> to "server" table and i added function which update status of IP for USED
> or FREE after insert/delete.
> Problem is with Update function as when i try to update server name i need
> to chose IP again and i can't chose same IP as it is marked in ipaddress
> table as USED hence it's not displayed in dropdown menu.
> How can i display all IPs that are marked as FREE in ipaddress table AND
> IPs that where currently assign to the record i'm updateing in table
> server?
>
> 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.
>

-- 
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] Re: Brainstorming

2015-05-06 Thread Richard Vézina
I think it will be difficult to make everyone happy with a given choice...

Michele "agnostic" point is good even if in pratice it may be difficult
(let say BS2 for instance we were maried with it until recently)

Ractive.js as Massimo imaged is Ractive.js is to Angular.js what web2py is
to Django

The main issue with Ractive.js is it documentation which is not to bad
actually but difficult to apprend, but it lacks of concreate examples...

The user base seem limited and the project don't seem to be really active...

I would have a welcome based on W3 repo that Massimo publish on github
showing how to properly integrate with Ractive.js

How to structure correctly the code remain to me a challenge

Richard

On Wed, May 6, 2015 at 7:45 AM, Ramos  wrote:

> There is a new kid on the block
>
> Reactjs
>
> Any experiment with it and web2py ?
> Seems a lot less complex than angularjs
>
> Regards
>
>
> Em quinta-feira, 3 de julho de 2014 09:46:06 UTC+1, Mirek Zvolský escreveu:
>>
>> Here is a project which lists and compares a little javascript frameworks:
>> todomvc.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.
> 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] After changing db adapter "relation 'auth_user' already exists"

2015-05-06 Thread Ian W. Scott
To work around my earlier unicode problem (I submitted an issue on Github) 
I switched from the pg8000 adapter to the psycopg2 adapter for my postgre 
database. Everything works fine as long as I have migrate set to False. But 
if I set migrate=True I get this error:

(relation "auth_user" already exists 
)

This is strange because the dal shouldn't be trying to perform any 
migrations. Nothing in the model definitions or the db structure was 
changed. The only change was the db adapter. Thinking my .table files might 
have been corrupted, I tried doing a fake migrate by setting migrate=False 
and fake_migrate_all=True, then switching both values again. But nothing 
has changed. I'm still getting the same error as long as migrations are 
turned on.

Here's the full traceback:

Traceback (most recent call last):
 File "/home/ian/web/web2py-dev/gluon/restricted.py", line 227, in restricted
 exec ccode in environment
 File "/home/ian/web/web2py-dev/applications/paideia/models/db.py" 
, line 192, in 

 auth.define_tables() # creates all needed tables
 File "/home/ian/web/web2py-dev/gluon/tools.py", line 1893, in define_tables
 format='%(first_name)s %(last_name)s (%(id)s)'))
 File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/base.py", line 817, in 
define_table
 table = self.lazy_define_table(tablename,*fields,**args)
 File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/base.py", line 856, in 
lazy_define_table
 polymodel=polymodel)
 File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/adapters/base.py", 
line 463, in create_table
 self.create_sequence_and_triggers(query,table)
 File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/adapters/postgres.py", 
line 86, in create_sequence_and_triggers
 self.execute(query)
 File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/adapters/base.py", 
line 1326, in execute
 return self.log_execute(*a, **b)
 File "/home/ian/web/web2py-dev/gluon/packages/dal/pydal/adapters/base.py", 
line 1320, in log_execute
 ret = self.cursor.execute(command, *a[1:], **b)
ProgrammingError: relation "auth_user" already exists

-- 
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: cache.redis server unavailable = traceback. Bug?

2015-05-06 Thread Jose C
Hmm, I see your point and use case.  But... ;)   given that there are 
references in the manual (and probably in reality the majority of use 
cases) to caching views, or db queries, etc.  how about then, as an 
enhancement, to add an init flag to cache.redis along the lines of 
`die_if_server_unavailable = True`  to force a halt with the traceback.  Or 
else if set to False, fail silently and gracefully (key didn't exist 
behaviour, re-execute function)  and let the system keep running?  
Obviously the flag name itself is up for debate.

Would this not provide the best of both worlds and max flexibility?  If you 
(as the cache.redis creator) agree I'll take a stab at adding that 
functionality to redis_cache.py and issue a PR.









On Wednesday, 6 May 2015 14:41:58 UTC+1, Niphlod wrote:
>
> up until now, cache behaviours in web2py are a taddle bit different than 
> the rest of the world. cache(s) in web2py usually mean "I'd like to compute 
> something huge one time only" and so the general idea is that if you need 
> to compute it, you should be damn sure to do so. You may also be relying on 
> that assumption e.g. to get a huge stream of results from an external 
> server that bills you if you go over the quota. 
> The "original retry logic" is done to avoid erroring out when redis is 
> restarted .  we may add some parameter around to change the behaviour but 
> since it's missing from cache.ram and cache.disk for obvious reasons I 
> don't know how much traction it could get.
>
> On Wednesday, May 6, 2015 at 2:33:51 PM UTC+2, Jose C wrote:
>>
>> Greetings,
>>
>> I have always assumed that if cache is unavailable, then the fallback is 
>> to serve the content from original source again (i.e. treat as if key does 
>> not exist).
>>
>> I was surprised today when I got a ConnectionError tracebacks when the 
>> redis server was not online.  Checking the source it appears this is by 
>> design - it retries connecting 5 times over a total period of 30 seconds 
>> (!) before giving up and issuing the traceback.
>>
>> Question:  Is this the default expected behaviour (grind to a halt with a 
>> traceback) or just an oversight?  My thinking is that cache.redis should 
>> fallback gracefully and respond as if the key never existed when it cannot 
>> connect to the redis server.  Certainly it should log a warning or error as 
>> well, but not bring the site down effectively.
>>
>> I know I can wrap all cache calls in try: except: blocks to trap for that 
>> error, however that seems extreme and the more elegant solution would be to 
>> handle it within cache.redis itself. 
>>
>> Incidentally, blocking a thread for 30 seconds while waiting for the 
>> redis server also seems like overkill.  Surely if redis hasn't responded 
>> within 5 seconds max it's time to move on?
>>
>> Thoughts?  If I'm not missing something I'm happy to open an issue on 
>> github.
>>
>> web2py ver: 2.10.4
>>
>> Regards,
>> Jose C
>>
>>

-- 
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] Re: Sublime Text web2py plugin

2015-05-06 Thread JorgeH
I installed in win 7.

Haven´t been able to get it working.

On Wednesday, May 6, 2015 at 7:09:38 AM UTC-5, Gergely Orosz wrote:
>
> You should use command palette again
> Search for SublimeREPL: Web2py {your application name}
> It should start interactive console for your web2py application
>
> 2015. május 6., szerda 12:34:17 UTC+2 időpontban Ramos a következőt írta:
>>
>> On more question.
>> i installed sublime repl but how do i get the web2py interactive console ?
>>
>> thank u
>>
>> 2015-05-06 11:25 GMT+01:00 António Ramos :
>>
>>> From the controller i can open the view
>>>
>>> From the view i should open the controller , not the view again...
>>>
>>> thank u
>>>
>>> 2015-05-06 11:22 GMT+01:00 António Ramos :
>>>
 I have seen the light

 Keep working on it. Its very good...

 2015-05-06 10:06 GMT+01:00 Gergely Orosz :

> Once you installed the plugin restart Sublime Text
> After that you can use the command palette to check the available 
> commands
> All prefixed all web2py related command with W2P 
> if you press CTRL+SHIFT+P and start type W2P you will see all the 
> available commands
>
> 2015. május 6., szerda 10:44:20 UTC+2 időpontban Ramos a következőt 
> írta:
>>
>> Thank you
>> You say it can start and stop the server ...
>> how ?
>>
>> 2015-05-06 6:52 GMT+01:00 Gergely Orosz :
>>
>>> Hi Ramos,
>>>
>>> You should add a web2py application folder to a Sublime Text 
>>> prokeject
>>> 1. Open Sublime go to the Project menu
>>> 2. Choose Add folder to project option
>>> 3. Browse your web2py application you like to work on
>>>
>>> You are ready to use the W2P plugin
>>>
>>> I am going to make the video tutorial on the weekend and also going 
>>> to update the plugin read with these steps
>>>
>>> Thank you letting me know
>>>
>>> 2015. május 5., kedd 13:16:36 UTC+2 időpontban Ramos a következőt 
>>> írta:

 i installed it and get the message to add web2py to the project

 what project?

 you should do a 1 minute video to show how to use it

 thank u

 2015-05-05 7:43 GMT+01:00 Gergely Orosz :

> Thank you Massimo,
>
> I am going to improve it continuously
>
> 2015. május 4., hétfő 18:24:34 UTC+2 időpontban Massimo Di Pierro 
> a következőt írta:
>>
>> Nice. Thank you! I added link form the web2py examples/ app.
>>
>> On Monday, 4 May 2015 05:28:55 UTC-5, Gergely Orosz wrote:
>>>
>>> Hi 4 All,
>>>
>>> I've started to develop a web2py plugin for Sublime Text 3.
>>> I've implemented a few command I found very useful on my daily 
>>> work.
>>> If you have any idea how can I make it better and useful please 
>>> visit the below link and submit your feature request there
>>> Thanks in advance
>>>
>>> You can find the plugin: https://bitbucket.org/kfog/w2p
>>>
>>> If you have any question please feel free to ask here or on the 
>>> Issue tracker
>>>
>>> All the best
>>> Greg
>>>
>>  -- 
> 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+un...@googlegroups.com.
> For more options, visit https://gro

Re: [web2py] Re: Issue with lookup foreign key / format statement in 2.10.3

2015-05-06 Thread Massimo Di Pierro
yes please.

On Wednesday, 6 May 2015 08:28:45 UTC-5, Hilton Shumway wrote:
>
> The pydal in my web2py download today (2.10.4) has the changes from 
> https://github.com/web2py/pydal/pull/137*, *yet I still have the same 
> issue. Should I open a separate bug?
>
> On Tuesday, April 28, 2015 at 1:39:35 PM UTC-6, Jim S wrote:
>>
>> My problem turned out to be that I didn't have the latest pydal.  I'd 
>> installed it separately from web2py and when I updated web2py, pydal didn't 
>> automatically update.  I removed my separate pydal and then installed the 
>> latest web2py (using git) and then everything worked for me.
>>
>> On Tuesday, April 28, 2015 at 2:26:23 PM UTC-5, Hilton Shumway wrote:
>>>
>>>
>>>
>>> On Monday, April 20, 2015 at 4:30:03 PM UTC-6, Jim S wrote:

 I'm running 2.10.4 beta.  Grabbed it from github this morning.

 On Mon, Apr 20, 2015 at 5:10 PM, Dave S  wrote:

>
>
> On Monday, April 20, 2015 at 10:02:44 AM UTC-7, Jim S wrote:
>>
>> Can someone tell me if this is fixed?
>>
>> I'm still having issues but maybe I'm doing something wrong:
>>
>>
> What version of Web2Py are you running?
>
>
>>>
>>> I'm finding this same bug in latest git (54b385b32192d9f). Some testing 
>>> determined that commit caa19765106522a51 was the first to introduce it.
>>>
>>>
>>> Hilton
>>>
>>>
>>> /dps
>  
>
> -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/web2py/2i9zfAzG2s8/unsubscribe.
> To unsubscribe from this group and all its topics, 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] D3.js DC.js Crossfilter.js - table not showing

2015-05-06 Thread Massimo Di Pierro
we need to see some code. My guess is you are using URL(...) in a static JS 
file.

On Tuesday, 5 May 2015 10:36:32 UTC-5, Ramos wrote:
>
>
> 2014-05-20 10:19 GMT+01:00 thehuman trashcan :
>
>> URL('views', 'default/dashboard_data.json')
>
>
> the URL('views', 'default/dashboard_data.json') is valid ?
> pasting just the corresponding url in the browsers returns your data?
> try 
> console.log(data) before
>
> var dtgFormat = d3.time.format("%d/%m/%Y");
> and see in the browser console if you see your data...
>
>

-- 
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: json-encoded requests in web2py

2015-05-06 Thread Massimo Di Pierro
I think we need an explicit issue to understand the problem. Open an issue 
so we can track it even if I do not think there is an issue.

On Monday, 4 May 2015 10:56:35 UTC-5, Louis Amon wrote:
>
> I've recently had a pretty annoying issue when using web2py with AngularJS 
> :
>
> By default, AngularJS sends JSON-encoded requests when you use the $http 
> service, so a POST request would look like this : 
> "{"firstName":"John"}"
>
>
> For some reason I don't really understand, web2py natively understands 
> this JSON request a populates request.vars accordingly.
>
> Why does web2py understand JSON requests ? Aren't POST requests (forms) 
> supposed to be url-encoded ?
>
>
> The issue I ended up facing because of this is when AngularJS sends a 
> request that contains accentuated characters, e.g. :
>  "{"firstName":"Cédric"}"
>
> When the regular HTML form processing would require something like:
> "firstName=C%C3%A9dric"
>
>
>
> With the JSON request, web2py ends up populating request.vars like this : 
> Storage(firstName=u'Cédric')
>
> And so I get tons of *UnicodeEncodeError* when using web2py widgets or 
> the URL helper...
>
> For instance I have a URL(..., vars=request.vars) in a model and this 
> raises an Exception (HTTP 500) every time the server receives a 
> JSON-encoded request with accentuated characters.
>
>
> *Shouldn't web2py be able to either convert JSON-encoded unicode strings 
> ot reject them altogether without raising an exception ?*
>
>
>
> ...for the record : my solution so far was to hack the $http service in 
> AngularJS into sending url-encoded strings instead of JSON.
>
> I started this post solely because I think there is something wrong going 
> on here with web2py and because many people post about UnicodeEncodeError 
> in web2py
>

-- 
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: cache.redis server unavailable = traceback. Bug?

2015-05-06 Thread Niphlod
up until now, cache behaviours in web2py are a taddle bit different than 
the rest of the world. cache(s) in web2py usually mean "I'd like to compute 
something huge one time only" and so the general idea is that if you need 
to compute it, you should be damn sure to do so. You may also be relying on 
that assumption e.g. to get a huge stream of results from an external 
server that bills you if you go over the quota. 
The "original retry logic" is done to avoid erroring out when redis is 
restarted .  we may add some parameter around to change the behaviour but 
since it's missing from cache.ram and cache.disk for obvious reasons I 
don't know how much traction it could get.

On Wednesday, May 6, 2015 at 2:33:51 PM UTC+2, Jose C wrote:
>
> Greetings,
>
> I have always assumed that if cache is unavailable, then the fallback is 
> to serve the content from original source again (i.e. treat as if key does 
> not exist).
>
> I was surprised today when I got a ConnectionError tracebacks when the 
> redis server was not online.  Checking the source it appears this is by 
> design - it retries connecting 5 times over a total period of 30 seconds 
> (!) before giving up and issuing the traceback.
>
> Question:  Is this the default expected behaviour (grind to a halt with a 
> traceback) or just an oversight?  My thinking is that cache.redis should 
> fallback gracefully and respond as if the key never existed when it cannot 
> connect to the redis server.  Certainly it should log a warning or error as 
> well, but not bring the site down effectively.
>
> I know I can wrap all cache calls in try: except: blocks to trap for that 
> error, however that seems extreme and the more elegant solution would be to 
> handle it within cache.redis itself. 
>
> Incidentally, blocking a thread for 30 seconds while waiting for the redis 
> server also seems like overkill.  Surely if redis hasn't responded within 5 
> seconds max it's time to move on?
>
> Thoughts?  If I'm not missing something I'm happy to open an issue on 
> github.
>
> web2py ver: 2.10.4
>
> Regards,
> Jose C
>
>

-- 
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] Two SQLFORMs side by side?

2015-05-06 Thread Richard Vézina
The id field and what field you want to show as a representation of the id
field of the referenced table...

Start by putting the widget class in model file even if it not a good thing
to see if you can make it works...

In the module I have these imports :

from gluon.html import *
from gluon.sqlhtml import *
from gluon import current
from gluon.compileapp import LOAD


Which may not be related to the widget class...

Richard


On Tue, May 5, 2015 at 4:28 PM, LoveWeb2py  wrote:

> Hi Richard,
>
> I'm trying to get this setup, but am receiving an error self.url =
> URL(args=request.args)\nNameError: global name \'URL\' is not defined\n'.
> I'm wondering if this is because the gluon hasn't been imported yet.
>
> Also, could you ellaborate more on this?
>
>
> field=db.table.representing_field,
> id_field=db.table.id_field,
>
> id_field should be the foreignkey table if I am not mistaking?
> db.table.representing field, and db.table2.id_field (with foreign key) does
> that sound right?
>
>
> On Wednesday, April 29, 2015 at 10:04:35 AM UTC-4, Richard wrote:
>
>> *# In a modules :*
>>
>> class AutocompleteWidgetSelectOrAddOption(object):
>> _class = 'string'
>>
>> def __init__(self,
>>  request,
>>  field,
>>  id_field=None,
>>  db=None,
>>  orderby=None,
>>  limitby=(0, 10),
>>  keyword='_autocomplete_%(fieldname)s',
>>  min_length=2,
>>  #
>> -
>>  # From : SelectOrAddOption
>>  controller=None, function=None, form_title=None,
>>  button_text = None, dialog_width=1000,
>>  #
>> -
>>  placeholder=None
>>  ):
>> self.request = request
>> self.keyword = keyword % dict(fieldname=field.name)
>> self.db = db or field._db
>> self.orderby = orderby
>> self.limitby = limitby
>> self.min_length = min_length
>> self.fields = [field]
>> self.placeholder = placeholder
>> if id_field:
>> self.is_reference = True
>> self.fields.append(id_field)
>> else:
>> self.is_reference = False
>> if hasattr(request, 'application'):
>> self.url = URL(args=request.args)
>> self.callback()
>> else:
>> self.url = request
>> #
>> --
>> # From : SelectOrAddOption
>> if form_title is None:
>> self.form_title = current.T('Add New')
>> else:
>> self.form_title = current.T(form_title)
>> if button_text is None:
>> self.button_text = current.T('Add')
>> else:
>> self.button_text = current.T(button_text)
>> self.dialog_width = dialog_width
>>
>> self.controller = controller
>> self.function = function
>> #
>> --
>>
>> def callback(self):
>> if self.keyword in self.request.vars:
>> field = self.fields[0]
>> rows = self.db(field.like(self.request.vars[self.keyword]+'%')
>>).select(orderby=self.orderby,
>> limitby=self.limitby, *self.fields)
>> if rows:
>> if self.is_reference:
>> id_field = self.fields[1]
>> raise HTTP(200, SELECT(_id=self.keyword,
>> _class='autocomplete',
>>_size=len(rows),
>> _multiple=(len(rows) == 1),
>>*[OPTION(s[field.name],
>> _value=s[id_field.name],
>> _selected=(k == 0))
>>  for k, s in
>> enumerate(rows)]).xml())
>> else:
>> raise HTTP(200, SELECT(_id=self.keyword,
>> _class='autocomplete',
>>_size=len(rows),
>> _multiple=(len(rows) == 1),
>>*[OPTION(s[field.name],
>> _selected=(k == 0))
>>  for k, s in
>> enumerate(rows)]).xml())
>> else:
>>
>> raise HTTP(200, '')
>>
>> def __call__(self, field, value, **attributes):
>> #
>> --
>> # From : SelectOrAddOption
>> my_select_id = '%s_%s' % (field._tablename, field.name)
>> # 'test_ph_eregistry_id' #select_widget.attributes.get('_id',
>> None)
>>
>> add_args = [my_select_id]
>>

[web2py] Re: list:string on GAE breaks web2py's db admin tool

2015-05-06 Thread Massimo Di Pierro
oops. Thanks for the fix.

On Monday, 4 May 2015 10:56:36 UTC-5, michael.c.mccl...@gmail.com wrote:
>
> I've started using a list:string field on the auth_user model.
>
> I'm running web2py on GAE with the datastore.
>
>
> I noticed web2py's admin tool started crashing on this page 
> appadmin/select/db?query=db.auth_user.id>0
>
>
> looking at the console I found:
>
>
> /gluon/dal.py", line 10035, in 
>
> return ', '.join(str(y) for y in x or [])
>
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 
> 1: ordinal not in range(128)
>
> It seems web2py is not properly handling the datastore string list property. 
>
> I fixed the problem by adding .encoding("utf8") to the dal.py function below:
>
> def list_represent(x, r=None):
> #return ', '.join(str(y) for y in x or [])
> return ', '.join(str(y.encode("utf8")) for y in x or [])
>
>
> Has anybody else experienced the same error?
>
>
> tks
>
>

-- 
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: Did move my web2py projects to GitHub

2015-05-06 Thread Massimo Di Pierro
Thank you!

On Monday, 4 May 2015 10:56:36 UTC-5, Pierre Thibault wrote:
>
> Hello,
>
> I had a few projects for Web2py and I did move them to GitHub because 
> GoogleCode is going down soon.
>
> Here a few links:
>
> Pierre-Thibault/neo-web2py-utils 
>  A utility project 
> for web2py applications  Not a lot of stuff in this one...
>
> Pierre-Thibault/neo-web2py2eclipse 
>  
> neo-web2py2eclipse is an automated eclipse project creator for web2py 
> applications.
>
> Pierre-Thibault/neo-insert-imports 
>   A tool for 
> Web2py Pydev Eclipse users to add the code for the static code analyzer.
>
> I hope it can be useful.
>
>

-- 
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: Routes : matching "?_escaped_fragment_=" for AJAX websites

2015-05-06 Thread Massimo Di Pierro
the router cannot match the query string.

On Monday, 4 May 2015 10:56:35 UTC-5, Louis Amon wrote:
>
> According to Google's own spec 
> , 
> it takes special routing rules for dynamic websites to be crawled.
>
> Basically, if you put  somewhere in 
> your  then you can split your traffic:
>
> Google bots will request stuff like:
>
>- domain[:port]/path?_escaped_fragment_=hashfragment
>- domain[:port]/path?queryparams&_escaped_fragment_=hashfragment
>- domain[:port]/path?_escaped_fragment_=
>- domain[:port]/path?queryparams&_escaped_fragment_=
>
> While normal browsers will request stuff like:
>
>- domain[:port]/path#!hashfragment
>- domain[:port]/path?queryparams#!hashfragment
>- domain[:port]/path
>- domain[:port]/path?queryparams
>
> I've got the normal users covered but how can I match 
> "_escaped_fragment_=" in my routes to send those request to my static 
> snapshots ?
>
> I've tried 
>
> ('/s/$anything?_escaped_fragment_=', '/app/static/snapshots/$anything')
>
> But it doesn't work at all !
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Caching Logic in web2py

2015-05-06 Thread Massimo Di Pierro
Mind there is a difference in behavior in cache.ram and cache.disk and 
cache.memcache. Leonel is talking about cache.ram and cache.ram only works 
if you have one single server and only as long the process in the server is 
running. Your web server can arbitrarily restart at will and this will 
invalidate the cache at random time. All changes would be lost.

Cache.disk and cache.memcache instead have a more persistent storage but 
the object you see is only a copy of the one stored.

It is therefore a very bad idea to ever change a change a cached object. 
Something will always break. It is ok to replace such object.




On Monday, 4 May 2015 10:56:35 UTC-5, Chris Modzelewski wrote:
>
> Awesome! Thank you very much for this explanation!
>
> All the best,
> Chris
>
> On Tuesday, April 28, 2015 at 6:22:49 PM UTC-4, Leonel Câmara wrote:
>>
>> This one:
>>
>> A. Does the cached object get updated:
>>
>> The cached object is updated immediately because it's the same object. 
>> Cache ram does not clone it. Notice that the behaviour will be different if 
>> you're using cache disk.
>>
>> Do know that doing this is a very bad idea, as you will run into all 
>> sorts of thread safety problems. You should consider cached values 
>> immutable if you don't want to worry about safety yourself.
>>
>>
>> And finally, if I wish to force a changed value of some_object to be 
>> saved to the cache, am I correct that I should then call:
>> some_object.arg3 = 
>> some_object = cache.ram(self.id_attribute, lambda self, time=0)
>>
>>
>> This will force the change, but, again, if it's the same object the 
>> change will already be there.
>>
>> > Does this mean that the next time someone instantiates an object of 
>> class "SomeClass" with the same arg1 value but a different time_expire 
>> value, the cached object will be overwritten?
>>
>> It will be overwritten if the cached value has a timestamp that is 
>> expired with the given time_expire value. 
>>   
>>
>>
>> I think that maybe your problem is that you're not understanding what the 
>> cache is actually saving in your example. When you put an object in cache 
>> ram, what's actually in the cache is a reference to the object. So if you 
>> have a reference to that same object somewhere else and you modify it, 
>> you're actually modifying the same object that cache is referencing.
>>
>> Cache disk is different, because cache disk pickles your object and when 
>> you ask it for a value it unpickles it, so each time you will get a new 
>> object albeit with the same attributes.
>>
>

-- 
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: Problem using routes_in to convert path elements to vars

2015-05-06 Thread Rich Hogg
Hi,

I thought I would post a follow-up/update since I haven't seen any comments 
on this. The essence is:

- I believe I have identified a bug in that, while you can use a 
pattern-based incoming route in routes.py/routes_in to strip off part of 
the incoming path and present it as a variable (I verified that it works by 
debugging gluon/rewrite.py/regex_url_in()), the variable is not passed to 
the controller.

- The reason seems to be that gluon/rewrite.py/regex_filter_in() updates 
request.env with the lower-cased keys from environ (i.e. my var ends up in 
request.env['query_string']), but gluon/globals.py/Request.parse_get_vars() 
only looks for vars in request.env['QUERY_STRING']

- I dug this far with the idea that I might be able to contribute a patch, 
but it is not obvious to me how to fix it, since (to start with) I do not 
understand why we have both upper- and lower-case versions of these keys; 
so, I am asking for some discussion.

- In the meantime, I worked around it by parsing request.env['query_string'] 
in the controller (which is working fine).

Thanks,

Rich Hogg 

On Tuesday, April 28, 2015 at 3:26:23 PM UTC-4, Rich Hogg wrote:
>
> I've been trying to use a pattern-based incoming route to strip off some 
> elements of the path and pass them to the controller as vars, e.g.
>
> routes_in = (
> ('/svn/(?P.*)', '/svnweb/default/index?svn_url=\g'),
> )
>
> It looks to me like regex_filter_in is doing what I would expect with 
> this, but then in regex_url_in, the new query string is updated to 
> request.env['query_string'] instead of request.env['QUERY_STRING']:
>
> request.env.update( (k*.lower()*.replace('.', '_'), v) for k, v in 
> environ.iteritems())
> but request.env['QUERY_STRING'] is what is parsed later to get 
> request.vars.
>
> I was hoping I would find some simple thing I could patch, but now it 
> seems like it is tangled up in a design choice that has been in the repo 
> for a while (in slightly different forms) and that I don't understand, so I 
> am asking for help/advice. (Overall, BTW, I really like this platform.)
>
> -- Rich Hogg
>
>
>

-- 
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] IS_IN_DB() multiple tables

2015-05-06 Thread kecajkecaj123
Hi All, 

I have very basic dtabasae where in one table i have IPs which are used in 
second table:

db.define_table('ipaddress',
   Field('ip', unique=True, length=200,requires=IS_NOT_EMPTY()),
   Field('subnet', length=200, requires=IS_NOT_EMPTY() ),
   Field('status', length=200, default="Free", 
requires=IS_IN_SET(['Free','Used'])),
   format = '%(ip)s')

db.define_table('server',
   Field('servername', length=200),
   Field('port', length=200, requires=IS_NOT_EMPTY()),
   Field('ipaddress', unique=True, length=200, 
requires=IS_IN_DB(db(db.ipaddress.status=='Free'),db.ipaddress.ip, 
'%(ip)s')),
  

The problem i'm having is that with grid i can delete and add new values to 
"server" table and i added function which update status of IP for USED or 
FREE after insert/delete. 
Problem is with Update function as when i try to update server name i need 
to chose IP again and i can't chose same IP as it is marked in ipaddress 
table as USED hence it's not displayed in dropdown menu.
How can i display all IPs that are marked as FREE in ipaddress table AND 
IPs that where currently assign to the record i'm updateing in table 
server? 

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] web2py 2.10.4 and static / fonts

2015-05-06 Thread Александр Остыловский
Hello!
In web2py 2.10.4, a new catalog of static / fonts
It has Ouverture script.ttf
I tried this:

@font-face{ 
  font-family: "Ouverture script"; 
  src: url("{{=URL('static','fonts/Ouverture script.ttf')}}");
} 

.p1 { 
   margin: 200px;
   font-family: "Ouverture script"; 
   font-size: 40pt; 
 } 



   Текст


It does not work.
What am I doing wrong?

-- 
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: How to display SVG files?

2015-05-06 Thread Ariya Owam-aram
#
## default.py
#
def test():
import pygal
from pygal.style import LightColorizedStyle
from pygal import Config
config = Config()


stackedbar_chart = pygal.StackedBar()
stackedbar_chart.title = 'Browser usage evolution (in %)'
stackedbar_chart.x_labels = map(str, range(2002, 2013))
stackedbar_chart.add('Firefox', [None, None, 0, 16.6,   25,   31, 36.4, 
45.5, 46.3, 42.8, 37.1])
stackedbar_chart.add('Chrome',  [None, None, None, None, None, None,   
 0,  3.9, 10.8, 23.8, 35.3])
stackedbar_chart.add('IE',  [85.8, 84.6, 84.7, 74.5,   66, 58.6, 
54.7, 44.8, 36.2, 26.6, 20.1])
stackedbar_chart.add('Others',  [14.2, 15.4, 15.3,  8.9,9, 10.4, 
 8.9,  5.8,  6.7,  6.8,  7.5])
return stackedbar_chart.render() 

See result at tat.plushours.com/test


เมื่อ วันจันทร์ที่ 4 พฤษภาคม ค.ศ. 2015 22 นาฬิกา 56 นาที 34 วินาที UTC+7, 
Luis Ramos เขียนว่า:
>
> Hi,
> I would like to use pygal to display nice charts in browser. I have tried 
> these ways:
> 1- Creating a function that returns an SVG 'render'
> 2- Creating a script that saves an SVG file, then calling it from the HTML 
> file (Views).
>
> None of these work. I get the error: error on line 68 at column 8: 
> Opening and ending tag mismatch: link line 0 and head
>
> Can you guys tell me what am I doing wrong?
>

-- 
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] Show tables

2015-05-06 Thread KevC
Hi community! 
I want to crate a sub consulting and show it a user, Can I use a SQLFORM grid 
or is there other way? I wanna show two tables and the users must to have 
permissions like create, edit, delete, etc. His own records. This two tables 
that I want to show, It is a many to many relation, in this case I have three 
tables.



I hope you can help me.
My best 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] Issues with PythonAnywhere - /proc/meminfo

2015-05-06 Thread Lovecannon
Hello I'm having some issues with web2py and PythonAnywhere. It seems as 
though the RAM cache function is giving me issues saying that /proc/meminfo 
cannot be opened. Anyone know of any fixes or workarounds related to this? 
It triggers randomly and cleaning the application through the admin 
interface often temporarily fixes the issue.

-- 
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] Re: scheduler_run table remains empty

2015-05-06 Thread Christophe Meessen

Thank you very much.

My question was not clearly formulated. The task I run for my tests is 
very quick (appending a time stamp to a file) so I couldn't see the 
record in the scheduler_run table during this short period because the 
record is deleted when the task terminates.


I was looking for a solution to avoid the deletion of the record in the 
scheduler_run table. I knew it was possible because in my initial 
experimenting with scheduling this is what happened.


After further research I finally found out that to preserve the record 
in the scheduler_run table, _the task must return a result_. It is then 
possible to view the result, the output of the task, at what time it was 
executed, etc.


Le 04/05/2015 20:59, Niphlod a écrit :
is your task returning something ? if it's not returning anything, by 
default the corresponding scheduler_run record is deleted.


On Monday, May 4, 2015 at 5:56:36 PM UTC+2, Christophe Meessen wrote:

I'm using queue_task to execute a task once at a predefined time.
The task itself calls queue_task when it finished executing itself
to submit it self for a later execution at a predefined time. I'm
currently testing it so I call web2p directly with the shell to
check output.

This all works as expected and an entry is created in the
scheduler_task table. When the task completes its status becomes
COMPLETE and a new task is queued and executed at the predefined
time (approximately).

My problem is that the table scheduler_run remains empty. So I
can't see the output of the task. It was filled during initial
development tests.

Is there a way to see logs of worker processes ? I couldn't find
any. The logs directory of web2py is empty.


--
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] trap form

2015-05-06 Thread Alessio Varalta
Hi,I have a form with type button i will when i click on the button call a 
function that return a render.response view and insert this view in the 
code without reload a new page

-- 
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 do i get a web2py application from git and and install so i can run it

2015-05-06 Thread jayvandal33
 i find an application, cpftlhw-master  in zip format. i want to put  it in 
my web2py cpftlhw-master so i an run it in web2py. What steps do i do?
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.


Re: [web2py] Re: Issue with lookup foreign key / format statement in 2.10.3

2015-05-06 Thread Hilton Shumway
The pydal in my web2py download today (2.10.4) has the changes 
from https://github.com/web2py/pydal/pull/137*, *yet I still have the same 
issue. Should I open a separate bug?

On Tuesday, April 28, 2015 at 1:39:35 PM UTC-6, Jim S wrote:
>
> My problem turned out to be that I didn't have the latest pydal.  I'd 
> installed it separately from web2py and when I updated web2py, pydal didn't 
> automatically update.  I removed my separate pydal and then installed the 
> latest web2py (using git) and then everything worked for me.
>
> On Tuesday, April 28, 2015 at 2:26:23 PM UTC-5, Hilton Shumway wrote:
>>
>>
>>
>> On Monday, April 20, 2015 at 4:30:03 PM UTC-6, Jim S wrote:
>>>
>>> I'm running 2.10.4 beta.  Grabbed it from github this morning.
>>>
>>> On Mon, Apr 20, 2015 at 5:10 PM, Dave S  wrote:
>>>


 On Monday, April 20, 2015 at 10:02:44 AM UTC-7, Jim S wrote:
>
> Can someone tell me if this is fixed?
>
> I'm still having issues but maybe I'm doing something wrong:
>
>
 What version of Web2Py are you running?


>>
>> I'm finding this same bug in latest git (54b385b32192d9f). Some testing 
>> determined that commit caa19765106522a51 was the first to introduce it.
>>
>>
>> Hilton
>>
>>
>> /dps
  

 -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to a topic in the 
 Google Groups "web2py-users" group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/web2py/2i9zfAzG2s8/unsubscribe.
 To unsubscribe from this group and all its topics, 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] how to send a string asynchronously from controller to view?

2015-05-06 Thread Chandra Shekhar
Hello everyone!
I am a beginner in web2py framework ,working with irc client to monitor 
 wikpedia live changes to reflect on my webapp.I am using twisted for 
networking part and web2py for UI part.As soon as i am getting message from 
wiki-irc server of a particular channel,i want to send it to my view to 
reflect it on my webapp.
I am sending it as a dictionary but unable to do this asynchronously.Want 
to work this out since messages i am getting from wiki-irc servers are 
continuous.
If anyone can help out.

-- 
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] Re: Sublime Text web2py plugin

2015-05-06 Thread António Ramos
Dont see it on my windows 7
I have sublime 3





2015-05-06 13:09 GMT+01:00 Gergely Orosz :

> You should use command palette again
> Search for SublimeREPL: Web2py {your application name}
> It should start interactive console for your web2py application
>
> 2015. május 6., szerda 12:34:17 UTC+2 időpontban Ramos a következőt írta:
>>
>> On more question.
>> i installed sublime repl but how do i get the web2py interactive console ?
>>
>> thank u
>>
>> 2015-05-06 11:25 GMT+01:00 António Ramos :
>>
>>> From the controller i can open the view
>>>
>>> From the view i should open the controller , not the view again...
>>>
>>> thank u
>>>
>>> 2015-05-06 11:22 GMT+01:00 António Ramos :
>>>
 I have seen the light

 Keep working on it. Its very good...

 2015-05-06 10:06 GMT+01:00 Gergely Orosz :

> Once you installed the plugin restart Sublime Text
> After that you can use the command palette to check the available
> commands
> All prefixed all web2py related command with W2P
> if you press CTRL+SHIFT+P and start type W2P you will see all the
> available commands
>
> 2015. május 6., szerda 10:44:20 UTC+2 időpontban Ramos a következőt
> írta:
>>
>> Thank you
>> You say it can start and stop the server ...
>> how ?
>>
>> 2015-05-06 6:52 GMT+01:00 Gergely Orosz :
>>
>>> Hi Ramos,
>>>
>>> You should add a web2py application folder to a Sublime Text
>>> prokeject
>>> 1. Open Sublime go to the Project menu
>>> 2. Choose Add folder to project option
>>> 3. Browse your web2py application you like to work on
>>>
>>> You are ready to use the W2P plugin
>>>
>>> I am going to make the video tutorial on the weekend and also going
>>> to update the plugin read with these steps
>>>
>>> Thank you letting me know
>>>
>>> 2015. május 5., kedd 13:16:36 UTC+2 időpontban Ramos a következőt
>>> írta:

 i installed it and get the message to add web2py to the project

 what project?

 you should do a 1 minute video to show how to use it

 thank u

 2015-05-05 7:43 GMT+01:00 Gergely Orosz :

> Thank you Massimo,
>
> I am going to improve it continuously
>
> 2015. május 4., hétfő 18:24:34 UTC+2 időpontban Massimo Di Pierro
> a következőt írta:
>>
>> Nice. Thank you! I added link form the web2py examples/ app.
>>
>> On Monday, 4 May 2015 05:28:55 UTC-5, Gergely Orosz wrote:
>>>
>>> Hi 4 All,
>>>
>>> I've started to develop a web2py plugin for Sublime Text 3.
>>> I've implemented a few command I found very useful on my daily
>>> work.
>>> If you have any idea how can I make it better and useful please
>>> visit the below link and submit your feature request there
>>> Thanks in advance
>>>
>>> You can find the plugin: https://bitbucket.org/kfog/w2p
>>>
>>> If you have any question please feel free to ask here or on the
>>> Issue tracker
>>>
>>> All the best
>>> Greg
>>>
>>  --
> 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+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


>>>
>>  --
> Resour

[web2py] MongoDB

2015-05-06 Thread José Ricardo Borba
I'm very busy in these days, but I tried to start a new "installation" from
the ground (to test the TIME issue with Mongodb in pydal #170), but even
without this correction (i.e, with plain web2py clone from github) I
receive the below error message.

I'm simply copy the application folder to the new installation
(side-by-side with welcome and examples). With CLI client (mongo)
everything works fine.

The welcome app works fine.

I see that pydal tries to connect 5 times. The string to connect to mongo
is fine (since is a local install. In production will have an user and a
password too...).
Version  web2py™ Version 2.10.4-stable+timestamp.2015.04.26.09.05.21
Traceback

Traceback (most recent call last):
  File "/home/mydir/w2p210b/gluon/restricted.py", line 227, in restricted
exec ccode in environment
  File "/home/mydir/w2p210b/applications/rastreamento/models/db.py"
,
line 12, in 
db = DAL('mongodb://localhost/telemet', pool_size=0, lazy_tables=True)
  File "/home/mydir/w2p210b/gluon/packages/dal/pydal/base.py", line
174, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
  File "/mydir/w2p210b/gluon/packages/dal/pydal/base.py", line 459, in __init__
raise RuntimeError("Failure to connect, tried %d times:\n%s" %
(attempts, tb))
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
  File "/home/mydir/w2p210b/gluon/packages/dal/pydal/base.py", line
437, in __init__
self._adapter = ADAPTERS[self._dbname](**kwargs)
  File "/home/mydir/w2p210b/gluon/packages/dal/pydal/adapters/base.py",
line 57, in __call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
  File "/home/mydir/w2p210b/gluon/packages/dal/pydal/adapters/mongo.py",
line 58, in __init__
from pymongo.write_concern import WriteConcern
  File "/home/mydir/w2p210b/gluon/custom_import.py", line 108, in
custom_importer
return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
ImportError: No module named write_concern




Best regards,
-- 
José Ricardo Borba

-- 
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] cache.redis server unavailable = traceback. Bug?

2015-05-06 Thread Jose C
Greetings,

I have always assumed that if cache is unavailable, then the fallback is to 
serve the content from original source again (i.e. treat as if key does not 
exist).

I was surprised today when I got a ConnectionError tracebacks when the 
redis server was not online.  Checking the source it appears this is by 
design - it retries connecting 5 times over a total period of 30 seconds 
(!) before giving up and issuing the traceback.

Question:  Is this the default expected behaviour (grind to a halt with a 
traceback) or just an oversight?  My thinking is that cache.redis should 
fallback gracefully and respond as if the key never existed when it cannot 
connect to the redis server.  Certainly it should log a warning or error as 
well, but not bring the site down effectively.

I know I can wrap all cache calls in try: except: blocks to trap for that 
error, however that seems extreme and the more elegant solution would be to 
handle it within cache.redis itself. 

Incidentally, blocking a thread for 30 seconds while waiting for the redis 
server also seems like overkill.  Surely if redis hasn't responded within 5 
seconds max it's time to move on?

Thoughts?  If I'm not missing something I'm happy to open an issue on 
github.

web2py ver: 2.10.4

Regards,
Jose C

-- 
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] Re: Sublime Text web2py plugin

2015-05-06 Thread Gergely Orosz
You should use command palette again
Search for SublimeREPL: Web2py {your application name}
It should start interactive console for your web2py application

2015. május 6., szerda 12:34:17 UTC+2 időpontban Ramos a következőt írta:
>
> On more question.
> i installed sublime repl but how do i get the web2py interactive console ?
>
> thank u
>
> 2015-05-06 11:25 GMT+01:00 António Ramos 
> >:
>
>> From the controller i can open the view
>>
>> From the view i should open the controller , not the view again...
>>
>> thank u
>>
>> 2015-05-06 11:22 GMT+01:00 António Ramos > >:
>>
>>> I have seen the light
>>>
>>> Keep working on it. Its very good...
>>>
>>> 2015-05-06 10:06 GMT+01:00 Gergely Orosz >> >:
>>>
 Once you installed the plugin restart Sublime Text
 After that you can use the command palette to check the available 
 commands
 All prefixed all web2py related command with W2P 
 if you press CTRL+SHIFT+P and start type W2P you will see all the 
 available commands

 2015. május 6., szerda 10:44:20 UTC+2 időpontban Ramos a következőt 
 írta:
>
> Thank you
> You say it can start and stop the server ...
> how ?
>
> 2015-05-06 6:52 GMT+01:00 Gergely Orosz :
>
>> Hi Ramos,
>>
>> You should add a web2py application folder to a Sublime Text prokeject
>> 1. Open Sublime go to the Project menu
>> 2. Choose Add folder to project option
>> 3. Browse your web2py application you like to work on
>>
>> You are ready to use the W2P plugin
>>
>> I am going to make the video tutorial on the weekend and also going 
>> to update the plugin read with these steps
>>
>> Thank you letting me know
>>
>> 2015. május 5., kedd 13:16:36 UTC+2 időpontban Ramos a következőt 
>> írta:
>>>
>>> i installed it and get the message to add web2py to the project
>>>
>>> what project?
>>>
>>> you should do a 1 minute video to show how to use it
>>>
>>> thank u
>>>
>>> 2015-05-05 7:43 GMT+01:00 Gergely Orosz :
>>>
 Thank you Massimo,

 I am going to improve it continuously

 2015. május 4., hétfő 18:24:34 UTC+2 időpontban Massimo Di Pierro a 
 következőt írta:
>
> Nice. Thank you! I added link form the web2py examples/ app.
>
> On Monday, 4 May 2015 05:28:55 UTC-5, Gergely Orosz wrote:
>>
>> Hi 4 All,
>>
>> I've started to develop a web2py plugin for Sublime Text 3.
>> I've implemented a few command I found very useful on my daily 
>> work.
>> If you have any idea how can I make it better and useful please 
>> visit the below link and submit your feature request there
>> Thanks in advance
>>
>> You can find the plugin: https://bitbucket.org/kfog/w2p
>>
>> If you have any question please feel free to ask here or on the 
>> Issue tracker
>>
>> All the best
>> Greg
>>
>  -- 
 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+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 

[web2py] Re: Brainstorming

2015-05-06 Thread Ramos
There is a new kid on the block

Reactjs

Any experiment with it and web2py ?
Seems a lot less complex than angularjs

Regards


Em quinta-feira, 3 de julho de 2014 09:46:06 UTC+1, Mirek Zvolský escreveu:
>
> Here is a project which lists and compares a little javascript frameworks:
> todomvc.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.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Singletons Save Memory and Time

2015-05-06 Thread Michele Comitini
if instantiating the object takes time Joe's approach is absolutely correct
IMHO.  One must avoid  caching  per-thread or per-process data in the
singleton unless explicitly managed with proper locking/message passing.
So to speed up more one can use cache.ram or cache.disk or memcache or
redis ... to also cache output, reducing also the impact on db and
rendering as Leonel suggest, while delegating the complexity of managing
context data to web2py caching.

2015-05-06 5:47 GMT+02:00 Joe Barnhart :

> I don't want to cache the entire output of the function.  If I do that,
> the cache will include the data in the table.  I just want to save the
> object that generates the table and apply new data to it for each user /
> swimmer / whatever.
>
> Had I used cache.ram on this table, it would have made Natalie Coughlin's
> times a permanent feature of the cached output.  With the Singleton
> approach, I can click on Michael Phelps name and re-use the same object
> that generates the table, but with different table contents.
>
> With cache.ram, I would eventually cache separate versions of the table
> for every swimmer I ever looked at.  Or at least within the given cache
> timeframe.
>
>
> On Tuesday, May 5, 2015 at 5:42:41 PM UTC-7, Leonel Câmara wrote:
>>
>> Why not just use cache ram?
>>
>  --
> 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] Keeping track of connected users (websocket_messaging.py)

2015-05-06 Thread Samuel Sowah
Hello,
Please if I'd like to keep track of users who are connected to a particular 
group, for example

   $(document).ready(function(){
  var data;
  
$.web2py.web2py_websocket('ws://official-notebook.com:/realtime/mygroup',function(e){data=eval('('+e.data+')')});
   });


so that I can list the connected users, and then remove them from the list 
when they disconnect, how would I achieve that?

-- 
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] Re: Sublime Text web2py plugin

2015-05-06 Thread António Ramos
On more question.
i installed sublime repl but how do i get the web2py interactive console ?

thank u

2015-05-06 11:25 GMT+01:00 António Ramos :

> From the controller i can open the view
>
> From the view i should open the controller , not the view again...
>
> thank u
>
> 2015-05-06 11:22 GMT+01:00 António Ramos :
>
>> I have seen the light
>>
>> Keep working on it. Its very good...
>>
>> 2015-05-06 10:06 GMT+01:00 Gergely Orosz :
>>
>>> Once you installed the plugin restart Sublime Text
>>> After that you can use the command palette to check the available
>>> commands
>>> All prefixed all web2py related command with W2P
>>> if you press CTRL+SHIFT+P and start type W2P you will see all the
>>> available commands
>>>
>>> 2015. május 6., szerda 10:44:20 UTC+2 időpontban Ramos a következőt írta:

 Thank you
 You say it can start and stop the server ...
 how ?

 2015-05-06 6:52 GMT+01:00 Gergely Orosz :

> Hi Ramos,
>
> You should add a web2py application folder to a Sublime Text prokeject
> 1. Open Sublime go to the Project menu
> 2. Choose Add folder to project option
> 3. Browse your web2py application you like to work on
>
> You are ready to use the W2P plugin
>
> I am going to make the video tutorial on the weekend and also going to
> update the plugin read with these steps
>
> Thank you letting me know
>
> 2015. május 5., kedd 13:16:36 UTC+2 időpontban Ramos a következőt írta:
>>
>> i installed it and get the message to add web2py to the project
>>
>> what project?
>>
>> you should do a 1 minute video to show how to use it
>>
>> thank u
>>
>> 2015-05-05 7:43 GMT+01:00 Gergely Orosz :
>>
>>> Thank you Massimo,
>>>
>>> I am going to improve it continuously
>>>
>>> 2015. május 4., hétfő 18:24:34 UTC+2 időpontban Massimo Di Pierro a
>>> következőt írta:

 Nice. Thank you! I added link form the web2py examples/ app.

 On Monday, 4 May 2015 05:28:55 UTC-5, Gergely Orosz wrote:
>
> Hi 4 All,
>
> I've started to develop a web2py plugin for Sublime Text 3.
> I've implemented a few command I found very useful on my daily
> work.
> If you have any idea how can I make it better and useful please
> visit the below link and submit your feature request there
> Thanks in advance
>
> You can find the plugin: https://bitbucket.org/kfog/w2p
>
> If you have any question please feel free to ask here or on the
> Issue tracker
>
> All the best
> Greg
>
  --
>>> 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.
>>>
>>
>>
>

-- 
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] Re: Sublime Text web2py plugin

2015-05-06 Thread António Ramos
>From the controller i can open the view

>From the view i should open the controller , not the view again...

thank u

2015-05-06 11:22 GMT+01:00 António Ramos :

> I have seen the light
>
> Keep working on it. Its very good...
>
> 2015-05-06 10:06 GMT+01:00 Gergely Orosz :
>
>> Once you installed the plugin restart Sublime Text
>> After that you can use the command palette to check the available commands
>> All prefixed all web2py related command with W2P
>> if you press CTRL+SHIFT+P and start type W2P you will see all the
>> available commands
>>
>> 2015. május 6., szerda 10:44:20 UTC+2 időpontban Ramos a következőt írta:
>>>
>>> Thank you
>>> You say it can start and stop the server ...
>>> how ?
>>>
>>> 2015-05-06 6:52 GMT+01:00 Gergely Orosz :
>>>
 Hi Ramos,

 You should add a web2py application folder to a Sublime Text prokeject
 1. Open Sublime go to the Project menu
 2. Choose Add folder to project option
 3. Browse your web2py application you like to work on

 You are ready to use the W2P plugin

 I am going to make the video tutorial on the weekend and also going to
 update the plugin read with these steps

 Thank you letting me know

 2015. május 5., kedd 13:16:36 UTC+2 időpontban Ramos a következőt írta:
>
> i installed it and get the message to add web2py to the project
>
> what project?
>
> you should do a 1 minute video to show how to use it
>
> thank u
>
> 2015-05-05 7:43 GMT+01:00 Gergely Orosz :
>
>> Thank you Massimo,
>>
>> I am going to improve it continuously
>>
>> 2015. május 4., hétfő 18:24:34 UTC+2 időpontban Massimo Di Pierro a
>> következőt írta:
>>>
>>> Nice. Thank you! I added link form the web2py examples/ app.
>>>
>>> On Monday, 4 May 2015 05:28:55 UTC-5, Gergely Orosz wrote:

 Hi 4 All,

 I've started to develop a web2py plugin for Sublime Text 3.
 I've implemented a few command I found very useful on my daily work.
 If you have any idea how can I make it better and useful please
 visit the below link and submit your feature request there
 Thanks in advance

 You can find the plugin: https://bitbucket.org/kfog/w2p

 If you have any question please feel free to ask here or on the
 Issue tracker

 All the best
 Greg

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

-- 
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] Re: Sublime Text web2py plugin

2015-05-06 Thread António Ramos
I have seen the light

Keep working on it. Its very good...

2015-05-06 10:06 GMT+01:00 Gergely Orosz :

> Once you installed the plugin restart Sublime Text
> After that you can use the command palette to check the available commands
> All prefixed all web2py related command with W2P
> if you press CTRL+SHIFT+P and start type W2P you will see all the
> available commands
>
> 2015. május 6., szerda 10:44:20 UTC+2 időpontban Ramos a következőt írta:
>>
>> Thank you
>> You say it can start and stop the server ...
>> how ?
>>
>> 2015-05-06 6:52 GMT+01:00 Gergely Orosz :
>>
>>> Hi Ramos,
>>>
>>> You should add a web2py application folder to a Sublime Text prokeject
>>> 1. Open Sublime go to the Project menu
>>> 2. Choose Add folder to project option
>>> 3. Browse your web2py application you like to work on
>>>
>>> You are ready to use the W2P plugin
>>>
>>> I am going to make the video tutorial on the weekend and also going to
>>> update the plugin read with these steps
>>>
>>> Thank you letting me know
>>>
>>> 2015. május 5., kedd 13:16:36 UTC+2 időpontban Ramos a következőt írta:

 i installed it and get the message to add web2py to the project

 what project?

 you should do a 1 minute video to show how to use it

 thank u

 2015-05-05 7:43 GMT+01:00 Gergely Orosz :

> Thank you Massimo,
>
> I am going to improve it continuously
>
> 2015. május 4., hétfő 18:24:34 UTC+2 időpontban Massimo Di Pierro a
> következőt írta:
>>
>> Nice. Thank you! I added link form the web2py examples/ app.
>>
>> On Monday, 4 May 2015 05:28:55 UTC-5, Gergely Orosz wrote:
>>>
>>> Hi 4 All,
>>>
>>> I've started to develop a web2py plugin for Sublime Text 3.
>>> I've implemented a few command I found very useful on my daily work.
>>> If you have any idea how can I make it better and useful please
>>> visit the below link and submit your feature request there
>>> Thanks in advance
>>>
>>> You can find the plugin: https://bitbucket.org/kfog/w2p
>>>
>>> If you have any question please feel free to ask here or on the
>>> Issue tracker
>>>
>>> All the best
>>> Greg
>>>
>>  --
> 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.
>

-- 
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] Re: How to add a trailing slash in URL?

2015-05-06 Thread Francisco Costa
Tx Willoughby,
I've accompished that with 
​​
rewrite ^([^.]*[^/])$ $1/ permanent;


but I don't think is a good solution for a SEO standpoint because the code 
will then have URLs without the trailling slash and every click will be 
redirected to the URL with the slash

On Tuesday, 5 May 2015 21:36:14 UTC+1, Willoughby wrote:
>
> Well then how about a nasty reg-ex in the web server?
> Something like this for nginx:
> rewrite ^([^\?#]*/)([^\?#\./]+)([\?#].*)?$ $1$2/$3 permanent;
>
> http://www.nginxtips.com/add-trailing-slash-nginx/
>
>
> On Tuesday, May 5, 2015 at 4:16:57 PM UTC-4, Francisco Costa wrote:
>>
>> nothing to explain, I just want my URL's to finish with a trail 
>> (obviously excluding the ones with vars)
>>
>> Francisco Tomé Costa
>> +351 918412636
>> https://www.linkedin.com/in/franciscocosta​
>>
>> On Tue, May 5, 2015 at 8:46 PM, Willoughby  wrote:
>>
>>> Maybe if you explained what problem you're trying to fix.
>>>
>>>
>>> On Tuesday, May 5, 2015 at 3:32:20 PM UTC-4, Francisco Costa wrote:

 I'm not saying changing all the URL's, but if there was an argument on 
 the URL()

 Something like this: URL(trailing=True)

 Francisco Tomé Costa
 +351 918412636
 https://www.linkedin.com/in/franciscocosta​

 On Tue, May 5, 2015 at 8:06 PM, Leonel Câmara  
 wrote:

> What about stylesheets and other files?
>
> Do you want their URL to be  
> http://www.example.com/application/static/css/styles.css/
>
> No and it won't work. Because a / denotes a directory.
>
> I guess you could do this using pattern based URL rewriting, I don't 
> like 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 a topic in the 
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/web2py/EGJJ6xC4-2w/unsubscribe.
> To unsubscribe from this group and all its topics, 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 a topic in the 
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/web2py/EGJJ6xC4-2w/unsubscribe.
>>> To unsubscribe from this group and all its topics, 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] Re: Sublime Text web2py plugin

2015-05-06 Thread Gergely Orosz
Once you installed the plugin restart Sublime Text
After that you can use the command palette to check the available commands
All prefixed all web2py related command with W2P 
if you press CTRL+SHIFT+P and start type W2P you will see all the available 
commands

2015. május 6., szerda 10:44:20 UTC+2 időpontban Ramos a következőt írta:
>
> Thank you
> You say it can start and stop the server ...
> how ?
>
> 2015-05-06 6:52 GMT+01:00 Gergely Orosz  >:
>
>> Hi Ramos,
>>
>> You should add a web2py application folder to a Sublime Text prokeject
>> 1. Open Sublime go to the Project menu
>> 2. Choose Add folder to project option
>> 3. Browse your web2py application you like to work on
>>
>> You are ready to use the W2P plugin
>>
>> I am going to make the video tutorial on the weekend and also going to 
>> update the plugin read with these steps
>>
>> Thank you letting me know
>>
>> 2015. május 5., kedd 13:16:36 UTC+2 időpontban Ramos a következőt írta:
>>>
>>> i installed it and get the message to add web2py to the project
>>>
>>> what project?
>>>
>>> you should do a 1 minute video to show how to use it
>>>
>>> thank u
>>>
>>> 2015-05-05 7:43 GMT+01:00 Gergely Orosz :
>>>
 Thank you Massimo,

 I am going to improve it continuously

 2015. május 4., hétfő 18:24:34 UTC+2 időpontban Massimo Di Pierro a 
 következőt írta:
>
> Nice. Thank you! I added link form the web2py examples/ app.
>
> On Monday, 4 May 2015 05:28:55 UTC-5, Gergely Orosz wrote:
>>
>> Hi 4 All,
>>
>> I've started to develop a web2py plugin for Sublime Text 3.
>> I've implemented a few command I found very useful on my daily work.
>> If you have any idea how can I make it better and useful please visit 
>> the below link and submit your feature request there
>> Thanks in advance
>>
>> You can find the plugin: https://bitbucket.org/kfog/w2p
>>
>> If you have any question please feel free to ask here or on the Issue 
>> tracker
>>
>> All the best
>> Greg
>>
>  -- 
 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] Re: Linking directly to an uploaded image

2015-05-06 Thread Annet
In one of my application I store uploaded images in separte folders


in table definitionl:

Field('imageFilename', length=128, writable=False, readable=False),
Field('image', type='upload', requires=[IS_IMAGE(extensions=('gif', 'jpg', 
'jpeg', 'png'), maxsize=(240, 100), error_message='maxWidth is 240 pixels 
maxHeight is 100 pixels. File format: gif, jpg, jpeg, png'), 
IS_LENGTH(48*1024, error_message='File size exceeds 24 KB')], 
autodelete=True),


in function:

folder = 'user' + str(auth_user.id)
db[table].image.uploadfolder = 
os.path.join(request.env.applications_parent, 'applications',
  'dbmodel', 'static', 
'uploads', folder)

form = SQLFORM(table, record, deletable=True, showid=False,
   upload=URL('dbmodel', 'static/uploads', folder, 
args=request.vars.image))
if hasattr(request.vars.image, 'filename'):
form.vars.imageFilename = request.vars.image.filename



In case the image field can be empty I use requires = 
IS_EMPTY_OR(IS_IMAGE(), IS_LENGTH())
and in the function:

if form.process().accepted:
if record and form.vars.image__delete:
file = record.image

os.remove(os.path.join(request.env.applications_parent,'applications',
   'dbmodel', 'static', 'uploads', folder, 
file))
record.update_record(image=None, imageFileName=None)

to delete the image from the folder.


Annet

-- 
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] Re: Sublime Text web2py plugin

2015-05-06 Thread António Ramos
Thank you
You say it can start and stop the server ...
how ?

2015-05-06 6:52 GMT+01:00 Gergely Orosz :

> Hi Ramos,
>
> You should add a web2py application folder to a Sublime Text prokeject
> 1. Open Sublime go to the Project menu
> 2. Choose Add folder to project option
> 3. Browse your web2py application you like to work on
>
> You are ready to use the W2P plugin
>
> I am going to make the video tutorial on the weekend and also going to
> update the plugin read with these steps
>
> Thank you letting me know
>
> 2015. május 5., kedd 13:16:36 UTC+2 időpontban Ramos a következőt írta:
>>
>> i installed it and get the message to add web2py to the project
>>
>> what project?
>>
>> you should do a 1 minute video to show how to use it
>>
>> thank u
>>
>> 2015-05-05 7:43 GMT+01:00 Gergely Orosz :
>>
>>> Thank you Massimo,
>>>
>>> I am going to improve it continuously
>>>
>>> 2015. május 4., hétfő 18:24:34 UTC+2 időpontban Massimo Di Pierro a
>>> következőt írta:

 Nice. Thank you! I added link form the web2py examples/ app.

 On Monday, 4 May 2015 05:28:55 UTC-5, Gergely Orosz wrote:
>
> Hi 4 All,
>
> I've started to develop a web2py plugin for Sublime Text 3.
> I've implemented a few command I found very useful on my daily work.
> If you have any idea how can I make it better and useful please visit
> the below link and submit your feature request there
> Thanks in advance
>
> You can find the plugin: https://bitbucket.org/kfog/w2p
>
> If you have any question please feel free to ask here or on the Issue
> tracker
>
> All the best
> Greg
>
  --
>>> 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.