Re: [web2py] Re: Better language support

2011-05-20 Thread Pierre Thibault
2011/5/20 mart msenecal...@gmail.com

 not sure if this applies, but just in case...

 years ago (i think 12, so this may be outdated), i worked in a
 localization team, (although it was a purely windows shop where words
 like dll was all that anyone talked about). Anyways, we adopted a
 method for 1) re-using translations (from translation tool kits (aka.
 TTKs) 2) standardizing on commonly accepted strings (i.e. there aren't
 too many ways to translate a yes/no button ;))  3) the language
 specific string tables would grow over time and served the task very
 well considering... (we only had 4 or 5 languages ;) english, swedish,
 japanese, simplified chinese, and french (fr_ca was deemed unworthy at
 the time ;))

 anyways, the moral is, that all strings going to UI were ripped out of
 the code and replaced with IDs where the users language selection
 would force load the language specific satellite dll @ run time -
 was just a dll with the resource strings in it.

 perhaps adopting something similar (but no dll's ;) ) would be
 beneficial?

 Mart :)



Hi Mart,

Thank you for sharing this experience. I guess you had the professional
resources to do all the translations. If we use a common dictionary for
web2py, we need all the translations for the languages we support for all
the words before doing a new release. Do we have to resources to do that? I
have some doubts.
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] web2py messages being copied to other (spam) groups

2011-05-20 Thread Pierre Thibault
2011/5/20 Anthony abasta...@gmail.com

 It appears that messages to the web2py-users group are somehow being copied
 to various other groups, including
 https://groups.google.com/group/fameisfame/search?hl=engroup=fameisfameq=web2py,

 https://groups.google.com/group/fametest/search?hl=engroup=fametestq=web2py,
 and
 https://groups.google.com/group/somanyjobs/search?hl=engroup=somanyjobsq=web2py
 .

 Does anyone know what's going on or how that could be happening? Seems very
 odd.




I believe the Google Groups are corrupted. I had messages that the service
was not available now. I refresh and then the service is back.

Very odd indeed.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


[web2py] Re: Cubrid?

2011-05-20 Thread CUBRID RDBMS
Hi Massimo,

Our Python API developers have taken over testing web2py. However, they are 
taking a vacation from today until the end of this month. So they will not 
be available. Upon their arrival to work, they will provide their test 
results. Is that all right?

Moreover, I have just uploaded the new Python driver to SF.net which 
supports the latest changes of CUBRID 8.4.0. Please download it from 
http://www.cubrid.org/python_programming. The new driver API will be 
available by the end of this month when the developers will come back from 
vacation. Until then, you can start using the new driver.


[web2py] Re: Cubrid?

2011-05-20 Thread David Marko
Great to hear. Can you create a windows binary for python 2.7. web2py is not 
python 3.1 ready 

Thanks ...
David


[web2py] pythonanywhere

2011-05-20 Thread António Ramos
hello guys

do you know

http://www.resolversystems.com/

they have a spreadsheet with python as a scripting language.
Its awsome.
Please check it

also they have in beta test

http://www.pythonanywhere.com/

its python in the browser!


[web2py] Session ID

2011-05-20 Thread Thiago Abreu
how can I get the session id of a web2py app on Google App Engine?
to make of this?
or have to do differently?


[web2py] Getting started with appliances for web2py on GAE

2011-05-20 Thread Niklas Rosencrantz
Hi my web2py deployment is on app engine. I'm trying to add 
plug-ins/appliances using the admin area but all I get is an error message:
unable to install application APP_NAME
when trying to upload the package at 
https://my-app-deployment.appspot.com/admin/default/site
Am I uploading in the wrong place? It says the app I'm trying to upload is 
GAE compatible. Are all plug-ins / appliances GAE compatible?
Thank you
Niklas



[web2py] attribute content of meta tag viewport in layout.html (Welcome) should use comma separator

2011-05-20 Thread Nico de Groot
Hi all,

The meta tag viewport inside the template layout.html currently (and in 
trunk) uses semicolons to separate and trail the arguments in the 
content-attribute. Throws errors in Chrome (when inspecting). Easy fixed by 
using comma *and* by removing trailing separator. See 
http://stackoverflow.com/questions/125/viewport-tag-syntax Both the 
references in the comments inside layout.html agree. 

-   meta name=viewport content=width=device-width; initial-scale=1.0; 
maximum-scale=1.0;

+  meta name=viewport content=width=device-width, initial-scale=1.0, 
maximum-scale=1.0

Nico


[web2py] How to implement background processes elegantly..

2011-05-20 Thread Kimmo
Hi,

I am using web2py as a frontend and i have a single script
(myscript.py) doing all the extra calculation based on the uploaded
files (unzipping zip file contents to tables, deleting other info
etc.) This script contains four threads and now the problem is that
these threads are accessing the same DAL object-connection-cursor
simultaneously which understandable produces Commands out of sync
errors.

In web2py, model is executed everytime a controller function is called
and new DAL db object is created. Now if i could take this behaviour
and add it in my myscript.py in a way that i could get a new db
object for every thread i have, this problem i described above would
disappear. This suggestion might not even be possible to do, so my
main question is what would be from the design perspective and/or
practically the best way to solve this issue?


One possible(?) way is to launch four scripts instead of one (separate
every thread to its own script). This way every script gets its own
new db object. Problem is that i need these scripts
to communicate between them and easiest way would be to have them in a
single script.

Script is executed along web2py as guided in the manual: python
web2py.py -S app -M -N -R applications/app/private/myscript.py

Web2py: Version 1.95.1
DB: PostgreSQL 8.3 with psycopg 2.4.1 (threading level 2, ie. threads
can share a single db connection)


I'll gladly provide any additional information if needed!

Thanks in advance!


[web2py] Re: Error when going to localhost:8080 says global name 'GAEDecimalProperty' is not defined

2011-05-20 Thread Massimo Di Pierro
Please help m debug this. In gluon/dal.py there is this code:

try:
from new import classobj
from google.appengine.ext import db as gae
from google.appengine.api import namespace_manager, rdbms
from google.appengine.api.datastore_types import Key  ### needed
for belongs \
on
ID
from google.appengine.ext.db.polymodel import PolyModel

drivers.append('google')
...
except:
...


One of the imports fails for you. Can you please remove the
try:...except:... so we can get a traceback?


On May 19, 11:04 pm, Arbie Samong phek...@gmail.com wrote:
 Hi Massimo,

 I tried to use python2.5 and I still get the same output:
 python2.5 dev_appserver.py web2py/

 Thanks,
 Arbie

 On May 20, 11:44 am, Massimo Di Pierro massimo.dipie...@gmail.com
 wrote:







  appengine SDK requires python 2.5

  On May 19, 9:47 pm, Arbie Samong phek...@gmail.com wrote:

   Hello Massimo, thanks for the reply. I do:

   python2.6 dev_appserver.py web2py/

   and my web2py project is in that web2py/ folder.

   Thanks,
   ARbie

   On May 20, 1:53 am, Massimo Di Pierro massimo.dipie...@gmail.com
   wrote:

