[web2py] web2py uwsgi

2014-03-02 Thread xaver
Hi,

I'm on os x 10.6.8 machine and I'm trying to run web2py with uwsgi.
I'm following the tutorial on 
http://uwsgi-docs.readthedocs.org/en/latest/WSGIquickstart.html.
Downloaded and compiled uwsgi.
when I run uwsgi  with the ini file I'm not able to connect to the admin 
interface.
In the browser I give https://localhost:9090/admin/default/index

If I run ./uwsgi --http :9090 --wsgi-file 
/Users/xaver/web2py/web2py/src/wsgihandler.py  --master --process 4 
--threads 2 --stats 127.0.0.1:9191 
it generate an error ticket which last lines are:
S'Traceback (most recent call last):\n  File 
/Users/xaver/web2py/web2py/src/gluon/restricted.py, line 217, in 
restricted\nexec ccode in environment\n  File 
/Users/saverioscavelli/web2py/web2py/src/applications/admin/models/access.py, 
line 29, in module\nport = int(request.env.server_port or 
0)\nValueError: invalid literal for int() with base 10: 
\'9090,foobar.crt,foobar.key\'\n'

Another problem I'm having is with the virtualenv. In the above cited 
tutorial it says that is enough to simple make an entry in the iniffile
eg. virtualenv=/path/to/the/virtualenv and uwsgi will find all the needed 
stuff, but that doesn't work for me:

uWSGI http bound on :9090,foobar.crt,foobar.key fd 4
uwsgi socket 0 bound to TCP address 127.0.0.1:56782 (port auto-assigned) fd 
3
Python version: 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)  [GCC 4.2.1 
(Apple Inc. build 5646)]
Set PythonHome to /Users/xaver/web2py/web2py/
'import site' failed; use -v for traceback


this is the output after running make:
pcre = True
kernel = Darwin
malloc = libc
execinfo = False
ifaddrs = True
ssl = True
zlib = True
locking = osx_spinlock
plugin_dir = .
timer = kqueue
yaml = embedded
json = False
filemonitor = kqueue
routing = True
debug = False
capabilities = False
xml = libxml2
event = kqueue

How you can see ssl is compiled with.

and this is my uwsgi ini file:

[uwsgi]
http = :9090,foobar.crt,foobar.key
chdir = /Users/xaver/web2py/web2py/src/
module = wsgihandler
master = true
processes = 8
enable-threads = true

any ideas?

thks.

xaver

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


Re: [web2py] web2py uwsgi

2014-03-02 Thread Roberto De Ioris

 Hi,

 I'm on os x 10.6.8 machine and I'm trying to run web2py with uwsgi.
 I'm following the tutorial on
 http://uwsgi-docs.readthedocs.org/en/latest/WSGIquickstart.html.
 Downloaded and compiled uwsgi.
 when I run uwsgi  with the ini file I'm not able to connect to the admin
 interface.
 In the browser I give https://localhost:9090/admin/default/index

 If I run ./uwsgi --http :9090 --wsgi-file
 /Users/xaver/web2py/web2py/src/wsgihandler.py  --master --process 4
 --threads 2 --stats 127.0.0.1:9191
 it generate an error ticket which last lines are:
 S'Traceback (most recent call last):\n  File
 /Users/xaver/web2py/web2py/src/gluon/restricted.py, line 217, in
 restricted\nexec ccode in environment\n  File
 /Users/saverioscavelli/web2py/web2py/src/applications/admin/models/access.py,
 line 29, in module\nport = int(request.env.server_port or
 0)\nValueError: invalid literal for int() with base 10:
 \'9090,foobar.crt,foobar.key\'\n'

 Another problem I'm having is with the virtualenv. In the above cited
 tutorial it says that is enough to simple make an entry in the iniffile
 eg. virtualenv=/path/to/the/virtualenv and uwsgi will find all the needed
 stuff, but that doesn't work for me:

 uWSGI http bound on :9090,foobar.crt,foobar.key fd 4
 uwsgi socket 0 bound to TCP address 127.0.0.1:56782 (port auto-assigned)
 fd
 3
 Python version: 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)  [GCC 4.2.1
 (Apple Inc. build 5646)]
 Set PythonHome to /Users/xaver/web2py/web2py/
 'import site' failed; use -v for traceback


 this is the output after running make:
 pcre = True
 kernel = Darwin
 malloc = libc
 execinfo = False
 ifaddrs = True
 ssl = True
 zlib = True
 locking = osx_spinlock
 plugin_dir = .
 timer = kqueue
 yaml = embedded
 json = False
 filemonitor = kqueue
 routing = True
 debug = False
 capabilities = False
 xml = libxml2
 event = kqueue

 How you can see ssl is compiled with.

 and this is my uwsgi ini file:

 [uwsgi]
 http = :9090,foobar.crt,foobar.key

it is https not http. certificates on plain http have no meaning




-- 
Roberto De Ioris
http://unbit.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/groups/opt_out.


Re: [web2py] web2py uwsgi

2014-03-02 Thread xaver


