[web2py] Re: cache.redis server unavailable = traceback. Bug?

2015-05-07 Thread Jose C
Ok, issue opened:
https://github.com/web2py/web2py/issues/958

Thanks Niphlod.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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-07 Thread Paolo Valleri
I don't see any problem at all in implementing a common post-comment page 
in web2py.
You can code it independently from the backend. 

On Wednesday, May 6, 2015 at 8:28:08 PM UTC+2, Ron Chatterjee wrote:

 Here is another tutorial from django:


 *http://docs.mongodb.org/manual/tutorial/write-a-tumblelog-application-with-django-mongodb-engine/
  
 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 javascript:',
   '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 javascript:'
   },
   '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] downloading old web2py version from github

2015-05-07 Thread Niphlod
*unable to open database file* doesn't mean that web2py isn't running. 
Probably the earlier version doesn't contain appconfig, which your app 
seems to rely on for configuration...

On Thursday, May 7, 2015 at 1:12:25 AM UTC+2, 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 module
 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: from desktop to web2py

2015-05-07 Thread 黄祥
if you use sqlform.factory, i think you should do the insert data from 
sqlform.factory to the table manually.
e.g. taken from 
http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-factory
 
 modified it
def form_from_factory():
form = SQLFORM.factory(
Field('your_name', requires=IS_NOT_EMPTY()),
Field('your_image', 'upload'))
if form.process().accepted:
response.flash = 'form accepted'
db.customer.insert(**db.customer._filter_fields(form.vars) )
elif form.errors:
response.flash = 'form has errors'
return dict(form=form)

another thing, i think you can use another like sqlform, or sqlform.grid

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] Pydal issues

2015-05-07 Thread José Ricardo Borba
Sorry about that title, but I'm seeing in the messages that is a number of
messages with pydal connection errors, even with some (little) older
versions.