How are you starting web2py? Somehow it is not staring the google
libraies.

On May 19, 9:24 am, Arbie Samong phek...@gmail.com wrote:

 This is the error I get:

 ERROR    2011-05-19 14:07:16,175 restricted.py:145] Traceback (most
 recent call last):
   File .../gae/web2py/gluon/restricted.py, line 181, in restricted
     exec ccode in environment
   File .../gae/web2py/applications/resume/models/db.py, line 9, in
 module
     db = DAL('gae')                           # connect to Google
 BigTable
   File .../gae/web2py/gluon/dal.py, line 3720, in __init__
     raise RuntimeError, Failure to connect, tried 5 times:\n%s %
 error
 RuntimeError: Failure to connect, tried 5 times:
 global name 'GAEDecimalProperty' is not defined

 I made sure web2py and gae is updated. localhost:8000 works fine, but
 when I try it on the local gae in localhost:8080 the page loads from
 sometime and then the page says Internal error and the above
 stacktrace is what I see in the console.

 Thanks for any help.


[web2py] Re: Getting started with appliances for web2py on GAE

2011-05-20 Thread Massimo Di Pierro
Those I made should be but not tested on GAE. plugin_wiki was tested.

On May 20, 4:58 am, Niklas Rosencrantz nikla...@gmail.com wrote:
 Hi my web2py deployment is on app engine. I'm trying to add
 plug-ins/appliances using the admin area but all I get is an error message:
 unable to install application APP_NAME
 when trying to upload the package 
 athttps://my-app-deployment.appspot.com/admin/default/site
 Am I uploading in the wrong place? It says the app I'm trying to upload is
 GAE compatible. Are all plug-ins / appliances GAE compatible?
 Thank you
 Niklas


[web2py] Re: Cubrid?

2011-05-20 Thread Massimo Di Pierro
On May 20, 3:48 am, CUBRID RDBMS kadish...@gmail.com wrote:
 Hi Massimo,

 Our Python API developers have taken over testing web2py. However, they are
 taking a vacation from today until the end of this month. So they will not
 be available. Upon their arrival to work, they will provide their test
 results. Is that all right?

No hurry on my side.Thanks.

 Moreover, I have just uploaded the new Python driver to SF.net which
 supports the latest changes of CUBRID 8.4.0. Please download it 
 fromhttp://www.cubrid.org/python_programming. The new driver API will be
 available by the end of this month when the developers will come back from
 vacation. Until then, you can start using the new driver.


[web2py] Re: pythonanywhere

2011-05-20 Thread Massimo Di Pierro
Do you know you can can do it with web2py, right?

http://web2py.com/examples/spreadsheet

On May 20, 6:55 am, António Ramos ramstei...@gmail.com wrote:
 hello guys

 do you know

 http://www.resolversystems.com/

 they have a spreadsheet with python as a scripting language.
 Its awsome.
 Please check it

 also they have in beta test

 http://www.pythonanywhere.com/

 its python in the browser!


Re: [web2py] Re: pythonanywhere

2011-05-20 Thread Michele Comitini
To run python in the browser for real, not just a console:

https://bitbucket.org/pypy/lang-js/

Or maybe this (unbelievable!):
http://bellard.org/jslinux/
http://bellard.org/jslinux/tech.html

Of course stability and speed can be an issue! ;-)

mic

2011/5/20 Massimo Di Pierro massimo.dipie...@gmail.com:
 Do you know you can can do it with web2py, right?

 http://web2py.com/examples/spreadsheet

 On May 20, 6:55 am, António Ramos ramstei...@gmail.com wrote:
 hello guys

 do you know

 http://www.resolversystems.com/

 they have a spreadsheet with python as a scripting language.
 Its awsome.
 Please check it

 also they have in beta test

 http://www.pythonanywhere.com/

 its python in the browser!


[web2py] Re: How to implement background processes elegantly..

2011-05-20 Thread Ross Peoples
If I am reading this properly, you want to create a new instance if db for 
each thread? I have never tried this before, but could you do something like 
this for each thread?

db_thread = DAL(db._uri)
for k, v in db.items():
db_thread[k] = v

The idea being to using the existing db's URI string to make a new DAL 
instance, then copying the table information from db to db_thread. Again, I 
don't know if this works, but it might point in the right direction unless 
someone else has a more elegant solution.




[web2py] Re: Better language support

2011-05-20 Thread mart
Hi Pierre,

Agreed, and yes the money was there for the resources, but doesn't
mean we were smart about it (I.e. of couple of local Japanese
restaurant employees had much to do with a couple of of product
releasees;) - true story)

I think the issue here is not lack of knowledge on how-best-to-go-
about-it (there are many smart people here to pick from for process
ideas), but lack of knowledge about the translations (the strings). My
reasoning is that, if a language is supported by web2py, its probably
because one if its members requires that language and he/she (or
someone else) has already contributed to that languages string table.

That said, why not put a bit of the onus on the users? if we treat
each language as a plugin, and each plugin can be versioned, then each
web2py release can have access to the latest and greatest of each of
the language dictionaries/plugins (does not mean they all have to be
at the version). we publish language dictionaries based on
requirement, and not as a default (because keeping up may be need to
be some one's full time job)

here's an example. lets say we have N languages (including EN). EN
(being the prime language of release) would set the bar. Lets say, the
EN plugin is stamped with version 1.96.1 . if a user requires a German
dictionary for his app, then he may agree to update the German
dictionary and bring it to the level on the EN dictionary. Otherwise,
the _de_de dict would remain at its previous version (maybe 1.95.2).

This is open source, so obviously and as you say, the funds are not
there, but there are many users, native speakers for each of the
supported languages. If there are many users of any given language,
then that's great! Just means that there are many users to help keep
things in check. Otherwise, the assumption can be that if any language
is failing to keep up the EN, its probably that it is not being used,
therefore no harm is done by having a language at a lower version. If
at any point, someone requires the language, then he/she should do
their best to update those un-translated strings where, once vetted,
that language dict could be stamped at the same version as EN.

I think by introducing and supporting l18n in this type software
development environment, users who use the product can be expected to
contribute, lest it become unmanageable.

besides, i know for a fact, that even large corporation with way too
many funds at their disposal release localized product with the worst
possible practices (and questionable string equivalents). At least
here, there may be no funds, but there is discussion and many who may
be willing and able to help (i think).

Maybe we can have a members only app on web2py.com, where folks can
approved members can go when time permits and update strings. @
release time, Massimo could simply dump those string table to... well
to what ever format is required. Versioning for the lang plugins can
be set by comparing against the model (EN)  -- 1.96.1.number of
translated strings


just a thought,
Mart :)