On Sunday, March 2, 2014 1:58:31 PM UTC+1, Roberto De Ioris wrote:


  Hi, 
  
  I'm on os x 10.6.8 machine and I'm trying to run web2py with uwsgi. 
  I'm following the tutorial on 
  http://uwsgi-docs.readthedocs.org/en/latest/WSGIquickstart.html. 
  Downloaded and compiled uwsgi. 
  when I run uwsgi  with the ini file I'm not able to connect to the admin 
  interface. 
  In the browser I give https://localhost:9090/admin/default/index 
  
  If I run ./uwsgi --http :9090 --wsgi-file 
  /Users/xaver/web2py/web2py/src/wsgihandler.py  --master --process 4 
  --threads 2 --stats 127.0.0.1:9191 
  it generate an error ticket which last lines are: 
  S'Traceback (most recent call last):\n  File 
  /Users/xaver/web2py/web2py/src/gluon/restricted.py, line 217, in 
  restricted\nexec ccode in environment\n  File 
  
 /Users/saverioscavelli/web2py/web2py/src/applications/admin/models/access.py,
  

  line 29, in module\nport = int(request.env.server_port or 
  0)\nValueError: invalid literal for int() with base 10: 
  \'9090,foobar.crt,foobar.key\'\n' 
  
  Another problem I'm having is with the virtualenv. In the above cited 
  tutorial it says that is enough to simple make an entry in the iniffile 
  eg. virtualenv=/path/to/the/virtualenv and uwsgi will find all the 
 needed 
  stuff, but that doesn't work for me: 
  
  uWSGI http bound on :9090,foobar.crt,foobar.key fd 4 
  uwsgi socket 0 bound to TCP address 127.0.0.1:56782 (port 
 auto-assigned) 
  fd 
  3 
  Python version: 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)  [GCC 4.2.1 
  (Apple Inc. build 5646)] 
  Set PythonHome to /Users/xaver/web2py/web2py/ 
  'import site' failed; use -v for traceback 
  
  
  this is the output after running make: 
  pcre = True 
  kernel = Darwin 
  malloc = libc 
  execinfo = False 
  ifaddrs = True 
  ssl = True 
  zlib = True 
  locking = osx_spinlock 
  plugin_dir = . 
  timer = kqueue 
  yaml = embedded 
  json = False 
  filemonitor = kqueue 
  routing = True 
  debug = False 
  capabilities = False 
  xml = libxml2 
  event = kqueue 
  
  How you can see ssl is compiled with. 
  
  and this is my uwsgi ini file: 
  
  [uwsgi] 
  http = :9090,foobar.crt,foobar.key 

 it is https not http. certificates on plain http have no meaning 

 Hi,


thks. for the answer. But please be a bit more verbose.
Not matter how I call it: over http or https I can't acces the admin 
interface of web2py
mybe the problem lays to the web2py security restriction.
Tkhs.

xaver  



 -- 
 Roberto De Ioris 
 http://unbit.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/groups/opt_out.


Re: [web2py] web2py uwsgi

2014-03-02 Thread Roberto De Ioris



 On Sunday, March 2, 2014 1:58:31 PM UTC+1, Roberto De Ioris wrote:


  Hi,
 
  I'm on os x 10.6.8 machine and I'm trying to run web2py with uwsgi.
  I'm following the tutorial on
  http://uwsgi-docs.readthedocs.org/en/latest/WSGIquickstart.html.
  Downloaded and compiled uwsgi.
  when I run uwsgi  with the ini file I'm not able to connect to the
 admin
  interface.
  In the browser I give https://localhost:9090/admin/default/index
 
  If I run ./uwsgi --http :9090 --wsgi-file
  /Users/xaver/web2py/web2py/src/wsgihandler.py  --master --process 4
  --threads 2 --stats 127.0.0.1:9191
  it generate an error ticket which last lines are:
  S'Traceback (most recent call last):\n  File
  /Users/xaver/web2py/web2py/src/gluon/restricted.py, line 217, in
  restricted\nexec ccode in environment\n  File
 
 /Users/saverioscavelli/web2py/web2py/src/applications/admin/models/access.py,

  line 29, in module\nport = int(request.env.server_port or
  0)\nValueError: invalid literal for int() with base 10:
  \'9090,foobar.crt,foobar.key\'\n'
 
  Another problem I'm having is with the virtualenv. In the above cited
  tutorial it says that is enough to simple make an entry in the
 iniffile
  eg. virtualenv=/path/to/the/virtualenv and uwsgi will find all the
 needed
  stuff, but that doesn't work for me:
 
  uWSGI http bound on :9090,foobar.crt,foobar.key fd 4
  uwsgi socket 0 bound to TCP address 127.0.0.1:56782 (port
 auto-assigned)
  fd
  3
  Python version: 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)  [GCC 4.2.1
  (Apple Inc. build 5646)]
  Set PythonHome to /Users/xaver/web2py/web2py/
  'import site' failed; use -v for traceback
 
 
  this is the output after running make:
  pcre = True
  kernel = Darwin
  malloc = libc
  execinfo = False
  ifaddrs = True
  ssl = True
  zlib = True
  locking = osx_spinlock
  plugin_dir = .
  timer = kqueue
  yaml = embedded
  json = False
  filemonitor = kqueue
  routing = True
  debug = False
  capabilities = False
  xml = libxml2
  event = kqueue
 
  How you can see ssl is compiled with.
 
  and this is my uwsgi ini file:
 
  [uwsgi]
  http = :9090,foobar.crt,foobar.key

 it is https not http. certificates on plain http have no meaning

 Hi,


 thks. for the answer. But please be a bit more verbose.
 Not matter how I call it: over http or https I can't acces the admin
 interface of web2py
 mybe the problem lays to the web2py security restriction.
 Tkhs.



I was referring to the uWSGI option:

NOT http = :9090,foobar.crt,foobar.key

BUT https = :9090,foobar.crt,foobar.key