My issue with MONGODB is (at some point) replicated with MSSQL, @Alan
(don't know about what database).

So, after (another) installation of web2py (cloning from github), some
strange things happen this time. Follow the output from command line:

code
Cloning into 'w2p'...
remote: Counting objects: 31116, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 31116 (delta 0), reused 0 (delta 0), pack-reused 3
Receiving objects: 100% (31116/31116), 32.08 MiB | 98.00 KiB/s, done.
Resolving deltas: 100% (18762/18762), done.
Checking connectivity... done.
Submodule 'gluon/packages/dal' (https://github.com/web2py/pydal.git)
registered for path 'gluon/packages/dal'
Cloning into 'gluon/packages/dal'...
remote: Counting objects: 30227, done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 30227 (delta 29), reused 0 (delta 0), pack-reused 30186
Receiving objects: 100% (30227/30227), 30.27 MiB | 474.00 KiB/s, done.
Resolving deltas: 100% (18157/18157), done.
Checking connectivity... done.
fatal: reference is not a tree: 04ffbb371c59bfe253cae7865670c132b9b7eb44
Unable to checkout '04ffbb371c59bfe253cae7865670c132b9b7eb44' in submodule
path 'gluon/packages/dal'
/code

So, when I try to run web2py from the command line, this is the following
message:

code
[me@mycomputer]$ python2 web2py.py -a 123 -i 0.0.0.0
Traceback (most recent call last):
  File web2py.py, line 18, in module
import gluon.widget
  File /home/ricardo/Documents/proj/w2p210c/gluon/__init__.py, line 29,
in module
You can also download a complete copy from http://www.web2py.com.;
RuntimeError: web2py depends on pydal, which apparently you have not
installed.
Probably you cloned the repository using git without '--recursive'
To fix this, please run (from inside your web2py folder):

 git submodule update --init --recursive

You can also download a complete copy from http://www.web2py.com.
/code

So, until now, I can't test the Paolo Valleri solution for issue #170 of
pydal.

Any Ideas?

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.


Re: [web2py] Re: MongoDB

2015-05-07 Thread José Ricardo Borba
Yes, I did!
Thanks for the advice.

But submodule when cloning web2py still doesn't work.

Best regards,

2015-05-07 16:25 GMT-03:00 Paolo Valleri paolo.vall...@gmail.com:

 update your local copy of pydal, there are several updates regarding mongo
 in master branch


  Paolo

 2015-05-07 21:14 GMT+02:00 José Ricardo Borba jrborba...@gmail.com:

 Allright!

 Updating pymongo to version 3.0 solves this up!

 Now I take care of the mongo time / pydal issue!

 Thanks a lot.


 2015-05-07 9:05 GMT-03:00 Paolo Valleri paolo.vall...@gmail.com:

 You should use pymongo 3.0


 On Wednesday, May 6, 2015 at 2:38:56 PM UTC+2, José Borba wrote:

 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 
 http://localhost:8000/admin/default/edit/rastreamento/models/db.py, line 
 12, in module
 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.




 --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/3q5CfUSPQ1o/unsubscribe.
 To unsubscribe from this group and all its topics, 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.




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


Re: [web2py] Pydal issues

2015-05-07 Thread Richard Vézina
I had the same issue last night trying to clone web2py... pydal never shows
up!!

Richard

On Thu, May 7, 2015 at 3:06 PM, Richard Vézina ml.richard.vez...@gmail.com
wrote:

 copy mannually the pydal in web2py gluon/packages folder...

 which is what git clone --recursive web2py repo should do...

 Richard

 On Thu, May 7, 2015 at 3:02 PM, José Ricardo Borba jrborba...@gmail.com
 wrote:

 Sorry about that title, but I'm seeing in the messages that is a number
 of messages with pydal connection errors, even with some (little) older
 versions.

 My issue with MONGODB is (at some point) replicated with MSSQL, @Alan
 (don't know about what database).

 So, after (another) installation of web2py (cloning from github), some
 strange things happen this time. Follow the output from command line:

 code
 Cloning into 'w2p'...
 remote: Counting objects: 31116, done.
 remote: Compressing objects: 100% (4/4), done.
 remote: Total 31116 (delta 0), reused 0 (delta 0), pack-reused 3
 Receiving objects: 100% (31116/31116), 32.08 MiB | 98.00 KiB/s, done.
 Resolving deltas: 100% (18762/18762), done.
 Checking connectivity... done.
 Submodule 'gluon/packages/dal' (https://github.com/web2py/pydal.git)
 registered for path 'gluon/packages/dal'
 Cloning into 'gluon/packages/dal'...
 remote: Counting objects: 30227, done.
 remote: Compressing objects: 100% (41/41), done.
 remote: Total 30227 (delta 29), reused 0 (delta 0), pack-reused 30186
 Receiving objects: 100% (30227/30227), 30.27 MiB | 474.00 KiB/s, done.
 Resolving deltas: 100% (18157/18157), done.
 Checking connectivity... done.
 fatal: reference is not a tree: 04ffbb371c59bfe253cae7865670c132b9b7eb44
 Unable to checkout '04ffbb371c59bfe253cae7865670c132b9b7eb44' in
 submodule path 'gluon/packages/dal'
 /code

 So, when I try to run web2py from the command line, this is the following
 message:

 code
 [me@mycomputer]$ python2 web2py.py -a 123 -i 0.0.0.0
 Traceback (most recent call last):
   File web2py.py, line 18, in module
 import gluon.widget
   File /home/ricardo/Documents/proj/w2p210c/gluon/__init__.py, line 29,
 in module
 You can also download a complete copy from http://www.web2py.com.;
 RuntimeError: web2py depends on pydal, which apparently you have not
 installed.
 Probably you cloned the repository using git without '--recursive'
 To fix this, please run (from inside your web2py folder):

  git submodule update --init --recursive

 You can also download a complete copy from http://www.web2py.com.
 /code

 So, until now, I can't test the Paolo Valleri solution for issue #170 of
 pydal.

 Any Ideas?

 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.




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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: MongoDB

2015-05-07 Thread José Ricardo Borba
Allright!

Updating pymongo to version 3.0 solves this up!

Now I take care of the mongo time / pydal issue!

Thanks a lot.


2015-05-07 9:05 GMT-03:00 Paolo Valleri paolo.vall...@gmail.com:

 You should use pymongo 3.0


 On Wednesday, May 6, 2015 at 2:38:56 PM UTC+2, José Borba wrote:

 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 
 http://localhost:8000/admin/default/edit/rastreamento/models/db.py, line 
 12, in module
 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.




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


Re: [web2py] Re: MongoDB adapter

2015-05-07 Thread José Ricardo Borba
YAY 

Everything is working FINE!
Thank you very much, Paolo, Massimo and others.

Cheers.

2015-05-04 10:39 GMT-03:00 Ron Chatterjee achatterjee...@gmail.com:

 What is mongodb adapter? Where do I find that info?


 On Monday, May 4, 2015 at 8:39:48 AM UTC-4, Paolo Valleri wrote:

 It should be fixed in trunk

 Paolo

 On Saturday, May 2, 2015 at 1:24:32 PM UTC+2, José Borba wrote:

 OK.
 Thank you very much again.

 Cheers.

 2015-05-02 8:22 GMT-03:00 Paolo Valleri paolo@gmail.com:

 Open an issue to don't forget it,I'll fix it in the next few days

 Paolo
 On May 2, 2015 1:18 PM, José Ricardo Borba jrbor...@gmail.com
 wrote:

 Paolo,

 Thank you for you quickly response. But I'm working with the latest
 web2py/Pydal 2.10.4 (downloaded 2.10.3 and updated). I forgot to mention
 this. I'm sorry.

 My second bet is that the parser of time (the time_itens above) need
 to be modified to work with time in mongo,

 Still not knowing what is the correct bug (if there are one) to
 report.

 Cheers,


 2015-05-02 4:23 GMT-03:00 Paolo Valleri paolo@gmail.com:

 Hi, try use the latest version of pydal, Mongo adapter has been
 recently updated to work with pymongo 3.0
 However, I think this is a bug. Can you open a bug report on
 https://github.com/web2py/pydal

 Paolo


 On Saturday, May 2, 2015 at 3:58:13 AM UTC+2, José Borba wrote:

 Hi 4 All,

 I'm new to mongoDB and still having some problems with a TIME field.
 When I set a TIME field in the table, fill the input field of a sqlform
 (only time is allowed) and send the data to table, all the record is
 inserted without any warning. But when I try to show in the sqlform, I
 receive a message:

 pre
 code
   Traceback (most recent call last):
   File /home/xxx.../applications/ras/controllers/appadmin.py, line
 269, in select
 *fields, limitby=(start, stop))
   File /home/xxx.../gluon/packages/dal/pydal/objects.py, line
 2026, in select
 return adapter.select(self.query,fields,attributes)
   File /home/xxx.../gluon/packages/dal/pydal/adapters/mongo.py,
 line 353, in select
 result = processor(rows, fields, newnames, False)
   File /home/xxx.../gluon/packages/dal/pydal/adapters/base.py,
 line 1596, in parse
 value = self.parse_value(value,ft,blob_decode)
   File /home/xxx.../gluon/packages/dal/pydal/adapters/base.py,
 line 1450, in parse_value
 return self.parsemap[key](value,field_type)
   File /home/xxx.../gluon/packages/dal/pydal/adapters/base.py,
 line 1472, in parse_time
 time_items = map(int,str(value)[:8].strip().split(':')[:3])
 ValueError: invalid literal for int() with base 10: '2000-01-'
 /code
 /pre

 Trying to understand what happened, I'm googled for some info, and
 found the Mongo adapter code (yes, I didn't tried in my own computer).

 Reading the code (in pydal/adapters/mongo.py), I see a (possible)
 clue: The lines 148 to 163 is, in some way, weird for my reading. Maybe 
 I
 misunderstood some point, but this

 pre
 code
 t = datetime.time(0,0,0)
 /code
 /pre

 is a formatter for a field type DATE, and this

 pre
 code
 t = datetime.date(2000,1,1)
 /code
 /pre

 is a formatter for a field type TIME ?

 Best regards, and keep going the invaluable work with this framework.

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




 --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/c8JpvzBHGhE/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+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




 --
 José Ricardo Borba

   --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - 

Re: [web2py] Pydal issues

2015-05-07 Thread Richard Vézina
copy mannually the pydal in web2py gluon/packages folder...

which is what git clone --recursive web2py repo should do...

Richard

On Thu, May 7, 2015 at 3:02 PM, José Ricardo Borba jrborba...@gmail.com
wrote:

 Sorry about that title, but I'm seeing in the messages that is a number of
 messages with pydal connection errors, even with some (little) older
 versions.

 My issue with MONGODB is (at some point) replicated with MSSQL, @Alan
 (don't know about what database).

 So, after (another) installation of web2py (cloning from github), some
 strange things happen this time. Follow the output from command line:

 code
 Cloning into 'w2p'...
 remote: Counting objects: 31116, done.
 remote: Compressing objects: 100% (4/4), done.
 remote: Total 31116 (delta 0), reused 0 (delta 0), pack-reused 3
 Receiving objects: 100% (31116/31116), 32.08 MiB | 98.00 KiB/s, done.
 Resolving deltas: 100% (18762/18762), done.
 Checking connectivity... done.
 Submodule 'gluon/packages/dal' (https://github.com/web2py/pydal.git)
 registered for path 'gluon/packages/dal'
 Cloning into 'gluon/packages/dal'...
 remote: Counting objects: 30227, done.
 remote: Compressing objects: 100% (41/41), done.
 remote: Total 30227 (delta 29), reused 0 (delta 0), pack-reused 30186
 Receiving objects: 100% (30227/30227), 30.27 MiB | 474.00 KiB/s, done.
 Resolving deltas: 100% (18157/18157), done.
 Checking connectivity... done.
 fatal: reference is not a tree: 04ffbb371c59bfe253cae7865670c132b9b7eb44
 Unable to checkout '04ffbb371c59bfe253cae7865670c132b9b7eb44' in submodule
 path 'gluon/packages/dal'
 /code

 So, when I try to run web2py from the command line, this is the following
 message:

 code
 [me@mycomputer]$ python2 web2py.py -a 123 -i 0.0.0.0
 Traceback (most recent call last):
   File web2py.py, line 18, in module
 import gluon.widget
   File /home/ricardo/Documents/proj/w2p210c/gluon/__init__.py, line 29,
 in module
 You can also download a complete copy from http://www.web2py.com.;
 RuntimeError: web2py depends on pydal, which apparently you have not
 installed.
 Probably you cloned the repository using git without '--recursive'
 To fix this, please run (from inside your web2py folder):

  git submodule update --init --recursive

 You can also download a complete copy from http://www.web2py.com.
 /code

 So, until now, I can't test the Paolo Valleri solution for issue #170 of
 pydal.

 Any Ideas?

 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.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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: MongoDB

2015-05-07 Thread Paolo Valleri
update your local copy of pydal, there are several updates regarding mongo
in master branch


 Paolo

2015-05-07 21:14 GMT+02:00 José Ricardo Borba jrborba...@gmail.com:

 Allright!

 Updating pymongo to version 3.0 solves this up!

 Now I take care of the mongo time / pydal issue!

 Thanks a lot.


 2015-05-07 9:05 GMT-03:00 Paolo Valleri paolo.vall...@gmail.com:

 You should use pymongo 3.0


 On Wednesday, May 6, 2015 at 2:38:56 PM UTC+2, José Borba wrote:

 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 
 http://localhost:8000/admin/default/edit/rastreamento/models/db.py, line 
 12, in module
 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.




 --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/3q5CfUSPQ1o/unsubscribe.
 To unsubscribe from this group and all its topics, 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] Pydal issues

2015-05-07 Thread Niphlod
unfortunately, bad commit happens. we know already. 
https://github.com/web2py/web2py/commit/6f91fdd8332beb5e6a17a1444655e9b9f22e2f4c#commitcomment-11073544

On Thursday, May 7, 2015 at 9:06:51 PM UTC+2, Richard wrote:

 I had the same issue last night trying to clone web2py... pydal never 
 shows up!!

 Richard

 On Thu, May 7, 2015 at 3:06 PM, Richard Vézina ml.richa...@gmail.com 
 javascript: wrote:

 copy mannually the pydal in web2py gluon/packages folder...

 which is what git clone --recursive web2py repo should do...

 Richard

 On Thu, May 7, 2015 at 3:02 PM, José Ricardo Borba jrbor...@gmail.com 
 javascript: wrote:

 Sorry about that title, but I'm seeing in the messages that is a number 
 of messages with pydal connection errors, even with some (little) older 
 versions.

 My issue with MONGODB is (at some point) replicated with MSSQL, @Alan 
 (don't know about what database).

 So, after (another) installation of web2py (cloning from github), some 
 strange things happen this time. Follow the output from command line:

 code
 Cloning into 'w2p'...
 remote: Counting objects: 31116, done.
 remote: Compressing objects: 100% (4/4), done.
 remote: Total 31116 (delta 0), reused 0 (delta 0), pack-reused 3
 Receiving objects: 100% (31116/31116), 32.08 MiB | 98.00 KiB/s, done.
 Resolving deltas: 100% (18762/18762), done.
 Checking connectivity... done.
 Submodule 'gluon/packages/dal' (https://github.com/web2py/pydal.git) 
 registered for path 'gluon/packages/dal'
 Cloning into 'gluon/packages/dal'...
 remote: Counting objects: 30227, done.
 remote: Compressing objects: 100% (41/41), done.
 remote: Total 30227 (delta 29), reused 0 (delta 0), pack-reused 30186
 Receiving objects: 100% (30227/30227), 30.27 MiB | 474.00 KiB/s, done.
 Resolving deltas: 100% (18157/18157), done.
 Checking connectivity... done.
 fatal: reference is not a tree: 04ffbb371c59bfe253cae7865670c132b9b7eb44
 Unable to checkout '04ffbb371c59bfe253cae7865670c132b9b7eb44' in 
 submodule path 'gluon/packages/dal'
 /code

 So, when I try to run web2py from the command line, this is the 
 following message:

 code
 [me@mycomputer]$ python2 web2py.py -a 123 -i 0.0.0.0
 Traceback (most recent call last):
   File web2py.py, line 18, in module
 import gluon.widget
   File /home/ricardo/Documents/proj/w2p210c/gluon/__init__.py, line 
 29, in module
 You can also download a complete copy from http://www.web2py.com.;
 RuntimeError: web2py depends on pydal, which apparently you have not 
 installed.
 Probably you cloned the repository using git without '--recursive'
 To fix this, please run (from inside your web2py folder):

  git submodule update --init --recursive

 You can also download a complete copy from http://www.web2py.com.
 /code

 So, until now, I can't test the Paolo Valleri solution for issue #170 of 
 pydal.

 Any Ideas?

 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+un...@googlegroups.com javascript:.
 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] Pydal issues

2015-05-07 Thread José Ricardo Borba
Thank you, Niphlod and Richard, to take care about.

Cheers,

2015-05-07 16:18 GMT-03:00 Niphlod niph...@gmail.com:

 unfortunately, bad commit happens. we know already.
 https://github.com/web2py/web2py/commit/6f91fdd8332beb5e6a17a1444655e9b9f22e2f4c#commitcomment-11073544

 On Thursday, May 7, 2015 at 9:06:51 PM UTC+2, Richard wrote:

 I had the same issue last night trying to clone web2py... pydal never
 shows up!!

 Richard

 On Thu, May 7, 2015 at 3:06 PM, Richard Vézina ml.richa...@gmail.com
 wrote:

 copy mannually the pydal in web2py gluon/packages folder...

 which is what git clone --recursive web2py repo should do...

 Richard

 On Thu, May 7, 2015 at 3:02 PM, José Ricardo Borba jrbor...@gmail.com
 wrote:

 Sorry about that title, but I'm seeing in the messages that is a number
 of messages with pydal connection errors, even with some (little) older
 versions.

 My issue with MONGODB is (at some point) replicated with MSSQL, @Alan
 (don't know about what database).

 So, after (another) installation of web2py (cloning from github), some
 strange things happen this time. Follow the output from command line:

 code
 Cloning into 'w2p'...
 remote: Counting objects: 31116, done.
 remote: Compressing objects: 100% (4/4), done.
 remote: Total 31116 (delta 0), reused 0 (delta 0), pack-reused 3
 Receiving objects: 100% (31116/31116), 32.08 MiB | 98.00 KiB/s, done.
 Resolving deltas: 100% (18762/18762), done.
 Checking connectivity... done.
 Submodule 'gluon/packages/dal' (https://github.com/web2py/pydal.git)
 registered for path 'gluon/packages/dal'
 Cloning into 'gluon/packages/dal'...
 remote: Counting objects: 30227, done.
 remote: Compressing objects: 100% (41/41), done.
 remote: Total 30227 (delta 29), reused 0 (delta 0), pack-reused 30186
 Receiving objects: 100% (30227/30227), 30.27 MiB | 474.00 KiB/s, done.
 Resolving deltas: 100% (18157/18157), done.
 Checking connectivity... done.
 fatal: reference is not a tree: 04ffbb371c59bfe253cae7865670c132b9b7eb44
 Unable to checkout '04ffbb371c59bfe253cae7865670c132b9b7eb44' in
 submodule path 'gluon/packages/dal'
 /code

 So, when I try to run web2py from the command line, this is the
 following message:

 code
 [me@mycomputer]$ python2 web2py.py -a 123 -i 0.0.0.0
 Traceback (most recent call last):
   File web2py.py, line 18, in module
 import gluon.widget
   File /home/ricardo/Documents/proj/w2p210c/gluon/__init__.py, line
 29, in module
 You can also download a complete copy from http://www.web2py.com.;
 RuntimeError: web2py depends on pydal, which apparently you have not
 installed.
 Probably you cloned the repository using git without '--recursive'
 To fix this, please run (from inside your web2py folder):

  git submodule update --init --recursive

 You can also download a complete copy from http://www.web2py.com.
 /code

 So, until now, I can't test the Paolo Valleri solution for issue #170
 of pydal.

 Any Ideas?

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




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


Re: [web2py] Re: from desktop to web2py

2015-05-07 Thread Marcello Console
Thank you for your help Stifan.
The problem here is that i need to let the user choose among some
value gotted from the excel file he gave as input. And i should do
this meanwhile writing other files.
How can i do this?
Make all this stuff as an ajax function called after the user select
the file input?
Any easiest way?
Thanks a lot


2015-05-07 20:56 GMT+02:00, 黄祥 steve.van.chris...@gmail.com:
 if you use sqlform.factory, i think you should do the insert data from
 sqlform.factory to the table manually.
 e.g. taken from
 http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-factory

  modified it
 def form_from_factory():
 form = SQLFORM.factory(
 Field('your_name', requires=IS_NOT_EMPTY()),
 Field('your_image', 'upload'))
 if form.process().accepted:
 response.flash = 'form accepted'
 db.customer.insert(**db.customer._filter_fields(form.vars) )
 elif form.errors:
 response.flash = 'form has errors'
 return dict(form=form)

 another thing, i think you can use another like sqlform, or sqlform.grid

 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/c247sPk5ALU/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


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


[web2py] Re: MSSQLAdapter missing?

2015-05-07 Thread Niphlod


On Thursday, May 7, 2015 at 6:01:17 PM UTC+2, Ron Chatterjee wrote:

 May be now people will start using mongodb and I will get all my question 
 answered! lol


it doesn't have nothing to do with it.

@carl: looks like you screwed something up... latest web2py version should 
use pydal embedded in the repo, not a version stored in dist-packages. 
moreover, your unixodbc installation seems to fail.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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-07 Thread LoveWeb2py
Okay... must be something on my end. I'm getting Filaed to load resourrce: 
the server responded with a status of 500 (INTERNAL SERVER ERROR) 
http;//www.mysite.com/myapp/controller/add_function/name_of_table_field

I'll keep playing around with it and let you know how it turns out. Thank 
you so much, Richard!

On Thursday, May 7, 2015 at 9:33:28 AM UTC-4, Richard wrote:

 you need bootstrap 2.3.2 (not tested with BS3, but I am pretty sure it is 
 not working, too differents)...

 Did you try it with a recent web2py setup? I would suggest you try with 
 web2py 2.9.5 which is what I use actually and it works...

 Richard

 On Thu, May 7, 2015 at 9:20 AM, LoveWeb2py atayl...@gmail.com 
 javascript: wrote:

 Another observation:

 All of this code:



 js += '$(function() {' \
   '$(#%s_option_add_trigger).button({' \
   'text: true,' \
   'icons: {' \
   'primary: ui-icon-circle-plus' \
   '}' \
   '});' \
   '});' % (my_select_id)
 js += '$(function() { ' \
   '$( #%s_option_add_trigger ).css(margin-left, 
 +=5); ' \
   '});' % (my_select_id)
 js += 
 '$(#{modal_id}).appendTo(body);'.format(modal_id=my_select_id 
 + _modal-form)


 Get's commented out when it's rendered so it ends up looking like this 
 !-- $(document).read(function()  .appendTo(body);}); //--

 Any idea why that could be happening and would that impact the button 
 showing the modal 

 On Thursday, May 7, 2015 at 8:45:49 AM UTC-4, LoveWeb2py wrote:

 Hi Richard!

 I think I'm getting close. No more errors, and I applied the widget to 
 the field successfully. I see the + sign next to my field, but nothing 
 happens when I click it so I'm going over the javascript with a fine tooth 
 comb. Is there any additional .js or .css files I need to include?

 This is really looking promising!

 On Wednesday, May 6, 2015 at 12:42:34 PM UTC-4, Richard wrote:

 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 atayl...@gmail.com 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 atayl...@gmail.com 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 

[web2py] Re: Issues with PythonAnywhere - /proc/meminfo

2015-05-07 Thread Paolo Valleri
Hi, you have spotted an issue on the new cache system.
I've opened the issue so we can fix it soon. 
https://github.com/web2py/web2py/issues/959

Paolo

On Wednesday, May 6, 2015 at 3:28:44 PM UTC+2, Lovecannon wrote:

 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.


[web2py] Re: Postgresql problems with 2 tabs

2015-05-07 Thread Niphlod
try to use different formname= argument for each page.

On Thursday, May 7, 2015 at 12:14:38 PM UTC+2, Gael Princivalle wrote:

 Hello all.

 I've moved a db from sqlite to postgresql, but I've got a strange problem.
 With only one tab, ok.
 If I have two tabs with the same application, it seems that data's are 
 mixed.
 For example in tab 1 I have a grid, in tab 2 a page.
 When I save from tab 1 grid I see some data's from tab 2.

 Another example, if I open 3 tabs with the same grid for modifying 3 
 different records, and I save all records, data's of these 3 records will 
 be mixed, not in the fields, but when I use these records in the 
 application.

 Here is my DAL connection:
 db = DAL('postgres://user:pass@localhost:5432/postg_myapp', 
 check_reserved=['all'], pool_size=1, entity_quoting=True, bigint_id=True)

 Someone's know why?

 Thanks, regards.





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


[web2py] Re: web2py-mongodb-engine

2015-05-07 Thread Ron Chatterjee
Below is what I have the model in django. I can do the ListField() in 
web2py using list:string I believe but I am having problem with how to do 
EmbeddedModelField! in web2py. I don't understand what you mean by do it 
independently of backend! Do you mean to insert the table in mongodb 
independently and somehow then call from web2py to create the DAL object? 




from django.db import modelsfrom django.core.urlresolvers import reverse
from djangotoolbox.fields import ListField, EmbeddedModelField

class Post(models.Model):
created_at = models.DateTimeField(auto_now_add=True, db_index=True)
title = models.CharField(max_length=255)
slug = models.SlugField()
body = models.TextField()
comments = ListField(EmbeddedModelField('Comment'), editable=False)

def get_absolute_url(self):
return reverse('post', kwargs={slug: self.slug})

def __unicode__(self):
return self.title

class Meta:
ordering = [-created_at]

class Comment(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
body = models.TextField(verbose_name=Comment)
author = models.CharField(verbose_name=Name, max_length=255)






On Thursday, May 7, 2015 at 3:26:00 AM UTC-4, Paolo Valleri wrote:

 I don't see any problem at all in implementing a common post-comment page 
 in web2py.
 You can code it independently from the backend. 

 On Wednesday, May 6, 2015 at 8:28:08 PM UTC+2, Ron Chatterjee wrote:

 Here is another tutorial from django:


 *http://docs.mongodb.org/manual/tutorial/write-a-tumblelog-application-with-django-mongodb-engine/
  
 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] Two SQLFORMs side by side?

2015-05-07 Thread LoveWeb2py
Hi Richard!

I think I'm getting close. No more errors, and I applied the widget to the 
field successfully. I see the + sign next to my field, but nothing happens 
when I click it so I'm going over the javascript with a fine tooth comb. Is 
there any additional .js or .css files I need to include?

This is really looking promising!

On Wednesday, May 6, 2015 at 12:42:34 PM UTC-4, Richard wrote:

 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 atayl...@gmail.com 
 javascript: 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 atayl...@gmail.com 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 = 

Re: [web2py] parenthesis in SQLFORM.grid search

2015-05-07 Thread Richard Vézina
Here what I got for now :

from pyparsing import nestedExpr
# Not the worse case but has enough complexity to start with
grouped_query_string = \
'a_table.integer_field  1)  ' \
'   (a_table.integer_field not equal 2) ' \
'   (~a_table.integer_field in 200, 300, 400))  ' \
'(a_table.integer_field = 3000)) | ' \
'(a_table.boolean_field = True))'

list_of_nested_query_string = nestedExpr('(',
')').parseString(grouped_query_string).asList()

ops_translation = {
'==': '=',
'!=': '!=',
'': '',
'': '',
'=': '=',
'=': '=',
'': '!=',
'=': '=',
'=': '=',
'=': '=',
'less or equal than': '=',
'greater or equal than': '=',
'equal or less than': '=',
'equal or greater than': '=',
'less or equal': '=',
'greater or equal': '=',
'equal or less': '=',
'equal or greater': '=',
'not equal to': '!=',
'not equal': '!=',
'equal to': '=',
'equal': '=',
'equals': '=',
'less than': '',
'greater than': '',
'starts with': 'startswith',  # ??
'ends with': 'endswith',  # ??
'not in': 'notbelongs',  # ??
'in': 'belongs',  # ??
'is': '='
}

# Base traverse() function which I derive the rest
# def traverse(o, tree_types=(list, tuple)):
# if isinstance(o, tree_types):
# for value in o:
# for subvalue in traverse(value):
# yield subvalue
# else:
# yield o

# Here the beast
queries = {}

nested = []

def traverse(o, tree_types=(list, tuple)):
ops = ('', '|')
q = None
negative = None
if isinstance(o, tree_types):
# nested.append('()')
# if len(o)  2 and o[1] in ops:
# nested.append(o[1])
if len(o)  2 and o[1] not in ops:
print o
table, field_name = o[0].split('.')
if table[0] == '~':
negative = True
table = table[1:]
field = db[table][field_name]
op = ops_translation[' '.join(o[1:-1])]
value = o[-1]
if op == '=':
q = field == value
elif op == '':
q = field  value
elif op == '':
q = field  value
elif op == '=':
q = field = value
elif op == '=':
q = field = value
elif op == '!=':
q = field != value
elif op == 'belongs':
q = field.belongs(value[1:-1].split(','))
elif op == 'notbelongs':
q = ~field.belongs(value[1:-1].split(','))
elif field.type in ('text', 'string', 'json'):
if op == 'contains':
q = field.contains(value)
elif op == 'like':
q = field.ilike(value)
elif op == 'startswith':
q = field.startswith(value)
elif op == 'endswith':
q = field.endswith(value)
else:
raise RuntimeError(Invalid operation)
queries[tuple(o)] = q
print q
for value in o:
for subvalue in traverse(value):
yield subvalue
else:
yield o

# For invoquing the generator
for e in traverse(list_of_nested_query_string): e  # Notting come out
except print

# Then have a look to queries

I build a dict of tuple query has key to try to replace the sublist in the
list_of_nested_query_string, but then I need to traverse it again and
build nested query in another traverse derived function... Not clean code...

# Here model definition for testing purpose
db.define_table('a_table',
Field('string_field', 'string'),
Field('text_field', 'text'),
Field('boolean_field', 'boolean'),
Field('integer_field', 'integer'),
Field('double_field', 'double'),
# Field('decimal_field', 'decimal'),
# Field('date_field', 'date'),
# Field('time_field', 'time'),
# Field('datetime_field', 'datetime'),
# Field('reference_field', 'reference referred_table'),
# Field('list_string_field', 'list:string'),
# Field('list_integer_field', 'list:integer'),
# Field('list_reference_field', 'list:reference
referred_table')
)

fields = [db.a_table.string_field,
  db.a_table.text_field,
  db.a_table.boolean_field,
  db.a_table.integer_field,
  db.a_table.double_field,
  # db.a_table.decimal_field,
  # db.a_table.date_field,
  # db.a_table.time_field,
  # db.a_table.reference_field,
  # db.a_table.list_string_field,
  # db.a_table.list_integer_field,

[web2py] Re: many to many with SQLFORM.grid

2015-05-07 Thread 黄祥
had you tried it?
another work around is u can use smartgrid constraints
e.g.
def test():
table = db.co_meet
query = db.co_meet.ref_company == 1 # whatever value that refer to 
table company
grid = SQLFORM.smartgrid(table, constraints = dict(co_meet=query) )
return locals()
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: many to many with SQLFORM.grid

2015-05-07 Thread Ben Lawrence
Thanks! But wouldn't that just give me a grid of 'co_meet' and not 
'meeting'?


On Monday, May 4, 2015 at 9:20:01 AM UTC-7, 黄祥 wrote:

 perhaps, you can do 
 e.g.
 def test():
 query = db.co_meet.ref_company == 1 # whatever value that refer to 
 table company
 grid=SQLFORM.grid(query)
 return locals()

 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.


Re: [web2py] parenthesis in SQLFORM.grid search

2015-05-07 Thread Richard Vézina
Recursive problem... I get closer, but have a lot of difficulty figuring
out how to assembling the nested queries in the right order and the right
depth of each query...

I have been so far able to extract a flatten dict of each individually
nested query and translated them into web2py query...

But as explained above now I bang my head on my desk...

:)

Richard

On Thu, Apr 30, 2015 at 9:46 AM, Richard Vézina ml.richard.vez...@gmail.com
 wrote:

 It could work of course, but it hurts to have to do that to just filter
 out correctly a dropdown menu... What I was doing until now was to have a
 single returning json_feed which for each dropdown required... But it not
 try, I need to create almost identical function for each particular
 dropdown to feed typeahead widget with remote data... I am padding
 smart_query() with unittest right now before give a try to make it accept
 grouped query...

 Richard

 On Thu, Apr 30, 2015 at 7:47 AM, Johann Spies johann.sp...@gmail.com
 wrote:

 Will it not be easier to encapsulate your complex query in a database
 view and run the grid on the view?

 e.g.  in the controller:
 db.execute(create view xx as complexquery)

 db.define_table('xx',
 Field1(),
 Field2...



 Johann
 --
 Because experiencing your loyal love is better than life itself,
 my lips will praise you.  (Psalm 63:3)

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are 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-07 Thread António Ramos
if i open console i see this before installing SublimeREPL

warning: mnemonic r not found in menu caption SublimeREPL
warning: mnemonic r not found in menu caption Ruby
warning: mnemonic p not found in menu caption Python
warning: mnemonic d not found in menu caption Python - PDB current file
warning: mnemonic d not found in menu caption Python - RUN current file
warning: mnemonic p not found in menu caption Python - IPython
warning: mnemonic f not found in menu caption F#
warning: mnemonic d not found in menu caption GDB
warning: mnemonic g not found in menu caption Groovy
warning: mnemonic h not found in menu caption Haskell
warning: mnemonic i not found in menu caption Io
warning: mnemonic l not found in menu caption Lua
warning: mnemonic m not found in menu caption Matlab
warning: mnemonic m not found in menu caption MozRepl
warning: mnemonic n not found in menu caption Node
warning: mnemonic o not found in menu caption Octave
warning: mnemonic p not found in menu caption Perl
warning: mnemonic s not found in menu caption PHP
warning: mnemonic p not found in menu caption PowerShell
warning: mnemonic r not found in menu caption R
warning: mnemonic n not found in menu caption Racket
warning: mnemonic r not found in menu caption Rails
warning: mnemonic b not found in menu caption SBT for opened folder
warning: mnemonic r not found in menu caption Scheme
warning: mnemonic r not found in menu caption Gauche
warning: mnemonic r not found in menu caption Petite Chez Scheme
warning: mnemonic scs not found in menu caption ScriptCS
warning: mnemonic s not found in menu caption Shell
Opening in new tab
Stoping web2py server with pid: 6192
Opening in new tab


Then clicking to install sublimeREPL nothing happens
 i see only in status bar
*Loading repositories *
and as soon this messages disappears nothing happens and going back to
search to install, there it is again in the list

W2P:Add sublimeREPL Support








2015-05-06 18:18 GMT+01:00 Gergely Orosz oroszgergely840...@gmail.com:

 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 ramst...@gmail.com:

 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 ramst...@gmail.com:

 I have seen the light

 Keep working on it. Its very good...

 2015-05-06 10:06 GMT+01:00 Gergely Orosz oroszgerg...@gmail.com:

 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 oroszgerg...@gmail.com:

 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 oroszgerg...@gmail.com:

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

[web2py] Re: web2py-mongodb-engine

2015-05-07 Thread Alan Etkin
I did not check the django app code but if you want to handle embedded json 
objects you should use table definitions with a json field.

Something like
db.define_table(mytable, Field(embeddedobject, json) # db is a 
mongodb connection (DAL instance)


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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-07 Thread Richard Vézina
Ok, I don't understand... Can you go back one step and explain what kind of
information you want to manage and why you think you have to update the IP
address... Is there multiple records with the same server name if so why...
It seems to me that you want to manage kind of history of IP attached to a
given device... If so, you DB schema is not sufficient, you will need an
archive table which will contains the old state of your server record... In
your server table there will be only a single record for each of your
server and in the history table when you update this single record the old
state of the record will be copied there, so you can track all the IP a
given server had in the past... An history table is easy achieve in web2py
with record versioning...

Richard

On Thu, May 7, 2015 at 6:52 AM, kecajkecaj...@gmail.com wrote:

 Hi,

 What's the difference between what i wrote and what You wrote?
 And i believe You didn't get my point. Checking if IP is Free works
 correctly. Point is that i want do update the one row in Server table and
 change i.e. server name. I click on update button provided by grid, and i
 can change the name of the server (withouth changing its IP), but i need to
 chose an IP as well. Problem is that on the IP list, IP i used for that
 server before is marked as Used, so i won't see it on the list and i can't
 chose it again. How to make it available for selection while i'm updating
 the row.

 Thanks
 On Wednesday, 6 May 2015 16:52:05 UTC+2, Richard wrote:

 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, kecajk...@gmail.com 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+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] IS_IN_DB() multiple tables

2015-05-07 Thread Anthony
On Wednesday, May 6, 2015 at 10:52:05 AM UTC-4, Richard wrote:

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


When you define the set doesn't matter, as no records are actually pulled 
until a select is done.

Anthony

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


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

2015-05-07 Thread Niphlod
rather recently https://github.com/web2py/pydal/issues/60 (20 march)

On Thursday, May 7, 2015 at 3:39:05 PM UTC+2, Alan Etkin wrote:

 @Michelle

 Looks like the backports does not include python 2.7 (at least with the 
 sources I searched so far).

 @Simone

 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.


 When was python 2.5 support dropped? I think I'm going to use a easier 
 approach by just installing an older version (I have tried release 2.0.9 
 and it starts without errors)



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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] downloading old web2py version from github

2015-05-07 Thread Richard Vézina
Not my app welcome app!!

I saw ne appconfig.ini which is great, but not seems to works properly... I
try to troubleshoot with limited time and didn't get anywhere...

Richard

On Thu, May 7, 2015 at 3:05 AM, Niphlod niph...@gmail.com wrote:

 *unable to open database file* doesn't mean that web2py isn't running.
 Probably the earlier version doesn't contain appconfig, which your app
 seems to rely on for configuration...


 On Thursday, May 7, 2015 at 1:12:25 AM UTC+2, 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 module
 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.


Re: [web2py] Two SQLFORMs side by side?

2015-05-07 Thread Richard Vézina
you need bootstrap 2.3.2 (not tested with BS3, but I am pretty sure it is
not working, too differents)...

Did you try it with a recent web2py setup? I would suggest you try with
web2py 2.9.5 which is what I use actually and it works...

Richard

On Thu, May 7, 2015 at 9:20 AM, LoveWeb2py atayloru...@gmail.com wrote:

 Another observation:

 All of this code:



 js += '$(function() {' \
   '$(#%s_option_add_trigger).button({' \
   'text: true,' \
   'icons: {' \
   'primary: ui-icon-circle-plus' \
   '}' \
   '});' \
   '});' % (my_select_id)
 js += '$(function() { ' \
   '$( #%s_option_add_trigger ).css(margin-left,
 +=5); ' \
   '});' % (my_select_id)
 js += 
 '$(#{modal_id}).appendTo(body);'.format(modal_id=my_select_id
 + _modal-form)


 Get's commented out when it's rendered so it ends up looking like this
 !-- $(document).read(function()  .appendTo(body);}); //--

 Any idea why that could be happening and would that impact the button
 showing the modal

 On Thursday, May 7, 2015 at 8:45:49 AM UTC-4, LoveWeb2py wrote:

 Hi Richard!

 I think I'm getting close. No more errors, and I applied the widget to
 the field successfully. I see the + sign next to my field, but nothing
 happens when I click it so I'm going over the javascript with a fine tooth
 comb. Is there any additional .js or .css files I need to include?

 This is really looking promising!

 On Wednesday, May 6, 2015 at 12:42:34 PM UTC-4, Richard wrote:

 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 atayl...@gmail.com 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 atayl...@gmail.com 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
  