On May 20, 2:46 am, Pierre Thibault pierre.thibau...@gmail.com
wrote:
 2011/5/20 mart msenecal...@gmail.com









  not sure if this applies, but just in case...

  years ago (i think 12, so this may be outdated), i worked in a
  localization team, (although it was a purely windows shop where words
  like dll was all that anyone talked about). Anyways, we adopted a
  method for 1) re-using translations (from translation tool kits (aka.
  TTKs) 2) standardizing on commonly accepted strings (i.e. there aren't
  too many ways to translate a yes/no button ;))  3) the language
  specific string tables would grow over time and served the task very
  well considering... (we only had 4 or 5 languages ;) english, swedish,
  japanese, simplified chinese, and french (fr_ca was deemed unworthy at
  the time ;))

  anyways, the moral is, that all strings going to UI were ripped out of
  the code and replaced with IDs where the users language selection
  would force load the language specific satellite dll @ run time -
  was just a dll with the resource strings in it.

  perhaps adopting something similar (but no dll's ;) ) would be
  beneficial?

  Mart :)

 Hi Mart,

 Thank you for sharing this experience. I guess you had the professional
 resources to do all the translations. If we use a common dictionary for
 web2py, we need all the translations for the languages we support for all
 the words before doing a new release. Do we have to resources to do that? I
 have some doubts.
 --

 A+

 -
 Pierre
 My blog and profile
 (http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
 YouTube page 
 (http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
 Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


[web2py] Re: pythonanywhere

2011-05-20 Thread mart
wow, that is pretty cool!!! also the web2py spreadsheet widget (this
is the first time I see it in action) would be nice if the fields grew
to accommodate size of content :)
 but regardless, its amazing!

Mart :)


On May 20, 9:09 am, Michele Comitini michele.comit...@gmail.com
wrote:
 To run python in the browser for real, not just a console:

 https://bitbucket.org/pypy/lang-js/

 Or maybe this 
 (unbelievable!):http://bellard.org/jslinux/http://bellard.org/jslinux/tech.html

 Of course stability and speed can be an issue! ;-)

 mic

 2011/5/20 Massimo Di Pierro massimo.dipie...@gmail.com:







  Do you know you can can do it with web2py, right?

 http://web2py.com/examples/spreadsheet

  On May 20, 6:55 am, António Ramos ramstei...@gmail.com wrote:
  hello guys

  do you know

 http://www.resolversystems.com/

  they have a spreadsheet with python as a scripting language.
  Its awsome.
  Please check it

  also they have in beta test

 http://www.pythonanywhere.com/

  its python in the browser!


[web2py] Inter component communication.

2011-05-20 Thread David J.

I saw the video on creating components;

I tried following the steps outline there;

For some reasons I must have missed a step because the message post 
table is not uploading;


Here is the code I think is not working correctly.

def reload(target):
def js(form):
response.js = 'web2py_component(%s,%s)' % (URL(target),target)

return js

def posts():
  postform = SQLFORM(db.posts,onaccept=reload('post_text'))

I changed the example a bit from the one you used because you used a 
Crud Form; but I just used SQLFORM instead which shouldn't really matter.


Thanks.





[web2py] Re: Windows Service Error

2011-05-20 Thread karl simon
That did the trick!  I had my ssl_certificate line commented out.  I
also noticed that the online web2py manual has a typo.  There should
be double quotes at the end of the ssl_certificate and ssl_private_key
so the look like this:

ssl_certificate = 
ssl_private_key = 

Thanks for your help!


On May 19, 7:14 pm, Anthony abasta...@gmail.com wrote:
 Have you created a /web2py/options.py file as described 
 here:http://web2py.com/book/default/chapter/11#Start-as-Windows-Service?There's
 an example file called 'options_std.py' that you can copy.

 Anthony



 On Thursday, May 19, 2011 6:21:42 PM UTC-4, karl simon wrote:
  I am running web2py from source (version 1.90.6) in Windows XP.  I
  currently have win32 extensions for Python installed.  I was able to
  install the windows service successfully, however, when I go to start
  the windows service using python web2py.py -W start, the service
  does not start.

  The Windows event viewer shows the following error:

  Traceback (most recent call last):
    File C:\web2py\gluon\winservice.py, line 46, in SvcDoRun
      self.start()
    File C:\web2py\gluon\winservice.py, line 116, in start
      ssl_certificate=option.ssl_certificate,
   AttributeError:  'module' object has not attribute 'ssl_certificate'

  Any idea what this means?- Hide quoted text -

 - Show quoted text -


[web2py] Re: Inter component communication.

2011-05-20 Thread Massimo Di Pierro
what's the view?


On May 20, 9:26 am, David J. da...@styleflare.com wrote:
 I saw the video on creating components;

 I tried following the steps outline there;

 For some reasons I must have missed a step because the message post
 table is not uploading;

 Here is the code I think is not working correctly.

 def reload(target):
      def js(form):
          response.js = 'web2py_component(%s,%s)' % (URL(target),target)

      return js

 def posts():
        postform = SQLFORM(db.posts,onaccept=reload('post_text'))

 I changed the example a bit from the one you used because you used a
 Crud Form; but I just used SQLFORM instead which shouldn't really matter.

 Thanks.


Re: [web2py] Re: Inter component communication.

2011-05-20 Thread David J.

The view  is index.html

{{= LOAD('default','list_post.load',ajax=True,target='list_post') }}


{{= LOAD('default','post.load',ajax=True) }}


On 5/20/11 10:45 AM, Massimo Di Pierro wrote:

what's the view?


On May 20, 9:26 am, David J.da...@styleflare.com  wrote:

I saw the video on creating components;

I tried following the steps outline there;

For some reasons I must have missed a step because the message post
table is not uploading;

Here is the code I think is not working correctly.

def reload(target):
  def js(form):
  response.js = 'web2py_component(%s,%s)' % (URL(target),target)

  return js

def posts():
postform = SQLFORM(db.posts,onaccept=reload('post_text'))

I changed the example a bit from the one you used because you used a
Crud Form; but I just used SQLFORM instead which shouldn't really matter.

Thanks.




Re: [web2py] Re: Inter component communication.

2011-05-20 Thread David J.

The strange thing is that repsonse.flash is not executing either;

I have the web2py_ajax included

The components say loading when the page is loaded; so javascript 
is working.


I am using the trunk version of web2py; I see some strange stuff so I am 
going to try to download again.


I see some strange


  local  local  local  local Version
 1.94.5 (2011-03-18 20:24:56) === Version 1.94.5 (2011-03-20
 15:21:40)  other === Version 1.95.1 (2011-05-08
 02:28:27)  other === Version 1.95.1 (2011-05-15
 19:23:28)  other === Version 1.95.1 (2011-05-17
 09:06:12)  other



Inside the admin page.
Maybe this is causing something.

On 5/20/11 10:45 AM, Massimo Di Pierro wrote:

what's the view?


On May 20, 9:26 am, David J.da...@styleflare.com  wrote:

I saw the video on creating components;

I tried following the steps outline there;

For some reasons I must have missed a step because the message post
table is not uploading;