http = does not take certificates as parameter so your SERVER_PORT will
be mapped to the string 9090,foobar.crt,foobar.key that is the cause of
the first reported exception

-- 
Roberto De Ioris
http://unbit.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/groups/opt_out.


[web2py] list:reference does not apply notnull=True

2014-03-02 Thread André Kablu
I am using version 2.9.1 beta

When creating a db, if I use this:

 Field('product_ids',   'list:reference product')

Does not force user to fill the field (not null).

Even if I put  notnull=True, the user can bypass the field and left it 
blank.


Any ideas?

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


[web2py] Re: list:reference does not apply notnull=True

2014-03-02 Thread André Kablu
just found the answer

multiple=(1,x)

anyway would be good if the notnull param works
 


Em domingo, 2 de março de 2014 16h34min35s UTC-3, André Kablu escreveu:

 I am using version 2.9.1 beta

 When creating a db, if I use this:

  Field('product_ids',   'list:reference product')

 Does not force user to fill the field (not null).

 Even if I put  notnull=True, the user can bypass the field and left it 
 blank.


 Any ideas?


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


[web2py] Re: SQLFORM.grid to update page

2014-03-02 Thread horridohobbyist
Yes, REST is definitely simpler. I'm not too familiar with JavaScript.

Let me explain what I'm trying to do...

I have two SQLFORM.grids on the same page. The user clicks on one row of 
one grid to add that row to the other grid. A simple enough application 
pattern.

Just like when you click on delete to delete a row from a grid and the 
grid automatically updates on the page, I want something similar to occur 
here.

Now, this works fine as far as it goes using links and REST. However, if 
the first grid has pagination and you're on, say, the third page, I'd like 
to preserve my place (ie, stay on page 3) when the page is updated. It's 
not a big deal, I guess. The user will have to manually go back to where he 
was before.


On Sunday, 2 March 2014 01:41:31 UTC-5, Tim Richardson wrote:

 I'm probably not following you, but if you want the server to do something 
 resulting in new content on the page, you either instigate a new request 
 via a URL (which I think is known as the REST method), or use AJAX to 
 fetch data from the server (and then use javascript to update part of the 
 page). 
 the links method that you have above is a REST approach. It has to 
 create a request and a page reload, that's the way it works. Using AJAX is 
 easy with web2py, see the chapter on AJAX and perhaps the following chapter 
 on components. 
 In this case the action on your link can not be a URL since this makes a 
 request  page load. You would execute javascript instead.
 REST is simpler I think.  AJAX is a smoother user experience (there is no 
 page reload, for example). 




 On Sunday, 2 March 2014 03:34:41 UTC+11, horridohobbyist wrote:

 Okay, then, I see another issue...

 Right now, I'm trying to execute the function by using a link:

 links=[lambda row: A('Add',_href=URL('add',args=[db.videos,row.id
 ,user_id]))],

 But this means a new request in the Add function. I really should execute 
 a function *in-place* on the current webpage. How do I do that?

 Thanks.


 On Saturday, 1 March 2014 08:30:33 UTC-5, Anthony wrote:

 Notice in Tim's example, vars is an argument of URL().

 On Saturday, March 1, 2014 7:40:36 AM UTC-5, horridohobbyist wrote:

 type 'exceptions.TypeError' redirect() got an unexpected keyword 
 argument 'vars'


 On Friday, 28 February 2014 18:34:54 UTC-5, Tim Richardson wrote:

 In my slice on inline-editable grid (
 http://www.web2pyslices.com/slice/show/1928/basic-inline-editing-in-sqlformgrid-no-plugin-no-javascript
 )
 I do this to reload
 redirect(URL('default','editable_grid',vars=request._get_vars)),
  ) #preserving _get_vars means user goes back to same grid page, same 
 sort options etc



 On Saturday, 1 March 2014 04:28:59 UTC+11, horridohobbyist wrote:

 I have a SQLFORM.grid and I would like to add a link or function to 
 each row that will do something and immediately refresh/update the 
 webpage. 
 Is this possible?

 Thanks.



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


[web2py] Re: SQLFORM.grid to update page

2014-03-02 Thread Tim Richardson
I think there's a warning in the book against two grids on the same page. 
I've never tried it due to the warning, but state of the grid is maintained 
via data passed back in the request. I think the grid code assumes that any 
grid state data passed back applies to it, so two grids may both assume 
they are the target of state information actually sourced from only one 
grid when it POSTs back updated state. Likely to be very confusing.
Using components (LOAD) should work around that. 