[web2py] MSSQLAdapter missing?

2015-05-07 Thread Carl Petersen
Hello All,

Working with the latest versions of web2py and it seems that my sql server 
connections are breaking.  I noticed that a fairly large section of code 
related to MSSQLAdapter in gluon/dal.py has been taken out.  Should I be 
approaching sql server connections differently now.  I was previously using 
mssql3.

Thanks,

Carl 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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-07 Thread Alan Etkin
@Michelle

Looks like the backports does not include python 2.7 (at least with the 
sources I searched so far).

@Simone

 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.


When was python 2.5 support dropped? I think I'm going to use a easier 
approach by just installing an older version (I have tried release 2.0.9 
and it starts without errors)

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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: MSSQLAdapter missing?

2015-05-07 Thread Niphlod
still 
there. https://github.com/web2py/pydal/blob/master/pydal/adapters/mssql.py 
. noone removed anything.

On Thursday, May 7, 2015 at 3:41:28 PM UTC+2, Carl Petersen wrote:

 Hello All,

 Working with the latest versions of web2py and it seems that my sql server 
 connections are breaking.  I noticed that a fairly large section of code 
 related to MSSQLAdapter in gluon/dal.py has been taken out.  Should I be 
 approaching sql server connections differently now.  I was previously using 
 mssql3.

 Thanks,

 Carl 


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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-07 Thread LoveWeb2py
Another observation:

All of this code:



 js += '$(function() {' \
   '$(#%s_option_add_trigger).button({' \
   'text: true,' \
   'icons: {' \
   'primary: ui-icon-circle-plus' \
   '}' \
   '});' \
   '});' % (my_select_id)
 js += '$(function() { ' \
   '$( #%s_option_add_trigger ).css(margin-left, 
 +=5); ' \
   '});' % (my_select_id)
 js += 
 '$(#{modal_id}).appendTo(body);'.format(modal_id=my_select_id 
 + _modal-form)


 Get's commented out when it's rendered so it ends up looking like this 
!-- $(document).read(function()  .appendTo(body);}); //--

Any idea why that could be happening and would that impact the button 
showing the modal 

On Thursday, May 7, 2015 at 8:45:49 AM UTC-4, LoveWeb2py wrote:

 Hi Richard!

 I think I'm getting close. No more errors, and I applied the widget to the 
 field successfully. I see the + sign next to my field, but nothing happens 
 when I click it so I'm going over the javascript with a fine tooth comb. Is 
 there any additional .js or .css files I need to include?

 This is really looking promising!

 On Wednesday, May 6, 2015 at 12:42:34 PM UTC-4, Richard wrote:

 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 atayl...@gmail.com 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 atayl...@gmail.com 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,
  # 
 