Here is the code I think is not working correctly.

def reload(target):
  def js(form):
  response.js = 'web2py_component(%s,%s)' % (URL(target),target)

  return js

def posts():
postform = SQLFORM(db.posts,onaccept=reload('post_text'))

I changed the example a bit from the one you used because you used a
Crud Form; but I just used SQLFORM instead which shouldn't really matter.

Thanks.




Re: [web2py] Re: Inter component communication.

2011-05-20 Thread David J.



I see it was in the VERSION File; I deleted the content and updated to 
1.96



 Never Mind this


  local  local  local  local Version
 1.94.5 (2011-03-18 20:24:56) === Version 1.94.5 (2011-03-20
 15:21:40)  other === Version 1.95.1 (2011-05-08
 02:28:27)  other === Version 1.95.1 (2011-05-15
 19:23:28)  other === Version 1.95.1 (2011-05-17
 09:06:12)  other



On 5/20/11 10:45 AM, Massimo Di Pierro wrote:

what's the view?


On May 20, 9:26 am, David J.da...@styleflare.com  wrote:

I saw the video on creating components;

I tried following the steps outline there;

For some reasons I must have missed a step because the message post
table is not uploading;

Here is the code I think is not working correctly.

def reload(target):
  def js(form):
  response.js = 'web2py_component(%s,%s)' % (URL(target),target)

  return js

def posts():
postform = SQLFORM(db.posts,onaccept=reload('post_text'))

I changed the example a bit from the one you used because you used a
Crud Form; but I just used SQLFORM instead which shouldn't really matter.

Thanks.




[web2py] Re: Error when going to localhost:8080 says global name 'GAEDecimalProperty' is not defined

2011-05-20 Thread Arbie Samong
Hi Massimo,

I removed the try and except leaving the block. It says ImportError:
cannot import name rdbms

Traceback (most recent call last):
  File .../myproject/google/appengine/tools/dev_appserver.py, line
3245, in _HandleRequest
self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
3186, in _Dispatch
base_env_dict=env_dict)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
531, in Dispatch
base_env_dict=base_env_dict)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
2410, in Dispatch
self._module_dict)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
2320, in ExecuteCGI
reset_modules = exec_script(handler_path, cgi_path, hook)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
2216, in ExecuteOrImportScript
exec module_code in script_module.__dict__
  File .../myproject/web2py/gaehandler.py, line 59, in module
import gluon.main
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1295, in Decorate
return func(self, *args, **kwargs)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1945, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1295, in Decorate
return func(self, *args, **kwargs)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1847, in FindAndLoadModule
description)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1295, in Decorate
return func(self, *args, **kwargs)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1798, in LoadModuleRestricted
description)
  File .../myproject/web2py/gluon/main.py, line 80, in module
from globals import Request, Response, Session
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1295, in Decorate
return func(self, *args, **kwargs)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1945, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1295, in Decorate
return func(self, *args, **kwargs)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1847, in FindAndLoadModule
description)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1295, in Decorate
return func(self, *args, **kwargs)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1798, in LoadModuleRestricted
description)
  File .../myproject/web2py/gluon/globals.py, line 18, in module
from compileapp import run_view_in
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1295, in Decorate
return func(self, *args, **kwargs)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1945, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1295, in Decorate
return func(self, *args, **kwargs)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1847, in FindAndLoadModule
description)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1295, in Decorate
return func(self, *args, **kwargs)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1798, in LoadModuleRestricted
description)
  File .../myproject/web2py/gluon/compileapp.py, line 24, in
module
from sql import BaseAdapter, SQLDB, SQLField, DAL, Field
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1295, in Decorate
return func(self, *args, **kwargs)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1945, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1295, in Decorate
return func(self, *args, **kwargs)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1847, in FindAndLoadModule
description)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1295, in Decorate
return func(self, *args, **kwargs)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1798, in LoadModuleRestricted
description)
  File .../myproject/web2py/gluon/sql.py, line 5, in module
from dal import DAL, Field, Table, Query, Set, Expression, Row,
Rows, drivers, BaseAdapter, SQLField, SQLTable, SQLXorable, SQLQuery,
SQLSet, SQLRows, SQLStorage, SQLDB, GQLDB, SQLALL, SQLCustomType
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1295, in Decorate
return func(self, *args, **kwargs)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1945, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
  File .../myproject/google/appengine/tools/dev_appserver.py, line
1295, in Decorate

[web2py] Re: Error when going to localhost:8080 says global name 'GAEDecimalProperty' is not defined

2011-05-20 Thread Massimo Di Pierro
I think you have an old GAE SDK.

Massimo

On May 20, 10:05 am, Arbie Samong phek...@gmail.com wrote:
 Hi Massimo,

 I removed the try and except leaving the block. It says ImportError:
 cannot import name rdbms

 Traceback (most recent call last):
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 3245, in _HandleRequest
     self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 3186, in _Dispatch
     base_env_dict=env_dict)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 531, in Dispatch
     base_env_dict=base_env_dict)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 2410, in Dispatch
     self._module_dict)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 2320, in ExecuteCGI
     reset_modules = exec_script(handler_path, cgi_path, hook)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 2216, in ExecuteOrImportScript
     exec module_code in script_module.__dict__
   File .../myproject/web2py/gaehandler.py, line 59, in module
     import gluon.main
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1295, in Decorate
     return func(self, *args, **kwargs)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1945, in load_module
     return self.FindAndLoadModule(submodule, fullname, search_path)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1295, in Decorate
     return func(self, *args, **kwargs)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1847, in FindAndLoadModule
     description)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1295, in Decorate
     return func(self, *args, **kwargs)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1798, in LoadModuleRestricted
     description)
   File .../myproject/web2py/gluon/main.py, line 80, in module
     from globals import Request, Response, Session
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1295, in Decorate
     return func(self, *args, **kwargs)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1945, in load_module
     return self.FindAndLoadModule(submodule, fullname, search_path)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1295, in Decorate
     return func(self, *args, **kwargs)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1847, in FindAndLoadModule
     description)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1295, in Decorate
     return func(self, *args, **kwargs)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1798, in LoadModuleRestricted
     description)
   File .../myproject/web2py/gluon/globals.py, line 18, in module
     from compileapp import run_view_in
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1295, in Decorate
     return func(self, *args, **kwargs)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1945, in load_module
     return self.FindAndLoadModule(submodule, fullname, search_path)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1295, in Decorate
     return func(self, *args, **kwargs)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1847, in FindAndLoadModule
     description)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1295, in Decorate
     return func(self, *args, **kwargs)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1798, in LoadModuleRestricted
     description)
   File .../myproject/web2py/gluon/compileapp.py, line 24, in
 module
     from sql import BaseAdapter, SQLDB, SQLField, DAL, Field
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1295, in Decorate
     return func(self, *args, **kwargs)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1945, in load_module
     return self.FindAndLoadModule(submodule, fullname, search_path)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1295, in Decorate
     return func(self, *args, **kwargs)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1847, in FindAndLoadModule
     description)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1295, in Decorate
     return func(self, *args, **kwargs)
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1798, in LoadModuleRestricted
     description)
   File .../myproject/web2py/gluon/sql.py, line 5, in module
     from dal import DAL, Field, Table, Query, Set, Expression, Row,
 Rows, drivers, BaseAdapter, SQLField, SQLTable, SQLXorable, SQLQuery,
 SQLSet, SQLRows, SQLStorage, SQLDB, GQLDB, SQLALL, SQLCustomType
   File .../myproject/google/appengine/tools/dev_appserver.py, line
 1295, in Decorate
     return func(self, *args, **kwargs)
   File 