Your application platform still needs to address the problem of 
communicating with the server. 
You either round trip with REST, which means page reloads, or you use 
javascript to get part of the page to reload (e.g. LOAD, see chapter on 
components, it's pretty clever) or you can use full AJAX. Using LOAD may 
mean a bit of javascript, mainly so that your LINK button requests the 
LOADed component to reload. It's a common use-case in web2py and you'll 
easily get help here. I think the book documentation is reasonably good.

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


[web2py] Re: Import error for guppy

2014-03-02 Thread Joe Barnhart
I'm getting this same error when I try to use guppy to see the cache 
storage using the built-in cache page of the web2py admin interface.  I'm 
using a Mac and I saw a ton of warnings about int vs. long precision loss 
when I used pip to install guppy.  Dunno if that makes a difference, 
however.  I am able to import guppy manually using import guppy but I 
haven't played with it other than that.

-- Joe

On Thursday, February 20, 2014 8:01:05 PM UTC-8, David Phillips wrote:

 My app uses web2py as a background task (as described in Ch. 4 of the 
 web2py docs).  I have a slow memory leak in the background task. I'm trying 
 to run guppy periodically to find it but I am getting a error when I try to 
 use it. 

 The relevant part of my code looks like this:

 import guppy
 heapy = guppy.hpy()
 while True:
  ...
 logging.info (%s % heapy.heap())


 When the last statement executes, I get an ImportError exception. The end 
 of the stack trace looks like this:

   File /Users/davidp/dev/python/ssk/gluon/custom_import.py, line 81, in 
 custom_importer

 raise ImportError, 'Cannot import module %s' % str(e)

 ImportError: Cannot import module 'guppy'


 This code executes fine in the interpreter so I'm guessing the problem has 
 to do with web2py's import mechanism.

 Has anyone else been successful using guppy/heapy with web2py? I see that 
 this isn't the first time this issue has come up but I don't see any 
 mention of a solution.

 Any help would be gratefully received.


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


[web2py] web2py don't start

2014-03-02 Thread LB
Hello everybody,
just extracted, but launching web2py.exe or web2py_noconsole.exe I always 
got this error message:  Impossibile trovare il punto di ingresso wscpy_s 
della procedura nella libreria di collegamento dinamico msvcrt.dll  (that 
is like: can't find access point wscpy_s in msvcrt.dll).
I checked my system (ms-windows xp sp3) and msvcrt.dll is present, and I 
also make a copy in the web2py folder, with no result.
I have on python 2.7 and a python(x,y) release.
Any advice?

Thanks,

LB

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


[web2py] Translating database fields on the remote server

2014-03-02 Thread Ernest Galbrun
Dear web2py users,

I would really appreciate some help with my issue here. Please consider 
that I am a rookie with regard to web development...

Here is my problem : I have a web2py application deployed online with 
google app engine. I use translation utilities of web2py. I would like to 
be able to translate database fields that are added online. But I don't 
have access to the translation file online, I only have access to the local 
one whiche does not have entries for the new database fields!

Do you have an idea how I could do that?

Thank you,
Ernest.

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


[web2py] Re: Passing a Variable into a Query

2014-03-02 Thread Travis May
It worked Oh my sweet Jesus it worked  

I have scoured the book, and looked at dozens of posts but have yet to come 
across passing a variable into a query.  I have been parsing the data that 
has been coming from the database to isolate the data I wanted instead of 
all of the junk that comes with the row.  Thank you so much!!!

Here's what you have done for me.  I did have this:

def db_query(db_name, db_field, length):
a = '(db.' + db_name + '.Financial_Institution==auth.user.id)(db.' + 
db_name + '.Completed==1)'
query = eval(a)
b = 'db(query).select(' + db_field + ')'
answer = eval(b)
answer = str(answer[0])
ending = (len(answer)) - 4
answer = answer[length:ending]
return answer

This worked, but it was all wrong in my approach.  Now, I have this!

def db_query(db_name, db_field, length):
query = (db[db_name].Financial_Institution == auth.user.id)  
(db[db_name].Completed == 1)
return db(query).select(db[db_name][db_field]).first()[db_field]

Oh my goodness, I could kiss you!

Thanks,
Travis May

On Saturday, March 1, 2014 7:29:17 AM UTC-6, Anthony wrote:

 Assuming by db_name you really mean the table name, maybe you want 
 something like this:

 def db_query(tablename, fieldname):
 query = (db[tablename].Financial_Institution == auth.user.id)  (db[
 tablename].Completed == 1)
 return db(query).select(db[tablename][fieldname]).first()[fieldname]

 Do you really have multiple tables with Finacial_Institution and Completed 
 fields, and do you really need to do the same query on these tables, except 
 for returning different field values? Otherwise, it's not clear how useful 
 this function is?

 Note, if you have a DAL table or field name in a variable, you can use 
 db[tablename][fieldname] and row[fieldname] syntax rather than 
 db.tablename.fieldname and row.fieldname (the latter syntax using dot 
 separators represents attribute retrieval and requires the literal 
 attribute names, not variables holding the names).

 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/groups/opt_out.


Re: [web2py] pg8000 driver that comes with web2py 2.8.2 is not supporting JSON field type?

2014-03-02 Thread Tony Locke
Hi, I'm a contributor to pg8000 and if there are any changes you need to 
get pg8000 working with web2py, let me know. Looking at the absolute import 
problem, PEP8 seems to think absolute imports are the way to go:

http://legacy.python.org/dev/peps/pep-0008/

(search for 'relative' in the text) but I'm open to persuasion :-)

Cheers,

Tony.

On Saturday, 1 March 2014 11:18:43 UTC, Joe Barnhart wrote:

 Hi Mariano --

 I'd like to encourage you to keep making pg8000 a viable alternative for 
 web2py.  I started with it but had to change to psycopg2 because of some 
 issues that postgres handled better under the psy driver.  But I think pypy 
 could be the future of python and it won't support a driver like psycopg2 
 -- but it could support pg8000 since it is all python.

 It's just good to have an alternative because no driver does it all.

 -- Joe B.

 On Tuesday, February 25, 2014 6:55:17 PM UTC-8, Mariano Reingart wrote:

 Hi Horst:

 Sadly there have been a lot of changes in pg8000, so it is not backward 
 compatible with the current custom version in web2py. 

 First, you need to delete the pg8000 folder in contrib, and put the new 
 pg8000 folder (the one with __init__.py) directly in the web2py top level 
 folder (at the same level as gluon).
 Note that the new pg8000 uses absolute imports that will not work if 
 pg8000 is in contrib folder (or it should be added to the PYTHONPATH)

 Second, you need to apply the attached patch to gluon/dal.py to:
  * change the import (and add a missing __version__ attribute)
  * change connection to pass individual parameters (dsn string is not 
 supported anymore)
  * change after_connection set_client_encoding to execute SQL
  * change server_version to _server_version

 I'll propose (again) to the pg8000 group the changes I've introduced for 
 web2py, so the latest version could be used as a direct drop-in replacement 
 for psycopg2
 IIRC, at some stage the author gave me commit access, but I didn't have 
 time to pull my changes and missed some discussions about the project 
 internals.

 Best regards

  
 Mariano Reingart
 http://www.sistemasagiles.com.ar
 http://reingart.blogspot.com


 On Tue, Feb 25, 2014 at 5:46 PM, Horst Horst spamf...@gmail.com wrote:

 I've tried the latest pg8000 as a drop-in replacement, but it seems 
 web2py can't import it:

 type 'exceptions.RuntimeError' Failure to connect, tried 5 times: 
 Traceback (most recent call last): File 
 /Users/sfx/dev/mdb/web2py.app/Contents/Resources/gluon/dal.py, line 7766, 
 in __init__ File 
 /Users/sfx/dev/mdb/web2py.app/Contents/Resources/gluon/dal.py, line 2756, 
 in __init__ File 
 /Users/sfx/dev/mdb/web2py.app/Contents/Resources/gluon/dal.py, line 795, 
 in find_driver RuntimeError: no driver available ('psycopg2', 'pg8000')

 I didn't step through it in the debugger, but the module's __init__.pyc 
 got compiled, so I know web2py attempted an import.

 The latest pg8000/__init__.py contains a section which matches the 
 former interface

 # For compatibility with 1.8
 import pg8000 as dbapi
 DBAPI = dbapi
 pg8000_dbapi = DBAPI

 so I'd guess it's a minor problem, nonetheless I'm lost at this point.


 On Monday, February 24, 2014 9:32:05 PM UTC+1, Mariano Reingart wrote:

 You could try to update pg8000 from the official:

 https://github.com/mfenniak/pg8000

 Let us know if that works, so we could update the one distributed with 
 web2py
 The one currently distributed in contrib is an older version with 
 custom patches (as it was not being mantained at the time it was included 
 to web2py), but now the official site has updates that could help you in 
 this case.

 Best regards



 Mariano Reingart
 http://www.sistemasagiles.com.ar
 http://reingart.blogspot.com


 On Mon, Feb 24, 2014 at 10:18 AM, Horst Horst spamf...@gmail.comwrote:

  I'm getting a:

   class 'gluon.contrib.pg8000.errors.NotSupportedError' type oid 
 114 not mapped to py type

 I'm wondering what's the best thing to do now? Currently I'm 
 considering:

 - using TEXT instead. But my former JSON strings are then enclosed by 
 | which leads to new errors

 - updating gp8000 (there seems to be a newer version, but the version 
 numbering is confusing)

 - using psycopg2. How can I install this into an Mac OS standalone 
 version of web2py?

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

 For more options, visit https://groups.google.com/groups/opt_out.


  -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You 

[web2py] Re: DAL ignoring accents

2014-03-02 Thread Massimo Di Pierro
Not really. you have to create a computed filed that discards accents and 
search the computed field instead of the original field.


On Saturday, 1 March 2014 04:34:33 UTC-6, Wonton wrote:

 Hello!

 Is there any way to do searches with DAL (sqlite database) ignoring 
 accents?

 Thank you very much in advance!

 Wonton.


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


Re: [web2py] pg8000 driver that comes with web2py 2.8.2 is not supporting JSON field type?

2014-03-02 Thread Massimo Di Pierro
I think you are right. We should include contrib to the sys.path. You 
should not have to change pg8000 for this.

On Sunday, 2 March 2014 12:24:58 UTC-6, Tony Locke wrote:

 Hi, I'm a contributor to pg8000 and if there are any changes you need to 
 get pg8000 working with web2py, let me know. Looking at the absolute import 
 problem, PEP8 seems to think absolute imports are the way to go:

 http://legacy.python.org/dev/peps/pep-0008/

 (search for 'relative' in the text) but I'm open to persuasion :-)

 Cheers,

 Tony.

 On Saturday, 1 March 2014 11:18:43 UTC, Joe Barnhart wrote:

 Hi Mariano --

 I'd like to encourage you to keep making pg8000 a viable alternative for 
 web2py.  I started with it but had to change to psycopg2 because of some 
 issues that postgres handled better under the psy driver.  But I think pypy 
 could be the future of python and it won't support a driver like psycopg2 
 -- but it could support pg8000 since it is all python.

 It's just good to have an alternative because no driver does it all.

 -- Joe B.

 On Tuesday, February 25, 2014 6:55:17 PM UTC-8, Mariano Reingart wrote:

 Hi Horst:

 Sadly there have been a lot of changes in pg8000, so it is not backward 
 compatible with the current custom version in web2py. 

 First, you need to delete the pg8000 folder in contrib, and put the new 
 pg8000 folder (the one with __init__.py) directly in the web2py top level 
 folder (at the same level as gluon).
 Note that the new pg8000 uses absolute imports that will not work if 
 pg8000 is in contrib folder (or it should be added to the PYTHONPATH)

 Second, you need to apply the attached patch to gluon/dal.py to:
  * change the import (and add a missing __version__ attribute)
  * change connection to pass individual parameters (dsn string is not 
 supported anymore)
  * change after_connection set_client_encoding to execute SQL
  * change server_version to _server_version

 I'll propose (again) to the pg8000 group the changes I've introduced for 
 web2py, so the latest version could be used as a direct drop-in replacement 
 for psycopg2
 IIRC, at some stage the author gave me commit access, but I didn't have 
 time to pull my changes and missed some discussions about the project 
 internals.

 Best regards

  
 Mariano Reingart
 http://www.sistemasagiles.com.ar
 http://reingart.blogspot.com


 On Tue, Feb 25, 2014 at 5:46 PM, Horst Horst spamf...@gmail.com wrote:

 I've tried the latest pg8000 as a drop-in replacement, but it seems 
 web2py can't import it:

 type 'exceptions.RuntimeError' Failure to connect, tried 5 times: 
 Traceback (most recent call last): File 
 /Users/sfx/dev/mdb/web2py.app/Contents/Resources/gluon/dal.py, line 
 7766, 
 in __init__ File 
 /Users/sfx/dev/mdb/web2py.app/Contents/Resources/gluon/dal.py, line 
 2756, 
 in __init__ File 
 /Users/sfx/dev/mdb/web2py.app/Contents/Resources/gluon/dal.py, line 795, 
 in find_driver RuntimeError: no driver available ('psycopg2', 'pg8000')

 I didn't step through it in the debugger, but the module's __init__.pyc 
 got compiled, so I know web2py attempted an import.

 The latest pg8000/__init__.py contains a section which matches the 
 former interface

 # For compatibility with 1.8
 import pg8000 as dbapi
 DBAPI = dbapi
 pg8000_dbapi = DBAPI

 so I'd guess it's a minor problem, nonetheless I'm lost at this point.


 On Monday, February 24, 2014 9:32:05 PM UTC+1, Mariano Reingart wrote:

 You could try to update pg8000 from the official:

 https://github.com/mfenniak/pg8000

 Let us know if that works, so we could update the one distributed with 
 web2py
 The one currently distributed in contrib is an older version with 
 custom patches (as it was not being mantained at the time it was included 
 to web2py), but now the official site has updates that could help you in 
 this case.

 Best regards



 Mariano Reingart
 http://www.sistemasagiles.com.ar
 http://reingart.blogspot.com


 On Mon, Feb 24, 2014 at 10:18 AM, Horst Horst spamf...@gmail.comwrote:

  I'm getting a:

   class 'gluon.contrib.pg8000.errors.NotSupportedError' type oid 
 114 not mapped to py type

 I'm wondering what's the best thing to do now? Currently I'm 
 considering:

 - using TEXT instead. But my former JSON strings are then enclosed by 
 | which leads to new errors

 - updating gp8000 (there seems to be a newer version, but the version 
 numbering is confusing)

 - using psycopg2. How can I install this into an Mac OS standalone 
 version of web2py?

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

 For more options, visit https://groups.google.com/groups/opt_out.


  -- 
 Resources:
 - 

Re: [web2py] pg8000 driver that comes with web2py 2.8.2 is not supporting JSON field type?

2014-03-02 Thread Niphlod
as long as you can use it without installing it in sys.path, then it's 
fine. If not, it can't be shipped with web2py, just supported as a module.
I don't like packages that needs a complete install to work. It's true that 
we have venvs for quite some time now, but a module with less than 10 files 
can accomodate for relative imports quite finely without impairing the 
code-reader in everyone of us :P

BTW, search for explicit relative imports in that doc :-P

On Sunday, March 2, 2014 7:24:58 PM UTC+1, Tony Locke wrote:

 Hi, I'm a contributor to pg8000 and if there are any changes you need to 
 get pg8000 working with web2py, let me know. Looking at the absolute import 
 problem, PEP8 seems to think absolute imports are the way to go:

 http://legacy.python.org/dev/peps/pep-0008/http://www.google.com/url?q=http%3A%2F%2Flegacy.python.org%2Fdev%2Fpeps%2Fpep-0008%2Fsa=Dsntz=1usg=AFQjCNG8T4Krvic_V8TCmT4iog4T5e4pyg

 (search for 'relative' in the text) but I'm open to persuasion :-)

 Cheers,

 Tony.

 On Saturday, 1 March 2014 11:18:43 UTC, Joe Barnhart wrote:

 Hi Mariano --

 I'd like to encourage you to keep making pg8000 a viable alternative for 
 web2py.  I started with it but had to change to psycopg2 because of some 
 issues that postgres handled better under the psy driver.  But I think pypy 
 could be the future of python and it won't support a driver like psycopg2 
 -- but it could support pg8000 since it is all python.

 It's just good to have an alternative because no driver does it all.

 -- Joe B.

 On Tuesday, February 25, 2014 6:55:17 PM UTC-8, Mariano Reingart wrote:

 Hi Horst:

 Sadly there have been a lot of changes in pg8000, so it is not backward 
 compatible with the current custom version in web2py. 

 First, you need to delete the pg8000 folder in contrib, and put the new 
 pg8000 folder (the one with __init__.py) directly in the web2py top level 
 folder (at the same level as gluon).
 Note that the new pg8000 uses absolute imports that will not work if 
 pg8000 is in contrib folder (or it should be added to the PYTHONPATH)

 Second, you need to apply the attached patch to gluon/dal.py to:
  * change the import (and add a missing __version__ attribute)
  * change connection to pass individual parameters (dsn string is not 
 supported anymore)
  * change after_connection set_client_encoding to execute SQL
  * change server_version to _server_version

 I'll propose (again) to the pg8000 group the changes I've introduced for 
 web2py, so the latest version could be used as a direct drop-in replacement 
 for psycopg2
 IIRC, at some stage the author gave me commit access, but I didn't have 
 time to pull my changes and missed some discussions about the project 
 internals.

 Best regards

  
 Mariano Reingart
 http://www.sistemasagiles.com.ar
 http://reingart.blogspot.com


 On Tue, Feb 25, 2014 at 5:46 PM, Horst Horst spamf...@gmail.com wrote:

 I've tried the latest pg8000 as a drop-in replacement, but it seems 
 web2py can't import it:

 type 'exceptions.RuntimeError' Failure to connect, tried 5 times: 
 Traceback (most recent call last): File 
 /Users/sfx/dev/mdb/web2py.app/Contents/Resources/gluon/dal.py, line 
 7766, 
 in __init__ File 
 /Users/sfx/dev/mdb/web2py.app/Contents/Resources/gluon/dal.py, line 
 2756, 
 in __init__ File 
 /Users/sfx/dev/mdb/web2py.app/Contents/Resources/gluon/dal.py, line 795, 
 in find_driver RuntimeError: no driver available ('psycopg2', 'pg8000')

 I didn't step through it in the debugger, but the module's __init__.pyc 
 got compiled, so I know web2py attempted an import.

 The latest pg8000/__init__.py contains a section which matches the 
 former interface

 # For compatibility with 1.8
 import pg8000 as dbapi
 DBAPI = dbapi
 pg8000_dbapi = DBAPI

 so I'd guess it's a minor problem, nonetheless I'm lost at this point.


 On Monday, February 24, 2014 9:32:05 PM UTC+1, Mariano Reingart wrote:

 You could try to update pg8000 from the official:

 https://github.com/mfenniak/pg8000

 Let us know if that works, so we could update the one distributed with 
 web2py
 The one currently distributed in contrib is an older version with 
 custom patches (as it was not being mantained at the time it was included 
 to web2py), but now the official site has updates that could help you in 
 this case.

 Best regards



 Mariano Reingart
 http://www.sistemasagiles.com.ar
 http://reingart.blogspot.com


 On Mon, Feb 24, 2014 at 10:18 AM, Horst Horst spamf...@gmail.comwrote:

  I'm getting a:

   class 'gluon.contrib.pg8000.errors.NotSupportedError' type oid 
 114 not mapped to py type

 I'm wondering what's the best thing to do now? Currently I'm 
 considering:

 - using TEXT instead. But my former JSON strings are then enclosed by 
 | which leads to new errors

 - updating gp8000 (there seems to be a newer version, but the version 
 numbering is confusing)

 - using psycopg2. How can I install this into an Mac OS standalone 
 version of web2py?

  -- 
 Resources:
 - 

[web2py] Re: SQLFORM.grid to update page

2014-03-02 Thread Massimo Di Pierro
Two grids in the same page are definitively not allowed unless loaded via 
Ajax. That is because they use the URL to transfer grid parameters and if 
you have two it is not clear which one applies to.

On Sunday, 2 March 2014 14:45:37 UTC-6, Tim Richardson wrote:

 I think there's a warning in the book against two grids on the same page. 
 I've never tried it due to the warning, but state of the grid is maintained 
 via data passed back in the request. I think the grid code assumes that any 
 grid state data passed back applies to it, so two grids may both assume 
 they are the target of state information actually sourced from only one 
 grid when it POSTs back updated state. Likely to be very confusing.
 Using components (LOAD) should work around that. 

 Your application platform still needs to address the problem of 
 communicating with the server. 
 You either round trip with REST, which means page reloads, or you use 
 javascript to get part of the page to reload (e.g. LOAD, see chapter on 
 components, it's pretty clever) or you can use full AJAX. Using LOAD may 
 mean a bit of javascript, mainly so that your LINK button requests the 
 LOADed component to reload. It's a common use-case in web2py and you'll 
 easily get help here. I think the book documentation is reasonably good.



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


[web2py] web2py 2.9.2 is OUT

2014-03-02 Thread Massimo Di Pierro
web2py 2.9.2 is out! 

Changelog:

- jquery 1.11
- codemirror 3.21, thanks Paolo Valleri
- fixed a security issue with sessions in database
- fixed security issue with redirect after expired login, thanks André Kablu
- cleaner DAL and rname integration, thanks niphlod and Michele
- added mongodb and imap tests for dal, thanks Alan
- NoSQL dal tests, thanks Alan
- better docstrings, thanks Niphlod
- allow URL(...,language=...) with parametric router, thanks Jonathan
- allow non-expiration of gae-memcache, thanks crimsoncantab
- MARKMIN(...,_class='...'), thanks Luca
- better transliteration in building slugs
- autolink emails
- new Janrain API, thanks PeterQ2
- enable admin app for GAE (experimental), thanks Alan
- many bug fixes
- invalidate function in web2py.js, thanks Paolo
- DAL(...,adapter_args=dict(engine='MyISAM'))
- todolist panel in admin editor, thanks Paolo Valleri
- enable killing processed in windows, thanks Yair

Thanks to all those who have contributed!

Massimo

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


[web2py] Re: web2py don't start

2014-03-02 Thread 黄祥
just a suggestion, if you had python installed on your machine, why not use 
web2py source then?

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/groups/opt_out.


[web2py] Re: web2py don't start

2014-03-02 Thread Anthony
Note, the web2py.exe file does not use the Python installed on your system 
but instead includes its own Python interpreter. If you already have Python 
installed, you're probably better off just running web2py from source (it's 
just as easy -- just download and unzip the source package and run the 
web2py.py file).

Anthony

On Saturday, March 1, 2014 5:18:05 AM UTC-5, LB wrote:

 Hello everybody,
 just extracted, but launching web2py.exe or web2py_noconsole.exe I always 
 got this error message:  Impossibile trovare il punto di ingresso wscpy_s 
 della procedura nella libreria di collegamento dinamico msvcrt.dll  (that 
 is like: can't find access point wscpy_s in msvcrt.dll).
 I checked my system (ms-windows xp sp3) and msvcrt.dll is present, and I 
 also make a copy in the web2py folder, with no result.
 I have on python 2.7 and a python(x,y) release.
 Any advice?

 Thanks,

 LB


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


[web2py] Re: list:reference does not apply notnull=True

2014-03-02 Thread Anthony
Values in list:-type fields are stored delimited by | characters, so when 
you insert an empty list, || is what actually gets inserted in the 
database. Because notnull is enforced by the database, entering an empty 
list does not generate an error because || is a string and therefore not 
null. In any case, violation of notnull would result in your application 
returning a 500 server error, not a friendly message printed on the form, 
so the best way to validate the input is by using the multiple argument 
to the IS_IN_DB validator, as you have discovered.

Anthony

On Sunday, March 2, 2014 2:49:01 PM UTC-5, André Kablu wrote:

 just found the answer

 multiple=(1,x)

 anyway would be good if the notnull param works
  


 Em domingo, 2 de março de 2014 16h34min35s UTC-3, André Kablu escreveu:

 I am using version 2.9.1 beta

 When creating a db, if I use this:

  Field('product_ids',   'list:reference product')

 Does not force user to fill the field (not null).

 Even if I put  notnull=True, the user can bypass the field and left it 
 blank.


 Any ideas?



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


Re: [web2py] web2py 2.9.2 is OUT

2014-03-02 Thread Ovidio Marinho
Ops, Button Administrative interface ins welcome.w2p, not work!!!

button id=w2padmin-btn class=btn btn-primary btn-lg btn-block
i class=glyphicon glyphicon-cog/i {{=T(Administrative
Interface)}}/button

In the previous version is working well:

{{block right_sidebar}}
{{=A(T(Administrative Interface), _href=URL('admin','default','index'),
_class='btn',
 _style='margin-top: 1em;')}}


Missing Link??

 Ovidio Marinho Falcao Neto
  ITJP.NET.BR
 ovidio...@gmail.com
 itjp.net...@gmail.com
 Brasil



2014-03-02 21:31 GMT-03:00 Massimo Di Pierro massimo.dipie...@gmail.com:

 web2py 2.9.2 is out!

 Changelog:

 - jquery 1.11
 - codemirror 3.21, thanks Paolo Valleri
 - fixed a security issue with sessions in database
 - fixed security issue with redirect after expired login, thanks André
 Kablu
 - cleaner DAL and rname integration, thanks niphlod and Michele
 - added mongodb and imap tests for dal, thanks Alan
 - NoSQL dal tests, thanks Alan
 - better docstrings, thanks Niphlod
 - allow URL(...,language=...) with parametric router, thanks Jonathan
 - allow non-expiration of gae-memcache, thanks crimsoncantab
 - MARKMIN(...,_class='...'), thanks Luca
 - better transliteration in building slugs
 - autolink emails
 - new Janrain API, thanks PeterQ2
 - enable admin app for GAE (experimental), thanks Alan
 - many bug fixes
 - invalidate function in web2py.js, thanks Paolo
 - DAL(...,adapter_args=dict(engine='MyISAM'))
 - todolist panel in admin editor, thanks Paolo Valleri
 - enable killing processed in windows, thanks Yair

 Thanks to all those who have contributed!

 Massimo

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


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


[web2py] lazy table question

2014-03-02 Thread Tim Richardson
I have this code in plugin I want to use, and it gives an error when lazy 
tables = True (on trunk).
I've found a fix, but it feels wrong.
Question is really: how to force table definition for some tables when 
using lazy_tables?

Problem code:

 def define_tables(self, migrate=True, fake_migrate=False):
 
upload_name = self.settings.table_upload_name#this is 
'plugin_ckeditor_upload'

self.settings.table_upload = self.db.define_table(upload_name,
... #skip some rows
Field('upload', 'upload'),
*self.settings.extra_fields.get(upload_name, []),
migrate = migrate,
fake_migrate = fake_migrate,
format = '%(title)s'
)


then comes the line with the error:
self.settings.table_upload.upload.requires = [
IS_NOT_EMPTY(),
IS_LENGTH(maxsize=self.settings.file_length_max, minsize=self.
settings.file_length_min),
]

causing when lazy_tables=True

type 'exceptions.AttributeError' 'NoneType' object has no attribute 
'upload'

ok, so to trigger the definition of the table I tried:
a_table = self.db['plugin_ckeditor_upload']


but while this solves 
a_table.upload.requires = ... 

self.settings.table_upload is still None (which surprised me)

This works but it seems bad:
self.settings.table_upload = self.db['plugin_ckeditor_upload']

Now I have hard-coded the table name.




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