[web2py] Re: Solve enconding on diferent server

2015-05-07 Thread Tom Stratton
Hi Leonardo - 

I think that the issue probably lies in the pg8000 adapter in pydal. I'm 
trying to hunt down a couple of unicode errors in that module. It would 
really help me if you could post the stack trace of the error that you get. 
The error message itself is not much help in finding the source of the 
error.

Thanks

Tom




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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-07 Thread kecajkecaj123
Hi, 

What's the difference between what i wrote and what You wrote? 
And i believe You didn't get my point. Checking if IP is Free works 
correctly. Point is that i want do update the one row in Server table and 
change i.e. server name. I click on update button provided by grid, and i 
can change the name of the server (withouth changing its IP), but i need to 
chose an IP as well. Problem is that on the IP list, IP i used for that 
server before is marked as Used, so i won't see it on the list and i can't 
chose it again. How to make it available for selection while i'm updating 
the row.

Thanks
On Wednesday, 6 May 2015 16:52:05 UTC+2, Richard wrote:

 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, kecajk...@gmail.com javascript: 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+un...@googlegroups.com javascript:.
 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: Any problem in list:reference in 2.10 ?

2015-05-07 Thread Ben Lawrence
This fixes an error I experience in the db admin interface, when I use 
postgresql.
When i use sqlite, I did not see this error for the same code in my app.