[web2py] Re: how to adjust timezone for request.now ?

2011-05-20 Thread danto
2011/5/19 danto web2py.n...@gmail.com:
 I'm setting the created_on field in a database table with request.now
 but i need to adjust the result to my timezone with the application
 (it's a shared server). Can you tell me how can I achieve this?

 thank you in advance

 kind regards


sorry, it's the answer so obviuous?emp


Re: [web2py] Re: Inter component communication.

2011-05-20 Thread David J.

Does SQLFORM have an onaccept handler?

I just tried doing this

def post():

if form.accepts(request):
response.js = reload('list')


in my view I have

{{= LOAD('list_posts',target='list',ajax=True) }}



But this does not seem to work either.

I suppose I am missing one step in the inter component communication.




On 5/20/11 10:45 AM, Massimo Di Pierro wrote:

what's the view?


On May 20, 9:26 am, David J.da...@styleflare.com  wrote:

I saw the video on creating components;

I tried following the steps outline there;

For some reasons I must have missed a step because the message post
table is not uploading;

Here is the code I think is not working correctly.

def reload(target):
  def js(form):
  response.js = 'web2py_component(%s,%s)' % (URL(target),target)

  return js

def posts():
postform = SQLFORM(db.posts,onaccept=reload('post_text'))

I changed the example a bit from the one you used because you used a
Crud Form; but I just used SQLFORM instead which shouldn't really matter.

Thanks.




[web2py] high speed template engine

2011-05-20 Thread Nhan Le
just found this resource

http://www.slideshare.net/kwatch/how-to-create-a-highspeed-template-engine-in-python


Re: [web2py] Re: Inter component communication.

2011-05-20 Thread David J.

I started from scratch here is all the code running latest from trunk.

Seems I am still missing something.

(By the way I added an alert('running') to web2py_component() to see 
when it executes. Seems like after submitting the form it is never called.)


so I think response.js is not being called.

db.py

db.define_table('messages',
Field('message',notnull=True))


default.py

def reload(target):
def js(form):
response.js = 'web2py_component(%s,%s)' % (URL(target),target)

return js


def post_message():
return 
dict(form=crud.create(db.messages,onaccept=reload('list_message')))


def list_message():
return dict(items = crud.select(db.messages) or 'No Messages')


default/index.html


{{extend 'layout.html'}}

{{= LOAD('default','post_message.load',ajax=True) }}
hr /

{{= LOAD('default','list_message.load',ajax=True,target='list_message') }}


Still not working.



On 5/20/11 10:45 AM, Massimo Di Pierro wrote:

what's the view?


On May 20, 9:26 am, David J.da...@styleflare.com  wrote:

I saw the video on creating components;

I tried following the steps outline there;

For some reasons I must have missed a step because the message post
table is not uploading;

Here is the code I think is not working correctly.

def reload(target):
  def js(form):
  response.js = 'web2py_component(%s,%s)' % (URL(target),target)

  return js

def posts():
postform = SQLFORM(db.posts,onaccept=reload('post_text'))

I changed the example a bit from the one you used because you used a
Crud Form; but I just used SQLFORM instead which shouldn't really matter.

Thanks.




Re: [web2py] Re: pythonanywhere

2011-05-20 Thread António Ramos
Sorry maximo but resolversystems product is much more than your spreadsheet.

You looked but you did not see
(where did y heard this before.?!?!?!)

:)

2011/5/20 Massimo Di Pierro massimo.dipie...@gmail.com

 Do you know you can can do it with web2py, right?

 http://web2py.com/examples/spreadsheet

 On May 20, 6:55 am, António Ramos ramstei...@gmail.com wrote:
  hello guys
 
  do you know
 
  http://www.resolversystems.com/
 
  they have a spreadsheet with python as a scripting language.
  Its awsome.
  Please check it
 
  also they have in beta test
 
  http://www.pythonanywhere.com/
 
  its python in the browser!



Re: [web2py] Re: pythonanywhere

2011-05-20 Thread António Ramos
check this screencast
http://www.resolversystems.com/screencasts/console/

Em 20 de maio de 2011 18:04, António Ramos ramstei...@gmail.com escreveu:

 Sorry maximo but resolversystems product is much more than your
 spreadsheet.

 You looked but you did not see
 (where did y heard this before.?!?!?!)

 :)

 2011/5/20 Massimo Di Pierro massimo.dipie...@gmail.com

 Do you know you can can do it with web2py, right?

 http://web2py.com/examples/spreadsheet

 On May 20, 6:55 am, António Ramos ramstei...@gmail.com wrote:
  hello guys
 
  do you know
 
  http://www.resolversystems.com/
 
  they have a spreadsheet with python as a scripting language.
  Its awsome.
  Please check it
 
  also they have in beta test
 
  http://www.pythonanywhere.com/
 
  its python in the browser!





[web2py] Re: Ajax page update

2011-05-20 Thread VP
Thank you.  I will look into this.

On May 19, 9:54 am, Chris May chrisma...@gmail.com wrote:
 I thought I read of a way of using jQuery for something like this
 using its deferred object. (http://api.jquery.com/category/deferred-
 object/)

 Sorry I can't be more specific, but I hope it helps.

 On May 19, 10:25 am, VP vtp2...@gmail.com wrote:







  Is there a guide for a clean and sweet way to implement these types of
  polling?  Like using jquery?

  Thanks.

  On May 19, 9:05 am, Anthony abasta...@gmail.com wrote:

   The simplest approach would probably be ajax short polling (i.e., an ajax
   request every n seconds). If the orders page is just an administrative 
   page
   with a small number of simultaneous users, that's probably fine. If that's
   not adequate, you could look into comet type solutions. web2py includes a
   WebSockets implementation in /gluon/contrib/comet_messaging.py 
   (http://code.google.com/p/web2py/source/browse/gluon/contrib/comet_mes...).
   That doesn't work in all browsers, but it can be adapted to fall back to
   other methods using Socket.IO -- 
   seehttp://greg.thehellings.com/2011/04/web2py-websockets-and-socket-io-p...
   .

   Anthony

   On Thursday, May 19, 2011 9:29:30 AM UTC-4, David J wrote:
I was wondering how can I PUSH updates to a page using Ajax.

On our orders page as orders come in I want the page to automatically be
updated;

Currently I just refresh the page every N seconds; but I thought it
could be made more efficient.

Like some sort of event notification system.

Thanks in advance for any advice on this.


[web2py] Re: Error when going to localhost:8080 says global name 'GAEDecimalProperty' is not defined

2011-05-20 Thread Arbie Samong
That worked! Thanks Massimo.

I downloaded the latest and that got rid of the error. Also I restored
the try-catch block.

Thanks,
Arbie

On May 20, 11:40 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 I think you have an old GAE SDK.

 Massimo

 On May 20, 10:05 am, Arbie Samong phek...@gmail.com wrote:

  Hi Massimo,

  I removed the try and except leaving the block. It says ImportError:
  cannot import name rdbms

  Traceback (most recent call last):
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  3245, in _HandleRequest
      self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  3186, in _Dispatch
      base_env_dict=env_dict)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  531, in Dispatch
      base_env_dict=base_env_dict)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  2410, in Dispatch
      self._module_dict)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  2320, in ExecuteCGI
      reset_modules = exec_script(handler_path, cgi_path, hook)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  2216, in ExecuteOrImportScript
      exec module_code in script_module.__dict__
    File .../myproject/web2py/gaehandler.py, line 59, in module
      import gluon.main
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1295, in Decorate
      return func(self, *args, **kwargs)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1945, in load_module
      return self.FindAndLoadModule(submodule, fullname, search_path)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1295, in Decorate
      return func(self, *args, **kwargs)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1847, in FindAndLoadModule
      description)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1295, in Decorate
      return func(self, *args, **kwargs)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1798, in LoadModuleRestricted
      description)
    File .../myproject/web2py/gluon/main.py, line 80, in module
      from globals import Request, Response, Session
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1295, in Decorate
      return func(self, *args, **kwargs)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1945, in load_module
      return self.FindAndLoadModule(submodule, fullname, search_path)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1295, in Decorate
      return func(self, *args, **kwargs)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1847, in FindAndLoadModule
      description)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1295, in Decorate
      return func(self, *args, **kwargs)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1798, in LoadModuleRestricted
      description)
    File .../myproject/web2py/gluon/globals.py, line 18, in module
      from compileapp import run_view_in
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1295, in Decorate
      return func(self, *args, **kwargs)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1945, in load_module
      return self.FindAndLoadModule(submodule, fullname, search_path)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1295, in Decorate
      return func(self, *args, **kwargs)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1847, in FindAndLoadModule
      description)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1295, in Decorate
      return func(self, *args, **kwargs)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1798, in LoadModuleRestricted
      description)
    File .../myproject/web2py/gluon/compileapp.py, line 24, in
  module
      from sql import BaseAdapter, SQLDB, SQLField, DAL, Field
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1295, in Decorate
      return func(self, *args, **kwargs)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1945, in load_module
      return self.FindAndLoadModule(submodule, fullname, search_path)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1295, in Decorate
      return func(self, *args, **kwargs)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1847, in FindAndLoadModule
      description)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1295, in Decorate
      return func(self, *args, **kwargs)
    File .../myproject/google/appengine/tools/dev_appserver.py, line
  1798, in LoadModuleRestricted
      description)
    File .../myproject/web2py/gluon/sql.py, line 5, in module
      from dal import DAL, Field, Table, 

[web2py] Re: how to adjust timezone for request.now ?

2011-05-20 Thread ron_m
Actually it isn't that obvious. In Python the datetime class by default is 
not time zone aware. If you have users coming from multiple time zones the 
best universal way to handle this is store the time in UTC which the 
datetime class has a method for datetime.utcnow(). This is how UNIX does it 
internally and then warps the time to the local time of the user based on 
their environment variable setting. If you don't do this then time 
comparisons across users become a real bear to deal with. If you have all 
the users on one server it will be the server time that is used to fill the 
database fields if you use datetime.now() instead so you might be able to 
manage it that way. The browser client through Javascript knows the timezone 
of the client and without being specific I believe there is a way to get 
from UTC to local time in Javascript. So again it comes back to using UTC on 
the server for the least effort over all.

Hope that helps
Ron




Re: [web2py] Re: persistence of inherited tables in the same function.

2011-05-20 Thread Bruno Rocha
I recommend you to set your own names for migration files, it will turn it
easy to migrate.

db_define_table('tablename',Field('...'), migrate='mycustomname.table')
--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]



On Fri, May 20, 2011 at 2:01 AM, james c. james.cryp...@gmail.com wrote:

 thanks Anthony for the quick reply. regards, james c.

 On May 19, 9:26 pm, Anthony abasta...@gmail.com wrote:
  You can read more about all this here:
 http://web2py.com/book/default/chapter/06#Migrations
 
 
 
 
 
 
 
  On Friday, May 20, 2011 12:25:03 AM UTC-4, Anthony wrote:
   On Thursday, May 19, 2011 11:48:07 PM UTC-4, james c. wrote:
 
   The tables are created by web2py
   with a 31 digit hex number appended to the generic name + user id.
 
   The table names in the actual database are simply the names you define
 in
   your db.define_table() definitions. If you want to drop a table, just
 use
   the table name itself (without any 31 digit hex number):
 
   this_current_view = 'current_view_' + str(auth.user_id)
   db[this_current_view].drop()
 
   The files with the 31 digit hex prefixes are not the database tables
   themselves -- they are web2py migration files that store migration data
 for
   the tables. The hex prefix is a hash of the db connection string.
 Looking at
   the DAL code, you should be able to figure out the prefix using this
 code:
 
   import hashlib
   hex_prefix = '%s_%s.table' % (hashlib.md5(db._uri).hexdigest(),
 tablename)
 
   However, the migration file names are simply an automatic default
 generated
   by web2py. As an alternative, you can specify your own migration file
 name
   for each table using the 'migrate' argument to define_table(). For
 example:
 
   db.define_table(current_view_db, current_view_template,
 migrate='%s.table'
   % current_view_db)
 
   Note, when you drop a table using .drop(), it drops it from the
 database,
   but I don't think it will delete the migration file, so you'll have to
 add
   some code to delete the migration file yourself.
 
   Anthony



Re: [web2py] Very cool new code sharing service: http://chopapp.com/

2011-05-20 Thread Nico de Groot
chopapp will get python, can become cool

Hi Nico,
 Adding syntax highlighting for additional languages is the most common 
request we've gotten so far; a good problem to have. :) Yes, we're going to 
figure out a way to add support for additional languages soon. Stay tuned.
 Louis Corso
supp...@chopapp.com

 On Fri, May 20, 2011 at 6:27 AM, Nico de Groot n.c.degr...@uvt.nl wrote:

I expect you are using Ruby, but  maybe you can be gracious and add a Python 
tab? Somewhere at the end of the line?



Re: [web2py] Re: Inter component communication.

2011-05-20 Thread David J.

Seems that

reponse.js is never called.

I see in firebug