On Wednesday, April 29, 2015 at 3:07:21 AM UTC-7, Paolo Valleri wrote:

 Hi,
 Can you try the fix I proposed in 
 https://github.com/web2py/web2py/issues/946#issuecomment-9661

 Paolo

 On Tuesday, April 28, 2015 at 9:26:23 PM UTC+2, Ariya Owam-aram wrote:

 Hi Everyone,

 I just upgrade to 2.10.4 and found error message when using filed 
 list:reference.

 APP : welcome 

 DB
 db.define_table('parent', Field('name'))
 db.define_table('student', Field('name'), Field('parent', 'list:reference 
 parent'))

 in APPADMIN
 - from parent table insert : father, mother
 - from student table insert : student1 with select father (or mother or 
 both)
 - open student grid view : return error 
 type 'exceptions.TypeError' isinstance() arg 2 must be a class, type, 
 or tuple of classes and types

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

 Traceback (most recent call last):
   File /home/www-data/web2py/gluon/restricted.py, line 227, in restricted
 exec ccode in environment
   File /home/www-data/web2py/applications/welcome/views/appadmin.html 
 https://op4.cacpacific.com/admin/edit/welcome/views/appadmin.html, line 
 175, in module
 {{if ram['bytes']  524287:}}
   File /home/www-data/web2py/gluon/sqlhtml.py, line 3253, in __init__
 r = represent(field, r or [], record)
   File /home/www-data/web2py/gluon/sqlhtml.py, line 68, in represent
 return f(value)
   File /home/www-data/web2py/gluon/packages/dal/pydal/helpers/methods.py, 
 line 268, in __call__
 if isinstance(db._adapter, GoogleDatastoreAdapter):
 TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and 
 types


 Frames

- 

*File /home/www-data/web2py/gluon/restricted.py in restricted at line 
 227* code arguments variables
- 

*File /home/www-data/web2py/applications/welcome/views/appadmin.html in 
 module at line 175* code arguments variables
- 

*File /home/www-data/web2py/gluon/sqlhtml.py in __init__ at line 3253* 
 code arguments variables
- 

*File /home/www-data/web2py/gluon/sqlhtml.py in represent at line 68* 
 code arguments variables
- 

*File /home/www-data/web2py/gluon/packages/dal/pydal/helpers/methods.py 
 in __call__ at line 268* code arguments variables
Function argument list

(self=pydal.helpers.methods._repr_ref_list object, value=[1L], row=None)
Code listing

263.
264.
265.
266.
267.
268.

269.
270.
271.
272.

if not value:
return None
from ..adapters import GoogleDatastoreAdapter
refs = None
db, id = self.ref._db, self.ref._id
if isinstance(db._adapter, GoogleDatastoreAdapter):

def count(values):
return db(id.belongs(values)).select(id)
rx = range(0, len(value), 30)
refs = reduce(lambda a, b: a  b, [count(value[i:i+30])

Variablesbuiltinisinstancebuilt-in function 
 isinstancedb._adapterpydal.adapters.sqlite.SQLiteAdapter 
objectdbDAL uri=sqlite://storage.sqliteGoogleDatastoreAdapterNone


 Thank you
 Ariya



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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: from desktop to web2py

2015-05-07 Thread Dave S


On Thursday, May 7, 2015 at 12:12:20 PM UTC-7, goome wrote:

 Thank you for your help Stifan. 
 The problem here is that i need to let the user choose among some 
 value gotted from the excel file he gave as input. 



Do you need to do this before adding anything from the file to the database?
For instance, only a subset of the data in the file is to be committed?

This could probably be done on the client side with javascript.  There are 
some javascript tools 
that some of the other posters use for data management.
Joe Barnhart has this recommendation:

 The jQuery Datatables library is very impressive.  It handles sorting, 
 filtering, displaying of data in all forms.  Its really worth a look at 
 http://datatables.net  My application is very data-centric and I use a 
 LOT of tables, so I built some datatable factory methods to help me.

URL:https://groups.google.com/d/msg/web2py/fj_UhjPmhK0/arM06tukVOgJ
I don't know what you need to do to feed it client data instead of server 
data.

If you want to do this on the server side instead, my first thought is to 
[upload the file], import it via CSV import into a *temporary table*, and 
then use the data in the temporary table to create the form (SQLFORM, or 
its grid offspring), and when you process the form update the permanent 
table.

 

And i should do 
 this meanwhile writing other files.


I'm not sure what this means.  Do you need to have multiple outputs based 
on the data, or do you need to multiple threads to speed up the processing?


 How can i do this? 
 Make all this stuff as an ajax function called after the user select 
 the file input? 


You could use AJAX/components to provide the view into the temporary table, 
if you wanted it to appear on the same page as the input form for the 
filename.  If you preferred to redirect, then anything you weren't ready to 
forget from the filename form could be stored in the session, I think.
 

 Any easiest way? 
 Thanks a lot 


I say this with having done just the littlest bit with forms, and just a 
teeny bit more with AJAX, and not much with the new-fangled tools that 
javascript gurus are throwing at ^W^W offering us.

Good luck!

/dps
(to read the weak joke above, recall what CTRL-W does on the BASH command 
line)
 


 2015-05-07 20:56 GMT+02:00, 黄祥 steve.van...@gmail.com javascript:: 
  if you use sqlform.factory, i think you should do the insert data from 
  sqlform.factory to the table manually. 
  e.g. taken from 
  
 http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-factory
  
  
   modified it 
  def form_from_factory(): 
  form = SQLFORM.factory( 
  Field('your_name', requires=IS_NOT_EMPTY()), 
  Field('your_image', 'upload')) 
  if form.process().accepted: 
  response.flash = 'form accepted' 
  db.customer.insert(**db.customer._filter_fields(form.vars) ) 
  elif form.errors: 
  response.flash = 'form has errors' 
  return dict(form=form) 
  
  another thing, i think you can use another like sqlform, or sqlform.grid 
  
  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 a topic in the 
  Google Groups web2py-users group. 
  To unsubscribe from this topic, visit 
  https://groups.google.com/d/topic/web2py/c247sPk5ALU/unsubscribe. 
  To unsubscribe from this group and all its topics, send an email to 
  web2py+un...@googlegroups.com javascript:. 
  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: MSSQLAdapter missing?

2015-05-07 Thread Carl Petersen
OK, obviously I approached this in the wrong manner.  Sorry!  I'm upgrading 
from 2.9.11-stable+timestamp.2014.09.15.23.35.11 to 
2.10.4-stable+timestamp.2015.04.26.15.11.54 
and it looks like DAL has changed somewhat in that timeframe.  For some 
reason it seems my sql server connections are unhappy (maybe related, maybe 
not).  I'm getting the following error:

db_gp_wspg = DAL('mssql3://DRIVER={ODBC Driver 11 for SQL 
Server};SERVER=server;DATABASE=database;port=port;domain=WSPG;UID=user;PWD=passwd',pool_size=1,check_reserved=None,migrate=False)
  File 
/usr/local/lib/python2.7/dist-packages/pyDAL-15.03-py2.7.egg/pydal/base.py, 
line 169, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
  File 
/usr/local/lib/python2.7/dist-packages/pyDAL-15.03-py2.7.egg/pydal/base.py, 
line 456, 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 
/usr/local/lib/python2.7/dist-packages/pyDAL-15.03-py2.7.egg/pydal/base.py, 
line 434, in __init__
self._adapter = ADAPTERS[self._dbname](**kwargs)
  File 
/usr/local/lib/python2.7/dist-packages/pyDAL-15.03-py2.7.egg/pydal/adapters/base.py,
 
line 53, in __call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
  File 
/usr/local/lib/python2.7/dist-packages/pyDAL-15.03-py2.7.egg/pydal/adapters/mssql.py,
 
line 155, in __init__
if do_connect: self.reconnect()
  File 
/usr/local/lib/python2.7/dist-packages/pyDAL-15.03-py2.7.egg/pydal/connection.py,
 
line 126, in reconnect
self.connection = f()
  File 
/usr/local/lib/python2.7/dist-packages/pyDAL-15.03-py2.7.egg/pydal/adapters/mssql.py,
 
line 153, in connector
return self.driver.connect(cnxn, **driver_args)
Error: ('01000', [01000] [unixODBC][Driver Manager]Can't open lib 
'/opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2270.0' : file not 
found (0) (SQLDriverConnect))

I have checked, and the file libmsodbcsql-11.0.so.2270.0 is located in 
that directory, and is readable.

If I have missed something obvious, my apologies.  website maintainer is my 
part-time hat, and a new one at that!

Thanks,

Carl

On Thursday, May 7, 2015 at 9:25:18 AM UTC-5, Niphlod wrote:

 still there. 
 https://github.com/web2py/pydal/blob/master/pydal/adapters/mssql.py . 
 noone removed anything.

 On Thursday, May 7, 2015 at 3:41:28 PM UTC+2, Carl Petersen wrote:

 Hello All,

 Working with the latest versions of web2py and it seems that my sql 
 server connections are breaking.  I noticed that a fairly large section of 
 code related to MSSQLAdapter in gluon/dal.py has been taken out.  Should I 
 be approaching sql server connections differently now.  I was previously 
 using mssql3.

 Thanks,

 Carl 



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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: MSSQLAdapter missing?

2015-05-07 Thread Ron Chatterjee
May be now people will start using mongodb and I will get all my question 
answered! lol

On Thursday, May 7, 2015 at 11:58:06 AM UTC-4, Carl Petersen wrote:

 OK, obviously I approached this in the wrong manner.  Sorry!  I'm 
 upgrading from 2.9.11-stable+timestamp.2014.09.15.23.35.11 to 
 2.10.4-stable+timestamp.2015.04.26.15.11.54 
 and it looks like DAL has changed somewhat in that timeframe.  For some 
 reason it seems my sql server connections are unhappy (maybe related, maybe 
 not).  I'm getting the following error:

 db_gp_wspg = DAL('mssql3://DRIVER={ODBC Driver 11 for SQL 
 Server};SERVER=server;DATABASE=database;port=port;domain=WSPG;UID=user;PWD=passwd',pool_size=1,check_reserved=None,migrate=False)
   File 
 /usr/local/lib/python2.7/dist-packages/pyDAL-15.03-py2.7.egg/pydal/base.py, 
 line 169, in __call__
 obj = super(MetaDAL, cls).__call__(*args, **kwargs)
   File 
 /usr/local/lib/python2.7/dist-packages/pyDAL-15.03-py2.7.egg/pydal/base.py, 
 line 456, 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 
 /usr/local/lib/python2.7/dist-packages/pyDAL-15.03-py2.7.egg/pydal/base.py, 
 line 434, in __init__
 self._adapter = ADAPTERS[self._dbname](**kwargs)
   File 
 /usr/local/lib/python2.7/dist-packages/pyDAL-15.03-py2.7.egg/pydal/adapters/base.py,
  
 line 53, in __call__
 obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
   File 
 /usr/local/lib/python2.7/dist-packages/pyDAL-15.03-py2.7.egg/pydal/adapters/mssql.py,
  
 line 155, in __init__
 if do_connect: self.reconnect()
   File 
 /usr/local/lib/python2.7/dist-packages/pyDAL-15.03-py2.7.egg/pydal/connection.py,
  
 line 126, in reconnect
 self.connection = f()
   File 
 /usr/local/lib/python2.7/dist-packages/pyDAL-15.03-py2.7.egg/pydal/adapters/mssql.py,
  
 line 153, in connector
 return self.driver.connect(cnxn, **driver_args)
 Error: ('01000', [01000] [unixODBC][Driver Manager]Can't open lib 
 '/opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2270.0' : file not 
 found (0) (SQLDriverConnect))

 I have checked, and the file libmsodbcsql-11.0.so.2270.0 is located in 
 that directory, and is readable.

 If I have missed something obvious, my apologies.  website maintainer is 
 my part-time hat, and a new one at that!

 Thanks,

 Carl

 On Thursday, May 7, 2015 at 9:25:18 AM UTC-5, Niphlod wrote:

 still there. 
 https://github.com/web2py/pydal/blob/master/pydal/adapters/mssql.py . 
 noone removed anything.

 On Thursday, May 7, 2015 at 3:41:28 PM UTC+2, Carl Petersen wrote:

 Hello All,

 Working with the latest versions of web2py and it seems that my sql 
 server connections are breaking.  I noticed that a fairly large section of 
 code related to MSSQLAdapter in gluon/dal.py has been taken out.  Should I 
 be approaching sql server connections differently now.  I was previously 
 using mssql3.

 Thanks,

 Carl 



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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: Show tables

2015-05-07 Thread Kevin Capuchino
Thanks for your answer. But I tried that. I need create a subquery of many
tables and show it where the user can edit or delete. I have understood
that SQLFORM grid only accepts tables no rows, is it true?

2015-05-06 17:00 GMT-05:00 黄祥 steve.van.chris...@gmail.com:

 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.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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-07 Thread Richard Vézina
Anthony, do you mean that the set can be define before ipaddress table get
defines?

On Thu, May 7, 2015 at 10:13 AM, Anthony abasta...@gmail.com wrote:

 On Wednesday, May 6, 2015 at 10:52:05 AM UTC-4, Richard wrote:

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


 When you define the set doesn't matter, as no records are actually pulled
 until a select is done.

 Anthony

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


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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-07 Thread Ron Chatterjee
Thank you Alan and Massimo and others. I didn't realize mongodb adaptor 
support reference field. My bad.

Thanks for all the help guys.


On Thursday, May 7, 2015 at 9:59:58 AM UTC-4, Alan Etkin wrote:

 I did not check the django app code but if you want to handle embedded 
 json objects you should use table definitions with a json field.

 Something like
 db.define_table(mytable, Field(embeddedobject, json) # db is a 
 mongodb connection (DAL instance)




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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] from desktop to web2py

2015-05-07 Thread goome
Hello
I am porting a desktop script to web by means of web2py.
The desktop script gets in input some file, process them,make some stuff to 
sqlitedb, and give as output other xls file.
I have already done similar porting for similar script, but the problem now 
is the in the desktop script after aquiring the input file and beginning to 
process them,in order  to continue the script asked (raw_input) to select a 
data.
Now in the controller/default.py i have a form (sqlform.factory), i wrote 
the first part of file input processing, but now i should ask for data 
choice (the data to choice from come from processing the file in input). If 
i redirect to another view, i suppose i will lose the (in memory) sqlite 
stuf...
Any suggestion to face with it? 

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


[web2py] Postgresql problems with 2 tabs

2015-05-07 Thread Gael Princivalle
Hello all.

I've moved a db from sqlite to postgresql, but I've got a strange problem.
With only one tab, ok.
If I have two tabs with the same application, it seems that data's are 
mixed.
For example in tab 1 I have a grid, in tab 2 a page.
When I save from tab 1 grid I see some data's from tab 2.

Another example, if I open 3 tabs with the same grid for modifying 3 
different records, and I save all records, data's of these 3 records will 
be mixed, not in the fields, but when I use these records in the 
application.

Here is my DAL connection:
db = DAL('postgres://user:pass@localhost:5432/postg_myapp', 
check_reserved=['all'], pool_size=1, entity_quoting=True, bigint_id=True)

Someone's know why?

Thanks, regards.



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


[web2py] Re: MongoDB

2015-05-07 Thread Paolo Valleri
You should use pymongo 3.0

On Wednesday, May 6, 2015 at 2:38:56 PM UTC+2, José Borba wrote:

 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 
 http://localhost:8000/admin/default/edit/rastreamento/models/db.py, line 
 12, in module
 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.