post to http://localhost:8000/ajax/default/post_message.load

X-Powered-By|web2py
|web2py-component-flash|Form You
|Set-Cookie|session_id_ajax=127.0.0.1-7a4406f9-01c9-46ab-ad14-4d83978d4d69; 
Path=/

|Expires|Fri, 20 May 2011 18:50:53 GMT|
Pragma|no-cache|
Cache-Control|no-store, no-cache, must-revalidate, post-check=0, pre-check=0
|web2py-component-command|web2py_component(\/ajax/default/list_message.load\,\list_message\)|
Content-Type|text/html; charset=utf-8
|Date|Fri, 20 May 2011 18:50:53 GMT
|Server|Rocket 1.2.2 Python/2.7.1
|Content-Length|699
|Connection|keep-alive|



On 5/20/11 10:45 AM, Massimo Di Pierro wrote:

what's the view?


On May 20, 9:26 am, David J.da...@styleflare.com  wrote:

I saw the video on creating components;

I tried following the steps outline there;

For some reasons I must have missed a step because the message post
table is not uploading;

Here is the code I think is not working correctly.

def reload(target):
  def js(form):
  response.js = 'web2py_component(%s,%s)' % (URL(target),target)

  return js

def posts():
postform = SQLFORM(db.posts,onaccept=reload('post_text'))

I changed the example a bit from the one you used because you used a
Crud Form; but I just used SQLFORM instead which shouldn't really matter.

Thanks.




[web2py] Re: pythonanywhere

2011-05-20 Thread Ross Peoples
Now if we could just get a built-in web2py version that does the exact same 
thing. Massimo should be able to knock that out in a couple hours :)

Just kidding, of course. Although it would be sweet.


Re: [web2py] Re: pythonanywhere

2011-05-20 Thread Michele Comitini
With some css + jqgrid
(http://www.trirand.com/blog/jqgrid/jqgrid.html) you can reach similar
results

2011/5/20 Ross Peoples ross.peop...@gmail.com:
 Now if we could just get a built-in web2py version that does the exact same
 thing. Massimo should be able to knock that out in a couple hours :)
 Just kidding, of course. Although it would be sweet.


[web2py] Re: pythonanywhere

2011-05-20 Thread Ialejandro
Well, in fact Resolver One is made with IronPython (asp.net). I read
it in the book IronPython in action which is written by one of the
developers of Resolverone.


[web2py] Re: Getting started with appliances for web2py on GAE

2011-05-20 Thread howesc
Niklas,

you will have to run the code locally and upload plugins and then deploy to 
GAE.  you cannot upload files to a deployed GAE instance (without using the 
blobstore).  so you must have a complete code set that you can upload.

cfh


[web2py] Re: Logging of user actions

2011-05-20 Thread howesc
in that case i would put it right in the DB, using CRUD's archive tools.  
then you know who made what changes to what rows and when, and you can go 
back an restore previous versions.  
http://web2py.com/book/default/chapter/07?search=archive

much easier to parse than text logs (in my opinion)

cfh


[web2py] Re: Better language support

2011-05-20 Thread Christopher Steel
The important issue being, making it easier for people to contribute
additional translations...

On May 19, 6:52 pm, Pierre Thibault pierre.thibau...@gmail.com
wrote:
 2011/5/19 Christopher Steel chris.st...@gmail.com

  Hi Pierre,

  I think you have touched on an important issues and although I am also
  wondering if Jonathan proposal might provide for similar (although
  less blingy)...

 Hi Chris,

 No, I think mixing translations is not a good thing for the reasons I
 mention above.

 --

 A+

 -
 Pierre
 My blog and profile
 (http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
 YouTube page 
 (http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
 Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


[web2py] Re: Logging of user actions

2011-05-20 Thread Joseph.Piron
Ah nice trick also, didn't think about the cache, but where do you put
the code to defie the _init_log ?

On May 19, 11:23 pm, pbreit pbreitenb...@gmail.com wrote:
 I got this from here awhile back:

 def _init_log():
     import os,logging,logging.handlers,time
     logger = logging.getLogger(request.application)
     logger.setLevel(logging.INFO)
     handler = logging.handlers.RotatingFileHandler(os.path.join(
         request.folder,'logs','applog.log'),'a',1024*1024,1)
     handler.setLevel(logging.INFO) #or DEBUG
     handler.setFormatter(logging.Formatter(
         '%(asctime)s %(levelname)s %(filename)s %(lineno)d %(funcName)s():
 %(message)s'))
     logger.addHandler(handler)
     return logger

 app_logging = cache.ram('app_wide_log',lambda:_init_log(),time_expire=None)

 Then you can do this from anywhere:
 app_logging.info(log_this_data)


[web2py] sincronizar datos entre app local - app internet -- app remota

2011-05-20 Thread Luis Díaz
saludos!

quiero tener semi sincrinizada varias app instaladas en varios sitios
diferentes (geograficamente)

quiero poder distribuir la app bajo la licencia MIT y que cualquier la
instale en local, para ser usada cómodamente entre los
usuarios de su intranet.

pero también me interesa que esa app
se comunique con un servidor central y almacene una copia de un registro de
la base de datos en linea
y luego cualquier sucursal X, puede seleccionar ese tabla o registro y bajar
para integrarlo a su base de datos.

deseo poder monetizar al prestar un servicio centralizado para compartir la
data entre clientes, que no poseen
infraestructura de internet o departamento TIC

pregunto.. es posible comunicar (y como?) app mediante controller
para enviar y almacenar datos de forma segura (https y usando session)

sin tener que abordar temas como soluciones de bases de datos


Díaz Luis
http://www.facebook.com/diazluis2007
User Linux 532223
progjuegos.com
TSU Analisis de Sistemas
Universidad de Carabobo
Facultad de Odontología http://www.odontologia.uc.edu.ve/


Re: [web2py] Re: Better language support

2011-05-20 Thread Pierre Thibault
You made good points. I think that it is important to have a process that
can support the community we are.

Here is my last idea on the subject:

We can support a global translation repository just like Jonathan was
proposing. But if an application has not for example a custom dictionary for
German, then web2py will not continue its search to try to get another
translation in the global repository.

Also, when a new application is created with the web interface, web2py will
ask what are the languages to be available for the new app. This will avoid
trailing dictionaries.

This way of doing will avoid partial translations where only a word up and
there is translated. Instead, there will be no translation at all and I
think this is a lot nicer.

Sounds good?


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


Re: [web2py] Re: pythonanywhere

2011-05-20 Thread Pierre Thibault
2011/5/20 Ialejandro ialejandr...@gmail.com

 Well, in fact Resolver One is made with IronPython (asp.net). I read
 it in the book IronPython in action which is written by one of the
 developers of Resolverone.


Too bad. It is Windows only. :-(

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


[web2py] Login form error KeyError: 'email' after customizing db.auth_user table

2011-05-20 Thread haggis
Hi,
since I doesn't need any email adresses associated with my users, I
changed the schema of the auth_user table like this:

file: db.py

snip
db.define_table(
auth.settings.table_user_name,
Field('name', length=32, default='', label='Name'),
Field('password', 'password', length=512, readable=False,
label='Passwort'),
Field('registration_key', length=512, writable=False,
readable=False, default=''),
Field('reset_password_key', length=512, writable=False,
readable=False, default=''),
Field('registration_id', length=512, writable=False,
readable=False, default=''))

custom_auth_table = db[auth.settings.table_user_name]
custom_auth_table.name.requires =
[IS_NOT_EMPTY(error_message=auth.messages.is_empty),
   IS_NOT_IN_DB(db,
custom_auth_table.name)]
custom_auth_table.password.requires =
CRYPT(key=auth.settings.hmac_key)

auth.settings.table_user = custom_auth_table

auth.define_tables(username=True)
/snap

I also managed to get the registration form working. However, if I try
to show the login form (http://localhost:8000/myapp/default/user/
login) I get the following error: KeyError: 'email'

It seems as web2py tries to generate the login form based on the
original auth_user schema. How can I change this? I didn't find
anything.

Please forgive me if this is a fiddling question - I'm still very new
to python and web2py.

Regards,
haggis


[web2py] Consuming a web2py web service in C#?

2011-05-20 Thread Matt
Anyone using web2py as the web service and then consuming the service
via json-rpc in C#? I imagine this is possible, but seem to have quite
some time trying to get this to work.

I'm using jayrock as my json-rpc C# parser and setting the url to the
service to be my exposed web2py service but can't seem to get the
data.

I'd be interested to know if anyone is doing something similar.

Thanks.
-m


[web2py] Re: Login form error KeyError: 'email' after customizing db.auth_user table

2011-05-20 Thread Massimo Di Pierro
Auth requires the email field. without it there is no way to reset
password.

Anyway you can do

db.auth_user.email.readable=False
db.auth_user.email.writable=False

and disable the reset password actions.

On May 20, 6:00 pm, haggis patr...@mindf.org wrote:
 Hi,
 since I doesn't need any email adresses associated with my users, I
 changed the schema of the auth_user table like this:

 file: db.py

 snip
 db.define_table(
     auth.settings.table_user_name,
     Field('name', length=32, default='', label='Name'),
     Field('password', 'password', length=512, readable=False,
 label='Passwort'),
     Field('registration_key', length=512, writable=False,
 readable=False, default=''),
     Field('reset_password_key', length=512, writable=False,
 readable=False, default=''),
     Field('registration_id', length=512, writable=False,
 readable=False, default=''))

 custom_auth_table = db[auth.settings.table_user_name]
 custom_auth_table.name.requires =
 [IS_NOT_EMPTY(error_message=auth.messages.is_empty),
                                    IS_NOT_IN_DB(db,
 custom_auth_table.name)]
 custom_auth_table.password.requires =
 CRYPT(key=auth.settings.hmac_key)

 auth.settings.table_user = custom_auth_table

 auth.define_tables(username=True)
 /snap

 I also managed to get the registration form working. However, if I try
 to show the login form (http://localhost:8000/myapp/default/user/
 login) I get the following error: KeyError: 'email'

 It seems as web2py tries to generate the login form based on the
 original auth_user schema. How can I change this? I didn't find
 anything.

 Please forgive me if this is a fiddling question - I'm still very new
 to python and web2py.

 Regards,
 haggis


[web2py] Re: Login form error KeyError: 'email' after customizing db.auth_user table

2011-05-20 Thread Anthony
On Friday, May 20, 2011 7:00:08 PM UTC-4, haggis wrote: 

 Hi, 
 since I doesn't need any email adresses associated with my users, I 
 changed the schema of the auth_user table like this: 

 file: db.py 

 snip 
 db.define_table( 
 auth.settings.table_user_name, 
 Field('name', length=32, default='', label='Name'), 
 Field('password', 'password', length=512, readable=False, 
 label='Passwort'), 
 Field('registration_key', length=512, writable=False, 
 readable=False, default=''), 
 Field('reset_password_key', length=512, writable=False, 
 readable=False, default=''), 
 Field('registration_id', length=512, writable=False, 
 readable=False, default='')) 

 custom_auth_table = db[auth.settings.table_user_name] 
 custom_auth_table.name.requires = 
 [IS_NOT_EMPTY(error_message=auth.messages.is_empty), 
IS_NOT_IN_DB(db, 
 custom_auth_table.name)] 
 custom_auth_table.password.requires = 
 CRYPT(key=auth.settings.hmac_key) 

 auth.settings.table_user = custom_auth_table 

 auth.define_tables(username=True)

 
Do you want your auth_user table to include a 'username' field? If so, as 
long as you are creating a custom table, I think you have to add that field 
manually. If you call auth.define_tables(username=True), I believe that will 
only define auth tables that have not already been defined, so it will not 
re-define your auth_user table and will therefore not add a 'username' field 
to it for you (i.e., username=True will simply be ignored).
 
The Auth code that builds the login form first checks to see if there is an 
auth.settings.login_userfield defined. If not, it checks to see if the 
auth_user table includes a 'username' field, and if not, it uses the 'email' 
field as the login field. So, if you haven't set 
auth.settings.login_userfield and don't have a 'username' field, it will 
assume you've got an 'email' field to use for login -- that's probably why 
you're getting the error. So, you should either add a 'username' field, or 
if you want to use the 'name' field for login, then set 
auth.settings.login_userfield='name'.
 
Anthony
 


[web2py] Re: pythonanywhere

2011-05-20 Thread pbreit
I couldn't figure out how to see it. Any suggestions?

[web2py] Re: Logging of user actions

2011-05-20 Thread pbreit
I have it in a model so it's available everywhere.

[web2py] Re: Better language support

2011-05-20 Thread mart
that makes a lot of sense! removes confusion and leaves little room
for doubt.

Mart :)




On May 20, 9:23 pm, Pierre Thibault pierre.thibau...@gmail.com
wrote:
 You made good points. I think that it is important to have a process that
 can support the community we are.

 Here is my last idea on the subject:

 We can support a global translation repository just like Jonathan was
 proposing. But if an application has not for example a custom dictionary for
 German, then web2py will not continue its search to try to get another
 translation in the global repository.

 Also, when a new application is created with the web interface, web2py will
 ask what are the languages to be available for the new app. This will avoid
 trailing dictionaries.

 This way of doing will avoid partial translations where only a word up and
 there is translated. Instead, there will be no translation at all and I
 think this is a lot nicer.

 Sounds good?

 A+

 -
 Pierre
 My blog and profile
 (http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
 YouTube page 
 (http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
 Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


[web2py] Re: how to adjust timezone for request.now ?

2011-05-20 Thread pbreit
This is the best answer I've seen:
http://stackoverflow.com/questions/117514/how-do-i-use-timezones-with-a-datetime-object-in-python

It can get complicated so make sure you need it.