[web2py] web2py.com is down !!?!

2010-03-09 Thread Sky
as I see web2py.com is down since 2 days ago.
is there any body to inform the site administrator ???

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: web2py.com is down !!?!

2010-03-09 Thread Yarko Tymciurak
I see web2py.com responding nicely...   maybe something is blocking it
for you?

have a try at http://68.169.39.35/

Or try nslookup on web2py.com to see if your DNS server returns
something valid.

On Mar 9, 2:18 am, Sky hmonfa...@gmail.com wrote:
 as I see web2py.com is down since 2 days ago.
 is there any body to inform the site administrator ???

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: web2py.com is down !!?!

2010-03-09 Thread Vasile Ermicioi
Also is working for me...

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] web2py.com is down !!?!

2010-03-09 Thread Jason Brower
Works for me (:
On Tue, 2010-03-09 at 00:18 -0800, Sky wrote: 
 as I see web2py.com is down since 2 days ago.
 is there any body to inform the site administrator ???
 


-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] how to set 2 web2py-component-commands

2010-03-09 Thread selecta
in my controller I got

response.headers['web2py-component-command'] =
'web2py_ajax_page(GET,%s,,table_code)' %
URL(r=request,f='table_code',args=[table_id])

But now I want to update two components. The following does not work

response.headers['web2py-component-command'] =
'web2py_ajax_page(GET,%s,,table_code);' %
URL(r=request,f='table_code',args=[table_id])
#response.headers['web2py-component-command'] +=
';web2py_ajax_page(GET,%s,,table_details);' %
URL(r=request,f='table',args=[table_id])

I do not really have an idea how to solve that, help is appreciated :)

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] web2py HL7 certification

2010-03-09 Thread dbb
To Web2pyers:

Massimo has posted a new speedier web2pyHL7, the goal is to certify
the EHR ( EMR) as show by the demo, you can help in many ways, such
as, :
 - read the specification for certification at
http://xw2k.nist.gov/healthcare/use_testing/under_development.html
and test the software suggestion
- if you want a job as developers chech the site : www.himss.org,
study the demo since it has all what is required, once web2pyHL7 is
certified, it may open for you employment. Healthcare providers do not
want to hardship for going through the certification process, and if
we do it here, it will be a plus for everybody

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: exposing crossdomain.xml

2010-03-09 Thread mdipierro
No but you can make a dummy app with only static files.

On Mar 9, 6:49 am, iggass gas...@gmail.com wrote:
 They did work after I had restarted the server, no problem with that.
 I wonder if there is any clean way to expose static resources which
 don't belong to any particular application? Some sort of root static
 folder...

 On Mar 9, 1:53 am, stephen stephenino...@gmail.com wrote:

  Hello iggass,

  The snippets of code you submitted should work if your web2py
  application is named app. Is that the case? If not just change

  '/app/static/crossdomain.xml'

  to

  '/myappname/static/crossdomain.xml'

  where myappname is the application that has the crossdomain.xml in
  its static folder.

  Stephen

  On Mar 8, 4:14 pm, iggass gas...@gmail.com wrote:

   Hello,

   I'm running web2py (v1.76.1 on Win 2K3) server for development
   purposes.
   I would like to expose 'crossdomain.xml' at the top level of my site
   for the sake of providing AMF service and being able to access it from
   another domain, like:http://example.com:8000/crossdomain.xml

   As far as I understand, the only (and not so aesthetic) way to do it,
   is to rewrite URL using 'routes.py'.
   So I placed crossdomain.xml in the 'static' folder of my application,
   and created 'routes.py' under 'web2py' folder with the following
   content:
   routes_in = (('.*:/crossdomain.xml', '/app/static/crossdomain.xml'),)

   However, it doesn't work, I'm getting 'Invalid request'.
   So I tried (as Massimo suggested 
   herehttp://www.mail-archive.com/web2py@googlegroups.com/msg26278.html):
   routes_in = (('/crossdomain.xml', '/app/static/crossdomain.xml'),)
   to no avail.

   I'd greatly appreciate any help!

   Thanks

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Caching at DAL level

2010-03-09 Thread Praneeth
Would it be better to have a non time based caching? Say refresh cache
on DB update?
Time based caching requires guessing the cache time - which in my
opinion seems like a bad thing to do.

Thoughts?

--
Praneeth

On 03/09/2010 08:33 PM, mdipierro wrote:
 It is there already.

 values=db(...).select(cache=(cache.disk,3600))

 3600 is the time.

 On Mar 9, 5:23 am, Praneeth life...@gmail.com wrote:
   
 Hello all,

 I was wondering if DAL level caching could be added. I am aware of
 cache.ram and cache.disk, but these require the usage of a decorator
 over the functions. I feel that a cache option to cache at the DAL level
 that could be enabled by flipping an option in db.py of an application
 would be of great help. The cache can be a key value pair of sorts,
 where the cache is flushed on each write/update and cached on the first
 read - There are probably smarter ways of doing this.

 Thoughts?

 --
 Praneeth
 
   

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: web2py.com is down !!?!

2010-03-09 Thread mdipierro
It not down but I may be blocking your IP.
I have a script that blocks lot of IP if it thinks there is a denial
of service attack of a directory traversal attack.
What is your ip?

Massimo

On Mar 9, 2:18 am, Sky hmonfa...@gmail.com wrote:
 as I see web2py.com is down since 2 days ago.
 is there any body to inform the site administrator ???

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: announcement

2010-03-09 Thread dbb
Massimo :

Can you create along side the web2py code , the binary for download by
users, with its own  version number.
or in a separate web site www.web2pyhl7.com, do we need to register
the URL  or get it from google.

On Mar 9, 10:00 am, mdipierro mdipie...@cs.depaul.edu wrote:
 You are running from source and did not install Mark Mahmmond win32
 extensions.

 On Mar 9, 1:08 am, Debebe Asefa asefa.deb...@gmail.com wrote:



  Why the following error messages:

  Microsoft Windows [Version 6.0.6002]
  Copyright (c) 2006 Microsoft Corporation.  All rights reserved.
  C:\Users\Usercd ..
  C:\Userscd ..
  C:\cd python25
  C:\Python25python C:\web2pyy\web2py.py
  WARNING:root:no file locking
  web2py Enterprise Web Framework
  Created by Massimo Di Pierro, Copyright 2007-2010
  Version 1.76.3 (2010-03-03 16:58:56)
  Database drivers available: SQLite3, MySQL
  Starting cron...
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  please visit:
         http://127.0.0.1:8000
  starting browser...in 5 seconds
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
  WARNING:root:WEB2PY CRON: Disabled because no file locking
  ERROR:root:corrupted file: 

[web2py] Re: how to use GAE deferred

2010-03-09 Thread Richard
Actually it seems only module functions can be deferred. If I try
deferring a controller of model function then I get this error:
PicklingError: Can't pickle function test at 0xa743ca4: it's not
found as __main__.test

However I need my deferred function to interact with the database. Any
ideas??



On Mar 8, 3:44 pm, Richard richar...@gmail.com wrote:
 found they need to go in modules/models rather than controllers.
 However one model function can't defer another model function...

 On Mar 8, 12:49 pm, waTR r...@devshell.org wrote:



  I too am interested in this...

  On Mar 7, 2:44 pm, Richard richar...@gmail.com wrote:

   I am adding some background work to my web2py GAE app with the
   deferred library:http://code.google.com/appengine/articles/deferred.html

   As the article suggests I have added this to app.yaml:
   - url: /_ah/queue/deferred
       script: $PYTHON_LIB/google/appengine/ext/deferred/deferred.py
       login: admin

   The article also says You can't call a method in the request handler
   module - what does that correspond to in web2py?

   Any other advice about using Deferred / Task Queues through web2py
   would be welcome.

   Richard

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] [Feature request] Caching at DAL level

2010-03-09 Thread Praneeth
Hello all,

I was wondering if DAL level caching could be added. I am aware of
cache.ram and cache.disk, but these require the usage of a decorator
over the functions. I feel that a cache option to cache at the DAL level
that could be enabled by flipping an option in db.py of an application
would be of great help. The cache can be a key value pair of sorts,
where the cache is flushed on each write/update and cached on the first
read - There are probably smarter ways of doing this.

Thoughts?

--
Praneeth

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] plugin tablewizard

2010-03-09 Thread selecta
Hi there,
I had the idea of creating a table wizard but after creating part of
it I realized that I will not need it after all. It is unfinished and
does not actually do much beyond showing the source code and the table
form. Lots of things to not work e.g. validators

Maybe it is helpful for people who learn web2py or for somebody who
had the same idea to pick up from where I started.

screenshot 
http://jaguar.biologie.hu-berlin.de/~fkrause/screenshot_tablewizard.png
videodemo 
http://jaguar.biologie.hu-berlin.de/~fkrause/screencast_tablewizard.ogv
download 
http://jaguar.biologie.hu-berlin.de/~fkrause/web2py.plugin.tablewizard.w2p

I will provide no bugfixes but I will reply to questions if there are
any

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: web2py.com is down !!?!

2010-03-09 Thread mr.freeze
Massimo, my IP is still blocked too. You should have it in email with
the iptables command to whitelist it :)

On Mar 9, 9:07 am, mdipierro mdipie...@cs.depaul.edu wrote:
 It not down but I may be blocking your IP.
 I have a script that blocks lot of IP if it thinks there is a denial
 of service attack of a directory traversal attack.
 What is your ip?

 Massimo

 On Mar 9, 2:18 am, Sky hmonfa...@gmail.com wrote:

  as I see web2py.com is down since 2 days ago.
  is there any body to inform the site administrator ???



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: how to use GAE deferred

2010-03-09 Thread Richard
I guess I could use gql directly to access the database, but I would
prefer to have a single syntax for accessing the database.

(controller of model - controller or model)


On Mar 9, 10:25 pm, Richard richar...@gmail.com wrote:
 Actually it seems only module functions can be deferred. If I try
 deferring a controller of model function then I get this error:
 PicklingError: Can't pickle function test at 0xa743ca4: it's not
 found as __main__.test

 However I need my deferred function to interact with the database. Any
 ideas??

 On Mar 8, 3:44 pm, Richard richar...@gmail.com wrote:



  found they need to go in modules/models rather than controllers.
  However one model function can't defer another model function...

  On Mar 8, 12:49 pm, waTR r...@devshell.org wrote:

   I too am interested in this...

   On Mar 7, 2:44 pm, Richard richar...@gmail.com wrote:

I am adding some background work to my web2py GAE app with the
deferred library:http://code.google.com/appengine/articles/deferred.html

As the article suggests I have added this to app.yaml:
- url: /_ah/queue/deferred
    script: $PYTHON_LIB/google/appengine/ext/deferred/deferred.py
    login: admin

The article also says You can't call a method in the request handler
module - what does that correspond to in web2py?

Any other advice about using Deferred / Task Queues through web2py
would be welcome.

Richard

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: web2py.com is down !!?!

2010-03-09 Thread mdipierro
I thought I did fix that and I added you to the whitelist. I will take
a second look.

Massimo

On Mar 9, 9:10 am, mr.freeze nat...@freezable.com wrote:
 Massimo, my IP is still blocked too. You should have it in email with
 the iptables command to whitelist it :)

 On Mar 9, 9:07 am, mdipierro mdipie...@cs.depaul.edu wrote:

  It not down but I may be blocking your IP.
  I have a script that blocks lot of IP if it thinks there is a denial
  of service attack of a directory traversal attack.
  What is your ip?

  Massimo

  On Mar 9, 2:18 am, Sky hmonfa...@gmail.com wrote:

   as I see web2py.com is down since 2 days ago.
   is there any body to inform the site administrator ???

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Caching at DAL level

2010-03-09 Thread mdipierro
It is there already.

values=db(...).select(cache=(cache.disk,3600))

3600 is the time.

On Mar 9, 5:23 am, Praneeth life...@gmail.com wrote:
 Hello all,

 I was wondering if DAL level caching could be added. I am aware of
 cache.ram and cache.disk, but these require the usage of a decorator
 over the functions. I feel that a cache option to cache at the DAL level
 that could be enabled by flipping an option in db.py of an application
 would be of great help. The cache can be a key value pair of sorts,
 where the cache is flushed on each write/update and cached on the first
 read - There are probably smarter ways of doing this.

 Thoughts?

 --
 Praneeth

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: More Questions About Compatibility

2010-03-09 Thread Timothy Farrell
It's never that easy.  Magnitus, you can use LightTPD on Windows.  I'm 
not sure if it will satisfy the 64-bit requirement though.  I've gotten 
web2py working through FastCGI on LightTPD on windows.  Because web2py 
runs as a separate process, it can be 64-bit while Lighttpd runs 
32-bit.  Since Lighttpd is only the HTTP-FCGI translator, it won't be 
hindered by running 32-bit.  You can get Lighty for windows here:


http://en.wlmp-project.net/downloads.php

-tim

On 3/8/2010 3:27 PM, Albert Abril wrote:

I know it could sounds cruel, but.. try to leave windows

On Mon, Mar 8, 2010 at 3:49 PM, Magnitus eric_vallee2...@yahoo.ca 
mailto:eric_vallee2...@yahoo.ca wrote:


 LOL.  That ambiguous phrasing may be enough to tip Graham Dumpleton
 over the edge!

Yes, well, unless I'm using the language of mathematics, I'm not the
best of communicator for technical stuff. I apologize.

 Others have also spoken enthusiastically about Lighttpd / Nginx in
 terms of speed,  and a smaller memory footprint too, so try
searching
 the group. See these for example:

Problem is that I'm developing for windows.

I don't have anything against Linux, but learning how to use it in
most of the gory details (so that I can run a server on it) would be
too much of an overhead at this point in time considering the other
things I have to pick up (the only thing I'd pick up reasonably
quickly are the C system calls).

Nginx's window version is beta (http://nginx.org/en/docs/
windows.html http://nginx.org/en/docs/%0Awindows.html).

Cherokee's window version is broken (and will be beta for a while once
its functional again).

Lighttpd doesn't work on Windows.

I'm not sure how well IIS works with anything that is not C# or VB for
the web framework and I'm not ready to capitulate to C# just yet.

I guess I'll try to figure out how to compile Apache on a newish
rendition of windows in 64 bits a bit longer. I found some interesting
links for that.

--
You received this message because you are subscribed to the Google
Groups web2py-users group.
To post to this group, send email to web2py@googlegroups.com
mailto:web2py@googlegroups.com.
To unsubscribe from this group, send email to
web2py+unsubscr...@googlegroups.com
mailto:web2py%2bunsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.


--
You received this message because you are subscribed to the Google 
Groups web2py-users group.

To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


--
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

image/gif

[web2py] Re: how to set 2 web2py-component-commands

2010-03-09 Thread mdipierro
response.headers['web2py-component-command']
='web2py_ajax_page(GET,%s,,table_code);web2py_ajax_page(GET,%s,,table_details);'
%
(URL(r=request,f='table_code',args=[table_id]),URL(r=request,f='table',args=[table_id]))

On Mar 9, 4:24 am, selecta gr...@delarue-berlin.de wrote:
 in my controller I got

 response.headers['web2py-component-command'] =
 'web2py_ajax_page(GET,%s,,table_code)' %
 URL(r=request,f='table_code',args=[table_id])

 But now I want to update two components. The following does not work

 response.headers['web2py-component-command'] =
 'web2py_ajax_page(GET,%s,,table_code);' %
 URL(r=request,f='table_code',args=[table_id])
         #response.headers['web2py-component-command'] +=
 ';web2py_ajax_page(GET,%s,,table_details);' %
 URL(r=request,f='table',args=[table_id])

 I do not really have an idea how to solve that, help is appreciated :)

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: announcement

2010-03-09 Thread mdipierro
You are running from source and did not install Mark Mahmmond win32
extensions.

On Mar 9, 1:08 am, Debebe Asefa asefa.deb...@gmail.com wrote:
 Why the following error messages:

 Microsoft Windows [Version 6.0.6002]
 Copyright (c) 2006 Microsoft Corporation.  All rights reserved.
 C:\Users\Usercd ..
 C:\Userscd ..
 C:\cd python25
 C:\Python25python C:\web2pyy\web2py.py
 WARNING:root:no file locking
 web2py Enterprise Web Framework
 Created by Massimo Di Pierro, Copyright 2007-2010
 Version 1.76.3 (2010-03-03 16:58:56)
 Database drivers available: SQLite3, MySQL
 Starting cron...
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 please visit:
        http://127.0.0.1:8000
 starting browser...in 5 seconds
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 ERROR:root:corrupted file: C:\web2pyy\applications\EMR/cache/cache.shelve
 WARNING:root:WEB2PY CRON: Disabled because no file locking
 WARNING:root:WEB2PY CRON: Disabled because no file 

Re: [web2py] web2py.com is down !!?!

2010-03-09 Thread Thadeus Burgess
Has been working for me.

-Thadeus





On Tue, Mar 9, 2010 at 3:47 AM, Jason Brower encomp...@gmail.com wrote:
 Works for me (:
 On Tue, 2010-03-09 at 00:18 -0800, Sky wrote:
 as I see web2py.com is down since 2 days ago.
 is there any body to inform the site administrator ???



 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@googlegroups.com.
 To unsubscribe from this group, send email to 
 web2py+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/web2py?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: plugin tablewizard

2010-03-09 Thread mdipierro
nice

On Mar 9, 4:57 am, selecta gr...@delarue-berlin.de wrote:
 Hi there,
 I had the idea of creating a table wizard but after creating part of
 it I realized that I will not need it after all. It is unfinished and
 does not actually do much beyond showing the source code and the table
 form. Lots of things to not work e.g. validators

 Maybe it is helpful for people who learn web2py or for somebody who
 had the same idea to pick up from where I started.

 screenshothttp://jaguar.biologie.hu-berlin.de/~fkrause/screenshot_tablewizard.png
 videodemohttp://jaguar.biologie.hu-berlin.de/~fkrause/screencast_tablewizard.ogv
 downloadhttp://jaguar.biologie.hu-berlin.de/~fkrause/web2py.plugin.tablewizar...

 I will provide no bugfixes but I will reply to questions if there are
 any

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] web2py.com is down !!?!

2010-03-09 Thread Richard Shebora
no problem seeing it here.

Thanks,
Richard Shebora

On Tue, Mar 9, 2010 at 9:57 AM, Thadeus Burgess thade...@thadeusb.com wrote:
 Has been working for me.

 -Thadeus





 On Tue, Mar 9, 2010 at 3:47 AM, Jason Brower encomp...@gmail.com wrote:
 Works for me (:
 On Tue, 2010-03-09 at 00:18 -0800, Sky wrote:
 as I see web2py.com is down since 2 days ago.
 is there any body to inform the site administrator ???



 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@googlegroups.com.
 To unsubscribe from this group, send email to 
 web2py+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/web2py?hl=en.



 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@googlegroups.com.
 To unsubscribe from this group, send email to 
 web2py+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/web2py?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: exposing crossdomain.xml

2010-03-09 Thread iggass
They did work after I had restarted the server, no problem with that.
I wonder if there is any clean way to expose static resources which
don't belong to any particular application? Some sort of root static
folder...

On Mar 9, 1:53 am, stephen stephenino...@gmail.com wrote:
 Hello iggass,

 The snippets of code you submitted should work if your web2py
 application is named app. Is that the case? If not just change

 '/app/static/crossdomain.xml'

 to

 '/myappname/static/crossdomain.xml'

 where myappname is the application that has the crossdomain.xml in
 its static folder.

 Stephen

 On Mar 8, 4:14 pm, iggass gas...@gmail.com wrote:



  Hello,

  I'm running web2py (v1.76.1 on Win 2K3) server for development
  purposes.
  I would like to expose 'crossdomain.xml' at the top level of my site
  for the sake of providing AMF service and being able to access it from
  another domain, like:http://example.com:8000/crossdomain.xml

  As far as I understand, the only (and not so aesthetic) way to do it,
  is to rewrite URL using 'routes.py'.
  So I placed crossdomain.xml in the 'static' folder of my application,
  and created 'routes.py' under 'web2py' folder with the following
  content:
  routes_in = (('.*:/crossdomain.xml', '/app/static/crossdomain.xml'),)

  However, it doesn't work, I'm getting 'Invalid request'.
  So I tried (as Massimo suggested 
  herehttp://www.mail-archive.com/web2py@googlegroups.com/msg26278.html):
  routes_in = (('/crossdomain.xml', '/app/static/crossdomain.xml'),)
  to no avail.

  I'd greatly appreciate any help!

  Thanks

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: announcement

2010-03-09 Thread dbb
Yes, there are access limitaions due to HIPAA and other rules and
regulations, a patient record can be accessed only for meaningful use,
i.e., to treat the patient and the record is confidential.

On Mar 8, 10:28 am, Wes James compte...@gmail.com wrote:
 on another thread it looks like you need to register as a doctor to
 get full access.



 On Sun, Mar 7, 2010 at 10:13 PM, Jason Brower encomp...@gmail.com wrote:
  What is the username and pass for the demo site?
  BR,
  Jason- Hide quoted text -

 - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: exposing crossdomain.xml

2010-03-09 Thread iggass
I did, but apparently soft restart doesn't work. When I closed the
process, everything started working.
Thanks!

On Mar 9, 2:30 am, mr.freeze nat...@freezable.com wrote:
 Your route works for me. Did you restart the server?

 On Mar 8, 3:14 pm, iggass gas...@gmail.com wrote:



  Hello,

  I'm running web2py (v1.76.1 on Win 2K3) server for development
  purposes.
  I would like to expose 'crossdomain.xml' at the top level of my site
  for the sake of providing AMF service and being able to access it from
  another domain, like:http://example.com:8000/crossdomain.xml

  As far as I understand, the only (and not so aesthetic) way to do it,
  is to rewrite URL using 'routes.py'.
  So I placed crossdomain.xml in the 'static' folder of my application,
  and created 'routes.py' under 'web2py' folder with the following
  content:
  routes_in = (('.*:/crossdomain.xml', '/app/static/crossdomain.xml'),)

  However, it doesn't work, I'm getting 'Invalid request'.
  So I tried (as Massimo suggested 
  herehttp://www.mail-archive.com/web2py@googlegroups.com/msg26278.html):
  routes_in = (('/crossdomain.xml', '/app/static/crossdomain.xml'),)
  to no avail.

  I'd greatly appreciate any help!

  Thanks

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: announcement

2010-03-09 Thread dbb
Yes, the application is based on HL7 ( health level 7 ) protocol which
is embrassed by HHS. The application can be created as follows:
- how to create the binary codes

 Download web2py binary
Unzip it (do not run it)
Under applications create a folder init
Copy the web2pyhl7 app under init so that you have
applications/init/
models/db.py etc.
Rezip the web2py folder. Done

Mind when you make the binaries that migaret has to be set to True
or
False depending on whether you pack the databases/* and mind that
models/db.py hardcode my emai settings and assumes postfix running
on
localhost.


On Mar 8, 4:12 pm, mikech mp.ch...@gmail.com wrote:
 Congratulations!
 Will you be writing anything about th ecreation of this app?

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Getting out from under web2py.py 's environment building magic.

2010-03-09 Thread Timothy Farrell
Also remember that web2py is GPL.  So your application becomes GPL (if 
it wasn't already) by importing the DAL.


-tim

On 3/5/2010 1:34 PM, compassiontara wrote:

On Mar 5, 6:17 am, mdipierromdipie...@cs.depaul.edu  wrote:
   

On Mar 5, 1:33 am, compassiontarat...@birl.org  wrote:

 

I'll probably get flamed for talking about this...
   

Hope not. You have a very good example.
Just as a side, you do not necessarily need to copy web2py for the
script to work, just add 'gluon' to sys.path.
 

Thanks!  this is correct, you can just add gluon to your sys.path, but
web2py doesn't by default install itself in the system path(s).  So
unless I'm missing something you can't use setuptools to require
web2py, and leech from there (it would be nice if you could), but that
would require changing how gluon import's itself to reference itself
instead of assuming everything is local.
i.e. instead of:
 import poralocker
it would be:
 from gluon import portalocker

This does require that gluon be part of sys.path, which would then
encourage a 'setup.py' or similar to copy it over.  Then it would be
much easier for external code to use gluon as a library module, and
avoid mucking about with sys.path all the time.

Unless I'm missing something, which is very possible.

With Love,
Tara

   


--
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] web2py and gdata api (on GAE)

2010-03-09 Thread mooose
Hello,
just started with web2py and looking for some advice how to use Gdata
apis with web2py.

How to include the gdata apis and what would be the best place to
initialize them as needed.

Thanks
Siegfried

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: web2py beautification

2010-03-09 Thread villas
On Mar 8, 10:31 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 Why do we need a grid system again? Why does this belong to web2py? I
 am not convinced.

I didn't know that you previously had a grid and I agree that divs are
not so easy and tables are more predictable and reliable.  However,
tables will seldom be chosen as a basis for attractive designs these
days and this thread is named 'beautification' :-)   I believe that
people will continue to move away from table layouts to embrace CSS in
more inventive ways.

Of course we can all go off and do our 'own thing'.  However,  it
would still be nice if the community could choose an acceptable layout
using divs and common names which could be used as a foundation for
our individual efforts.  We could then possibly tempt more people to
design good templates,  or better still, use a stock of templates that
have been designed for other projects.

Clearly,  the solution must be bulletproof,  low or zero maintenance
and simple.  I am just trying to help in exploring the idea and I do
not necessarily think the answer is a grid,  although that system does
have benefits.

-David

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Caching at DAL level

2010-03-09 Thread mdipierro
You can do that if after insert/update/delete you do

db(...).select(cache=(cache.disk,0))

Massimo

On Mar 9, 9:06 am, Praneeth life...@gmail.com wrote:
 Would it be better to have a non time based caching? Say refresh cache
 on DB update?
 Time based caching requires guessing the cache time - which in my
 opinion seems like a bad thing to do.

 Thoughts?

 --
 Praneeth

 On 03/09/2010 08:33 PM, mdipierro wrote:

  It is there already.

  values=db(...).select(cache=(cache.disk,3600))

  3600 is the time.

  On Mar 9, 5:23 am, Praneeth life...@gmail.com wrote:

  Hello all,

  I was wondering if DAL level caching could be added. I am aware of
  cache.ram and cache.disk, but these require the usage of a decorator
  over the functions. I feel that a cache option to cache at the DAL level
  that could be enabled by flipping an option in db.py of an application
  would be of great help. The cache can be a key value pair of sorts,
  where the cache is flushed on each write/update and cached on the first
  read - There are probably smarter ways of doing this.

  Thoughts?

  --
  Praneeth

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Could webp2y do it like Pylons?

2010-03-09 Thread Jon Romero
I've seen that Pylons has an AWESOME debugger.
Every time an error occurs, you have an AJAX console where you can
inspect elements!

This is waaay more useful than tickets (at least on development)
where you click a ticket, go to the new page, read the error, do a
print in your code so you can inspect the element, close the ticket
page and refresh to get a new ticket, go to the error page, watch the
error etc etc ...

How difficult is to add something like this in to web2py?

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Could webp2y do it like Pylons?

2010-03-09 Thread mdipierro
Let me think about this.
We could:
1) save the response._environment in ram
2) if logged in user is admin allow the user to open a web2py shell in
the above environment.
the main problem is what do we do with database transactions? when do
we close them?

Massimo

On Mar 9, 10:17 am, Jon Romero darks...@gmail.com wrote:
 I've seen that Pylons has an AWESOME debugger.
 Every time an error occurs, you have an AJAX console where you can
 inspect elements!

 This is waaay more useful than tickets (at least on development)
 where you click a ticket, go to the new page, read the error, do a
 print in your code so you can inspect the element, close the ticket
 page and refresh to get a new ticket, go to the error page, watch the
 error etc etc ...

 How difficult is to add something like this in to web2py?

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Getting out from under web2py.py 's environment building magic.

2010-03-09 Thread Thadeus Burgess
NO.

Your application only becomes GPL if you INCLUDE(ie: distribute) the
DAL with your program, not if it only USES the DAL, and the client
has to install web2py themselves.

-Thadeus





On Tue, Mar 9, 2010 at 7:52 AM, Timothy Farrell tfarr...@swgen.com wrote:
 Also remember that web2py is GPL.  So your application becomes GPL (if it
 wasn't already) by importing the DAL.

 -tim

 On 3/5/2010 1:34 PM, compassiontara wrote:

 On Mar 5, 6:17 am, mdipierromdipie...@cs.depaul.edu  wrote:


 On Mar 5, 1:33 am, compassiontarat...@birl.org  wrote:



 I'll probably get flamed for talking about this...


 Hope not. You have a very good example.
 Just as a side, you do not necessarily need to copy web2py for the
 script to work, just add 'gluon' to sys.path.


 Thanks!  this is correct, you can just add gluon to your sys.path, but
 web2py doesn't by default install itself in the system path(s).  So
 unless I'm missing something you can't use setuptools to require
 web2py, and leech from there (it would be nice if you could), but that
 would require changing how gluon import's itself to reference itself
 instead of assuming everything is local.
 i.e. instead of:
     import poralocker
 it would be:
     from gluon import portalocker

 This does require that gluon be part of sys.path, which would then
 encourage a 'setup.py' or similar to copy it over.  Then it would be
 much easier for external code to use gluon as a library module, and
 avoid mucking about with sys.path all the time.

 Unless I'm missing something, which is very possible.

 With Love,
 Tara



 --
 You received this message because you are subscribed to the Google Groups
 web2py-users group.
 To post to this group, send email to web...@googlegroups.com.
 To unsubscribe from this group, send email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/web2py?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Caching at DAL level

2010-03-09 Thread Thadeus Burgess
What if the cache system includes a category or type field. All
cached SQL could be of type SQL, and then say responses can be
cached as RESP. This way if you refresh the cache instead of
clearing the entire thing, we can specify

cache.ram.clear(type=SQL) and it will only clear the sql typed
entries, leaving other aspects of the cache alone.

however cache.ram.clear() will still clear everything.

That way, the DAL could be set a flag to clear its own cache upon
i/u/d operations.

How does this sound? If good I can start on the patch right away :)

-Thadeus





On Tue, Mar 9, 2010 at 10:08 AM, mdipierro mdipie...@cs.depaul.edu wrote:
 You can do that if after insert/update/delete you do

 db(...).select(cache=(cache.disk,0))

 Massimo

 On Mar 9, 9:06 am, Praneeth life...@gmail.com wrote:
 Would it be better to have a non time based caching? Say refresh cache
 on DB update?
 Time based caching requires guessing the cache time - which in my
 opinion seems like a bad thing to do.

 Thoughts?

 --
 Praneeth

 On 03/09/2010 08:33 PM, mdipierro wrote:

  It is there already.

  values=db(...).select(cache=(cache.disk,3600))

  3600 is the time.

  On Mar 9, 5:23 am, Praneeth life...@gmail.com wrote:

  Hello all,

  I was wondering if DAL level caching could be added. I am aware of
  cache.ram and cache.disk, but these require the usage of a decorator
  over the functions. I feel that a cache option to cache at the DAL level
  that could be enabled by flipping an option in db.py of an application
  would be of great help. The cache can be a key value pair of sorts,
  where the cache is flushed on each write/update and cached on the first
  read - There are probably smarter ways of doing this.

  Thoughts?

  --
  Praneeth

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@googlegroups.com.
 To unsubscribe from this group, send email to 
 web2py+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/web2py?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Could webp2y do it like Pylons?

2010-03-09 Thread Jon Romero

On Mar 9, 6:28 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 Let me think about this.
 We could:
 1) save the response._environment in ram
 2) if logged in user is admin allow the user to open a web2py shell in
 the above environment.

Yes!

 the main problem is what do we do with database transactions? when do
 we close them?

Whatever happened before the crush, should be stored (db.commit()).
After that, it's like the normal web2py shell (user has to commit by
himself).



 Massimo

 On Mar 9, 10:17 am, Jon Romero darks...@gmail.com wrote:



  I've seen that Pylons has an AWESOME debugger.
  Every time an error occurs, you have an AJAX console where you can
  inspect elements!

  This is waaay more useful than tickets (at least on development)
  where you click a ticket, go to the new page, read the error, do a
  print in your code so you can inspect the element, close the ticket
  page and refresh to get a new ticket, go to the error page, watch the
  error etc etc ...

  How difficult is to add something like this in to web2py?

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] uWSGI

2010-03-09 Thread mdipierro
I was reading this and I read:

web2py does not work well on multiple application environment so you
have to use it as the only WSGI application of the uWSGI server. 

I am not sure I understand the comment.

I think this originates from a misunderstanding and, in fact, the
problem is in the script that follows that they use as example since
it does chdir. The script instead should be

   import os, sys
   os.environ['web2py_path'] = full_path_of_your_web2py_app
   sys.path.append(os.environ['web2py_path'])
   import gluon.main, gluon.settings
   application = gluon.main.wsgibase

this should work and will not do chdir.

Somebody should tell them but I did not find contact info on the page.

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Could webp2y do it like Pylons?

2010-03-09 Thread mdipierro
Problem is that database is closed when the page returns (and rolled
back) so any attempt to use db will result in database closed. This
is the hard part.

On Mar 9, 10:33 am, Jon Romero darks...@gmail.com wrote:
 On Mar 9, 6:28 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  Let me think about this.
  We could:
  1) save the response._environment in ram
  2) if logged in user is admin allow the user to open a web2py shell in
  the above environment.

 Yes!

  the main problem is what do we do with database transactions? when do
  we close them?

 Whatever happened before the crush, should be stored (db.commit()).
 After that, it's like the normal web2py shell (user has to commit by
 himself).



  Massimo

  On Mar 9, 10:17 am, Jon Romero darks...@gmail.com wrote:

   I've seen that Pylons has an AWESOME debugger.
   Every time an error occurs, you have an AJAX console where you can
   inspect elements!

   This is waaay more useful than tickets (at least on development)
   where you click a ticket, go to the new page, read the error, do a
   print in your code so you can inspect the element, close the ticket
   page and refresh to get a new ticket, go to the error page, watch the
   error etc etc ...

   How difficult is to add something like this in to web2py?

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Caching at DAL level

2010-03-09 Thread mdipierro
You can already do

cache.ram.clear(db._uri + '/SELECT')

and it will clear all cached select statements. You have to specify
db._uri because you may have multiple db cached.

Massimo

On Mar 9, 10:37 am, Thadeus Burgess thade...@thadeusb.com wrote:
 What if the cache system includes a category or type field. All
 cached SQL could be of type SQL, and then say responses can be
 cached as RESP. This way if you refresh the cache instead of
 clearing the entire thing, we can specify

 cache.ram.clear(type=SQL) and it will only clear the sql typed
 entries, leaving other aspects of the cache alone.

 however cache.ram.clear() will still clear everything.

 That way, the DAL could be set a flag to clear its own cache upon
 i/u/d operations.

 How does this sound? If good I can start on the patch right away :)

 -Thadeus

 On Tue, Mar 9, 2010 at 10:08 AM, mdipierro mdipie...@cs.depaul.edu wrote:
  You can do that if after insert/update/delete you do

  db(...).select(cache=(cache.disk,0))

  Massimo

  On Mar 9, 9:06 am, Praneeth life...@gmail.com wrote:
  Would it be better to have a non time based caching? Say refresh cache
  on DB update?
  Time based caching requires guessing the cache time - which in my
  opinion seems like a bad thing to do.

  Thoughts?

  --
  Praneeth

  On 03/09/2010 08:33 PM, mdipierro wrote:

   It is there already.

   values=db(...).select(cache=(cache.disk,3600))

   3600 is the time.

   On Mar 9, 5:23 am, Praneeth life...@gmail.com wrote:

   Hello all,

   I was wondering if DAL level caching could be added. I am aware of
   cache.ram and cache.disk, but these require the usage of a decorator
   over the functions. I feel that a cache option to cache at the DAL level
   that could be enabled by flipping an option in db.py of an application
   would be of great help. The cache can be a key value pair of sorts,
   where the cache is flushed on each write/update and cached on the first
   read - There are probably smarter ways of doing this.

   Thoughts?

   --
   Praneeth

  --
  You received this message because you are subscribed to the Google Groups 
  web2py-users group.
  To post to this group, send email to web...@googlegroups.com.
  To unsubscribe from this group, send email to 
  web2py+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Could webp2y do it like Pylons?

2010-03-09 Thread Jon Romero
I don't think this is a problem.

If I wanted to check the data of db, I would use a sqlite viewer (or a
mysql viewer). 99% of cases I just want to
check a variable, sessions or vars/args. I don't want to have a full
blown terminal to experiment.
Just a screen where I can poke around, see what is the problem,
correct it on my code and refresh the page.
If something is wrong with my data, I always find it easier/faster to
check them with a viewer.

On Mar 9, 6:57 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 Problem is that database is closed when the page returns (and rolled
 back) so any attempt to use db will result in database closed. This
 is the hard part.

 On Mar 9, 10:33 am, Jon Romero darks...@gmail.com wrote:



  On Mar 9, 6:28 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   Let me think about this.
   We could:
   1) save the response._environment in ram
   2) if logged in user is admin allow the user to open a web2py shell in
   the above environment.

  Yes!

   the main problem is what do we do with database transactions? when do
   we close them?

  Whatever happened before the crush, should be stored (db.commit()).
  After that, it's like the normal web2py shell (user has to commit by
  himself).

   Massimo

   On Mar 9, 10:17 am, Jon Romero darks...@gmail.com wrote:

I've seen that Pylons has an AWESOME debugger.
Every time an error occurs, you have an AJAX console where you can
inspect elements!

This is waaay more useful than tickets (at least on development)
where you click a ticket, go to the new page, read the error, do a
print in your code so you can inspect the element, close the ticket
page and refresh to get a new ticket, go to the error page, watch the
error etc etc ...

How difficult is to add something like this in to web2py?

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] problem with crud.archive when deleting

2010-03-09 Thread Rowdy

Greetings,

I have been playing a little with crud.archive, as advertised by Massimo
in a post on 13-Feb-2010.  It's fantastic :-)

... except when deleting data.

When I try to delete, I get this:

Traceback (most recent call last):
  File /home/rowdy/web2py/gluon/restricted.py, line 173, in restricted
exec ccode in environment
  File 
/home/rowdy/web2py/applications/webacc2/controllers/table_codes.py, 
line 652, in module

  File /home/rowdy/web2py/gluon/globals.py, line 96, in lambda
self._caller = lambda f: f()
  File /home/rowdy/web2py/gluon/tools.py, line 1892, in f
return action(*a, **b)
  File 
/home/rowdy/web2py/applications/webacc2/controllers/table_codes.py, 
line 364, in project_update

form = crud.update(db.project, row, onaccept = crud.archive)
  File /home/rowdy/web2py/gluon/tools.py, line 2391, in update
onaccept(form)
  File /home/rowdy/web2py/gluon/tools.py, line 2295, in archive
id = archive_table.insert(**new_record)
  File /home/rowdy/web2py/gluon/sql.py, line 1879, in insert
self._db._execute(query)
  File /home/rowdy/web2py/gluon/sql.py, line 958, in lambda
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
IntegrityError: insert or update on table project_archive violates 
foreign key constraint project_archive_current_record_fkey

DETAIL:  Key (current_record)=(31372) is not present in table project.

Actually I would expect this.  When Crud.archive() inserts data into the
archive table, it populates the 'current_record' column with the id of
the row that has just been deleted from the main table.  Thus the
foreign key constraint fails, with the above error.

I am not sure if the following is the most web2pythoninc way of fixing
it, but I implemented the following work-around in Crud.archive() just
after the test for if not old_record:

if form.request_vars.delete_this_record == 'on':
return None

Rowdy

--
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Caching at DAL level

2010-03-09 Thread Thadeus Burgess
So an option to DAL.__init__(auto_cache=False, clear_cache_on_update=False) ?

auto_cache does an infinity cache time, where if there is any updates
done to the db all cached selects are cleared and alternatively an
option to only clear cached selects that have to do with the table
that is selected.

I feel about 50% on the idea... not sure I want every single select I
make automatically cached, you definitely wouldn't want this if your
competing for RAM, but if you can afford the RAM this would be nice.

-Thadeus





On Tue, Mar 9, 2010 at 11:00 AM, mdipierro mdipie...@cs.depaul.edu wrote:
 You can already do

 cache.ram.clear(db._uri + '/SELECT')

 and it will clear all cached select statements. You have to specify
 db._uri because you may have multiple db cached.

 Massimo

 On Mar 9, 10:37 am, Thadeus Burgess thade...@thadeusb.com wrote:
 What if the cache system includes a category or type field. All
 cached SQL could be of type SQL, and then say responses can be
 cached as RESP. This way if you refresh the cache instead of
 clearing the entire thing, we can specify

 cache.ram.clear(type=SQL) and it will only clear the sql typed
 entries, leaving other aspects of the cache alone.

 however cache.ram.clear() will still clear everything.

 That way, the DAL could be set a flag to clear its own cache upon
 i/u/d operations.

 How does this sound? If good I can start on the patch right away :)

 -Thadeus

 On Tue, Mar 9, 2010 at 10:08 AM, mdipierro mdipie...@cs.depaul.edu wrote:
  You can do that if after insert/update/delete you do

  db(...).select(cache=(cache.disk,0))

  Massimo

  On Mar 9, 9:06 am, Praneeth life...@gmail.com wrote:
  Would it be better to have a non time based caching? Say refresh cache
  on DB update?
  Time based caching requires guessing the cache time - which in my
  opinion seems like a bad thing to do.

  Thoughts?

  --
  Praneeth

  On 03/09/2010 08:33 PM, mdipierro wrote:

   It is there already.

   values=db(...).select(cache=(cache.disk,3600))

   3600 is the time.

   On Mar 9, 5:23 am, Praneeth life...@gmail.com wrote:

   Hello all,

   I was wondering if DAL level caching could be added. I am aware of
   cache.ram and cache.disk, but these require the usage of a decorator
   over the functions. I feel that a cache option to cache at the DAL 
   level
   that could be enabled by flipping an option in db.py of an application
   would be of great help. The cache can be a key value pair of sorts,
   where the cache is flushed on each write/update and cached on the first
   read - There are probably smarter ways of doing this.

   Thoughts?

   --
   Praneeth

  --
  You received this message because you are subscribed to the Google Groups 
  web2py-users group.
  To post to this group, send email to web...@googlegroups.com.
  To unsubscribe from this group, send email to 
  web2py+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/web2py?hl=en.

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@googlegroups.com.
 To unsubscribe from this group, send email to 
 web2py+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/web2py?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Could webp2y do it like Pylons?

2010-03-09 Thread Thadeus Burgess
Kinda like django's stacktraces ?

I have been an advocate for this for a while, yet since I have been
using WingIDE debugger I havn't really needed this.

-Thadeus





On Tue, Mar 9, 2010 at 11:10 AM, Jon Romero darks...@gmail.com wrote:
 I don't think this is a problem.

 If I wanted to check the data of db, I would use a sqlite viewer (or a
 mysql viewer). 99% of cases I just want to
 check a variable, sessions or vars/args. I don't want to have a full
 blown terminal to experiment.
 Just a screen where I can poke around, see what is the problem,
 correct it on my code and refresh the page.
 If something is wrong with my data, I always find it easier/faster to
 check them with a viewer.

 On Mar 9, 6:57 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 Problem is that database is closed when the page returns (and rolled
 back) so any attempt to use db will result in database closed. This
 is the hard part.

 On Mar 9, 10:33 am, Jon Romero darks...@gmail.com wrote:



  On Mar 9, 6:28 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   Let me think about this.
   We could:
   1) save the response._environment in ram
   2) if logged in user is admin allow the user to open a web2py shell in
   the above environment.

  Yes!

   the main problem is what do we do with database transactions? when do
   we close them?

  Whatever happened before the crush, should be stored (db.commit()).
  After that, it's like the normal web2py shell (user has to commit by
  himself).

   Massimo

   On Mar 9, 10:17 am, Jon Romero darks...@gmail.com wrote:

I've seen that Pylons has an AWESOME debugger.
Every time an error occurs, you have an AJAX console where you can
inspect elements!

This is waaay more useful than tickets (at least on development)
where you click a ticket, go to the new page, read the error, do a
print in your code so you can inspect the element, close the ticket
page and refresh to get a new ticket, go to the error page, watch the
error etc etc ...

How difficult is to add something like this in to web2py?

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@googlegroups.com.
 To unsubscribe from this group, send email to 
 web2py+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/web2py?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: problem with crud.archive when deleting

2010-03-09 Thread mdipierro
If you use archive you should not never delete records. You should
only have an active field and filter out the inavtice ones.

On Mar 8, 11:33 pm, Rowdy da...@fielden.com.au wrote:
 Greetings,

 I have been playing a little with crud.archive, as advertised by Massimo
 in a post on 13-Feb-2010.  It's fantastic :-)

 ... except when deleting data.

 When I try to delete, I get this:

 Traceback (most recent call last):
    File /home/rowdy/web2py/gluon/restricted.py, line 173, in restricted
      exec ccode in environment
    File
 /home/rowdy/web2py/applications/webacc2/controllers/table_codes.py,
 line 652, in module
    File /home/rowdy/web2py/gluon/globals.py, line 96, in lambda
      self._caller = lambda f: f()
    File /home/rowdy/web2py/gluon/tools.py, line 1892, in f
      return action(*a, **b)
    File
 /home/rowdy/web2py/applications/webacc2/controllers/table_codes.py,
 line 364, in project_update
      form = crud.update(db.project, row, onaccept = crud.archive)
    File /home/rowdy/web2py/gluon/tools.py, line 2391, in update
      onaccept(form)
    File /home/rowdy/web2py/gluon/tools.py, line 2295, in archive
      id = archive_table.insert(**new_record)
    File /home/rowdy/web2py/gluon/sql.py, line 1879, in insert
      self._db._execute(query)
    File /home/rowdy/web2py/gluon/sql.py, line 958, in lambda
      self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
 IntegrityError: insert or update on table project_archive violates
 foreign key constraint project_archive_current_record_fkey
 DETAIL:  Key (current_record)=(31372) is not present in table project.

 Actually I would expect this.  When Crud.archive() inserts data into the
 archive table, it populates the 'current_record' column with the id of
 the row that has just been deleted from the main table.  Thus the
 foreign key constraint fails, with the above error.

 I am not sure if the following is the most web2pythoninc way of fixing
 it, but I implemented the following work-around in Crud.archive() just
 after the test for if not old_record:

          if form.request_vars.delete_this_record == 'on':
              return None

 Rowdy

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] internal error in pyamf module when trying to invoke amfrpc service

2010-03-09 Thread iggass
Hello!

I'm trying to deploy basic connectivity between Flex AS3 application
and web2py server-side. In order to achieve this noble cause I studied
the official tutorial (http://www.web2py.com/AlterEgo/default/show/22)
and the official documentation (http://web2py.com/book/default/section/
9/2).
So, I created two controllers 'rpc' and 'rpc2' as follows:

rpc.py
---
from gluon.tools import Service
service = Service(globals())

def call():
session.forget()
return service()

@service.amfrpc
def test():
return Test!!!


rpc2.py
---
import pyamf
import pyamf.remoting.gateway

def test():
return Test!!!

services={'test.test':test}

def gateway():
base_gateway = pyamf.remoting.gateway.BaseGateway(services)
context = pyamf.get_context(pyamf.AMF0)
pyamf_request = pyamf.remoting.decode(request.body.read(),
context)
pyamf_response = pyamf.remoting.Envelope(pyamf_request.amfVersion,
pyamf_request.clientType)
for name, message in pyamf_request:
pyamf_response[name] = base_gateway.getProcessor(message)
(message)
response.headers['Content-Type'] = pyamf.remoting.CONTENT_TYPE
return pyamf.remoting.encode(pyamf_response, context).getvalue()

-

After that, I tried accessing exposed amf services using both
controllers respectively via browser through the following URLs:

http://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/test
http://127.0.0.1:8000/AppTryout/rpc2/gateway/test

In both cases I recieve similar errors:

for http://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/test :
-
Traceback (most recent call last):
  File gluon/restricted.py, line 173, in restricted
  File //server2003/web2py/applications/AppTryout/controllers/
rpc.py, line 13, in module
  File gluon/globals.py, line 96, in lambda
  File //server2003/web2py/applications/AppTryout/controllers/
rpc.py, line 7, in call
  File gluon/tools.py, line 2942, in __call__
  File gluon/tools.py, line 2885, in serve_amfrpc
  File \\server2003\web2py\library.zip\pyamf\remoting\__init__.py,
line 634, in decode
  File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
322, in read_uchar
  File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
298, in _read
  File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
646, in read
IOError: Attempted to read 1 bytes from the buffer but only 0 remain

In file: \\server2003\web2py\applications\AppTryout/controllers/rpc.py
from gluon.tools import Service
service = Service(globals())

def call():
session.forget()
return service()

@service.amfrpc
def test():
return Test!!!

response._vars=response._caller(call)

for http://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/test :
-
Traceback (most recent call last):
  File gluon/restricted.py, line 173, in restricted
  File //server2003/web2py/applications/AppTryout/controllers/
rpc2.py, line 18, in module
  File gluon/globals.py, line 96, in lambda
  File //server2003/web2py/applications/AppTryout/controllers/
rpc2.py, line 12, in gateway
  File \\server2003\web2py\library.zip\pyamf\remoting\__init__.py,
line 634, in decode
  File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
322, in read_uchar
  File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
298, in _read
  File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
646, in read
IOError: Attempted to read 1 bytes from the buffer but only 0 remain

In file: \\server2003\web2py\applications\AppTryout/controllers/
rpc2.py
import pyamf
import pyamf.remoting.gateway

def test():
return Test!!!

services={'test.test':test}

def gateway():
base_gateway = pyamf.remoting.gateway.BaseGateway(services)
context = pyamf.get_context(pyamf.AMF0)
pyamf_request = pyamf.remoting.decode(request.body.read(),
context)
pyamf_response = pyamf.remoting.Envelope(pyamf_request.amfVersion,
pyamf_request.clientType)
for name, message in pyamf_request:
pyamf_response[name] = base_gateway.getProcessor(message)
(message)
response.headers['Content-Type'] = pyamf.remoting.CONTENT_TYPE
return pyamf.remoting.encode(pyamf_response, context).getvalue()
response._vars=response._caller(gateway)

It can be seen that in both cases the error arrises in the statement:
response._vars=response._caller(...)
and involves exactly the same code in pyamf module.

In httpserver.log I get:
127.0.0.1, 2010-03-09 20:49:52, GET, /AppTryout/rpc/call/amfrpc/test,
HTTP/1.1, 500, 4.131000
127.0.0.1, 2010-03-09 20:50:24, GET, /AppTryout/rpc2/gateway/test,
HTTP/1.1, 500, 6.098000

-

My surmise is thay amfrpc won't work with browser, so I prepared
simple Flex application to consume these services:

?xml version=1.0 encoding=utf-8?
mx:Application 

[web2py] Re: More Questions About Compatibility

2010-03-09 Thread Magnitus
Thats exactly the type of solution I was looking for.

No integration nightmare.

Thanks for the tip :).

On Mar 9, 9:06 am, Timothy Farrell tfarr...@swgen.com wrote:
 It's never that easy.  Magnitus, you can use LightTPD on Windows.  I'm
 not sure if it will satisfy the 64-bit requirement though.  I've gotten
 web2py working through FastCGI on LightTPD on windows.  Because web2py
 runs as a separate process, it can be 64-bit while Lighttpd runs
 32-bit.  Since Lighttpd is only the HTTP-FCGI translator, it won't be
 hindered by running 32-bit.  You can get Lighty for windows here:

 http://en.wlmp-project.net/downloads.php

 -tim

 On 3/8/2010 3:27 PM, Albert Abril wrote:



  I know it could sounds cruel, but.. try to leave windows

  On Mon, Mar 8, 2010 at 3:49 PM, Magnitus eric_vallee2...@yahoo.ca
  mailto:eric_vallee2...@yahoo.ca wrote:

       LOL.  That ambiguous phrasing may be enough to tip Graham Dumpleton
       over the edge!

      Yes, well, unless I'm using the language of mathematics, I'm not the
      best of communicator for technical stuff. I apologize.

       Others have also spoken enthusiastically about Lighttpd / Nginx in
       terms of speed,  and a smaller memory footprint too, so try
      searching
       the group. See these for example:

      Problem is that I'm developing for windows.

      I don't have anything against Linux, but learning how to use it in
      most of the gory details (so that I can run a server on it) would be
      too much of an overhead at this point in time considering the other
      things I have to pick up (the only thing I'd pick up reasonably
      quickly are the C system calls).

      Nginx's window version is beta (http://nginx.org/en/docs/
      windows.html http://nginx.org/en/docs/%0Awindows.html).

      Cherokee's window version is broken (and will be beta for a while once
      its functional again).

      Lighttpd doesn't work on Windows.

      I'm not sure how well IIS works with anything that is not C# or VB for
      the web framework and I'm not ready to capitulate to C# just yet.

      I guess I'll try to figure out how to compile Apache on a newish
      rendition of windows in 64 bits a bit longer. I found some interesting
      links for that.

      --
      You received this message because you are subscribed to the Google
      Groups web2py-users group.
      To post to this group, send email to web2py@googlegroups.com
      mailto:web2py@googlegroups.com.
      To unsubscribe from this group, send email to
      web2py+unsubscr...@googlegroups.com
      mailto:web2py%2bunsubscr...@googlegroups.com.
      For more options, visit this group at
     http://groups.google.com/group/web2py?hl=en.

  --
  You received this message because you are subscribed to the Google
  Groups web2py-users group.
  To post to this group, send email to web...@googlegroups.com.
  To unsubscribe from this group, send email to
  web2py+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/web2py?hl=en.- Hide quoted text -

 - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] session_id is not getting set on GAE

2010-03-09 Thread stephen
Hello,

I am having a problem running my web2py app on GAE. The login form
seems to not be setting the session for the client. It is working when
i run it locally with the web2py server, and the appengine local dev
server, but not when I run it on GAE.

When running it on GAE in my response var i get:

session_id : None:770fb2da-a8fa-48dd-baba-07ee7df0e78f

which is incorrect and not working, but when running locally with
appengine dev server i am getting:

session_id  : 94:a46d6f5b-cded-4b2c-9b07-b45fc5d9a117

which is correct and working.

Does anyone know how to solve this, or what might be the steps to fix
this?

Thanks,
Stephen

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: problem with crud.archive when deleting

2010-03-09 Thread Rowdy

mdipierro wrote:

If you use archive you should not never delete records. You should
only have an active field and filter out the inavtice ones.


Yes, I realise that :)

Further experimentation (while waiting for Gmane to post the message)
after I implemented the small patch revealed that the database neatly
dropped all archive rows corresponding to the main row, most likely due
to a cascading delete.

Fair enough that you /should/ not use delete when using archiving, but
to get a nasty runtime error?  That might surprise the unsuspecting
developer who innocently forgets to disable delete functionality.

In my app there are lookup tables of codes - activity codes, charge
codes and so on - that might be edited during their lifetime.  Logic is
already in place to prevent their being deleted if they are referenced
anywhere, but if they are deleted, I am happy for all archive history to
be deleted too.  This might be an isolated case.

Rowdy

--
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: internal error in pyamf module when trying to invoke amfrpc service

2010-03-09 Thread mdipierro
not sure but:
1) let's concentrate on the first method since that is the new way of
handling this
2) you appear to be using the windows binary distribution of web2py.
that does not come with pyamf and would not see it even if installed.
Could that be the problem? Could you try using the source version. You
would need to install pyamf separately.

On Mar 9, 1:04 pm, iggass gas...@gmail.com wrote:
 Hello!

 I'm trying to deploy basic connectivity between Flex AS3 application
 and web2py server-side. In order to achieve this noble cause I studied
 the official tutorial (http://www.web2py.com/AlterEgo/default/show/22)
 and the official documentation (http://web2py.com/book/default/section/
 9/2).
 So, I created two controllers 'rpc' and 'rpc2' as follows:

 rpc.py
 ---
 from gluon.tools import Service
 service = Service(globals())

 def call():
     session.forget()
     return service()

 @service.amfrpc
 def test():
     return Test!!!

 rpc2.py
 ---
 import pyamf
 import pyamf.remoting.gateway

 def test():
     return Test!!!

 services={'test.test':test}

 def gateway():
     base_gateway = pyamf.remoting.gateway.BaseGateway(services)
     context = pyamf.get_context(pyamf.AMF0)
     pyamf_request = pyamf.remoting.decode(request.body.read(),
 context)
     pyamf_response = pyamf.remoting.Envelope(pyamf_request.amfVersion,
 pyamf_request.clientType)
     for name, message in pyamf_request:
         pyamf_response[name] = base_gateway.getProcessor(message)
 (message)
     response.headers['Content-Type'] = pyamf.remoting.CONTENT_TYPE
     return pyamf.remoting.encode(pyamf_response, context).getvalue()

 -

 After that, I tried accessing exposed amf services using both
 controllers respectively via browser through the following URLs:

 http://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/testhttp://127.0.0.1:8000/AppTryout/rpc2/gateway/test

 In both cases I recieve similar errors:

 forhttp://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/test:
 -
 Traceback (most recent call last):
   File gluon/restricted.py, line 173, in restricted
   File //server2003/web2py/applications/AppTryout/controllers/
 rpc.py, line 13, in module
   File gluon/globals.py, line 96, in lambda
   File //server2003/web2py/applications/AppTryout/controllers/
 rpc.py, line 7, in call
   File gluon/tools.py, line 2942, in __call__
   File gluon/tools.py, line 2885, in serve_amfrpc
   File \\server2003\web2py\library.zip\pyamf\remoting\__init__.py,
 line 634, in decode
   File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
 322, in read_uchar
   File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
 298, in _read
   File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
 646, in read
 IOError: Attempted to read 1 bytes from the buffer but only 0 remain

 In file: \\server2003\web2py\applications\AppTryout/controllers/rpc.py
 from gluon.tools import Service
 service = Service(globals())

 def call():
     session.forget()
     return service()

 @service.amfrpc
 def test():
     return Test!!!

 response._vars=response._caller(call)

 forhttp://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/test:
 -
 Traceback (most recent call last):
   File gluon/restricted.py, line 173, in restricted
   File //server2003/web2py/applications/AppTryout/controllers/
 rpc2.py, line 18, in module
   File gluon/globals.py, line 96, in lambda
   File //server2003/web2py/applications/AppTryout/controllers/
 rpc2.py, line 12, in gateway
   File \\server2003\web2py\library.zip\pyamf\remoting\__init__.py,
 line 634, in decode
   File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
 322, in read_uchar
   File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
 298, in _read
   File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
 646, in read
 IOError: Attempted to read 1 bytes from the buffer but only 0 remain

 In file: \\server2003\web2py\applications\AppTryout/controllers/
 rpc2.py
 import pyamf
 import pyamf.remoting.gateway

 def test():
     return Test!!!

 services={'test.test':test}

 def gateway():
     base_gateway = pyamf.remoting.gateway.BaseGateway(services)
     context = pyamf.get_context(pyamf.AMF0)
     pyamf_request = pyamf.remoting.decode(request.body.read(),
 context)
     pyamf_response = pyamf.remoting.Envelope(pyamf_request.amfVersion,
 pyamf_request.clientType)
     for name, message in pyamf_request:
         pyamf_response[name] = base_gateway.getProcessor(message)
 (message)
     response.headers['Content-Type'] = pyamf.remoting.CONTENT_TYPE
     return pyamf.remoting.encode(pyamf_response, context).getvalue()
 response._vars=response._caller(gateway)

 It can be seen that in both cases the error arrises in the statement:
 response._vars=response._caller(...)
 and involves exactly the 

[web2py] Re: session_id is not getting set on GAE

2010-03-09 Thread mdipierro
I assume you have

db=DLA('gae')
session.connect(request,response,db)

somewhere.

Can you check on GAE console if any session record has been created?

Massimo

On Mar 9, 2:10 pm, stephen stephenino...@gmail.com wrote:
 Hello,

 I am having a problem running my web2py app on GAE. The login form
 seems to not be setting the session for the client. It is working when
 i run it locally with the web2py server, and the appengine local dev
 server, but not when I run it on GAE.

 When running it on GAE in my response var i get:

 session_id : None:770fb2da-a8fa-48dd-baba-07ee7df0e78f

 which is incorrect and not working, but when running locally with
 appengine dev server i am getting:

 session_id      : 94:a46d6f5b-cded-4b2c-9b07-b45fc5d9a117

 which is correct and working.

 Does anyone know how to solve this, or what might be the steps to fix
 this?

 Thanks,
 Stephen

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: internal error in pyamf module when trying to invoke amfrpc service

2010-03-09 Thread Igor Gassko
I embedded it right into the library.zip of web2py by openning .egg
package and using its pyamf folder. I'm quite sure that pyamf is being
imported, because before I did this trick I was getting no module
named pyamf error. I also tried using the source version (by
appending it directly to app.path) with the same result.
The problem is that I don't know how to debug this scenario, the
browser shows error, apparently because the request lacks some stuff.

On Mar 9, 11:28 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 not sure but:
 1) let's concentrate on the first method since that is the new way of
 handling this
 2) you appear to be using the windows binary distribution of web2py.
 that does not come with pyamf and would not see it even if installed.
 Could that be the problem? Could you try using the source version. You
 would need to install pyamf separately.

 On Mar 9, 1:04 pm, iggass gas...@gmail.com wrote:



  Hello!

  I'm trying to deploy basic connectivity between Flex AS3 application
  and web2py server-side. In order to achieve this noble cause I studied
  the official tutorial (http://www.web2py.com/AlterEgo/default/show/22)
  and the official documentation (http://web2py.com/book/default/section/
  9/2).
  So, I created two controllers 'rpc' and 'rpc2' as follows:

  rpc.py
  ---
  from gluon.tools import Service
  service = Service(globals())

  def call():
      session.forget()
      return service()

  @service.amfrpc
  def test():
      return Test!!!

  rpc2.py
  ---
  import pyamf
  import pyamf.remoting.gateway

  def test():
      return Test!!!

  services={'test.test':test}

  def gateway():
      base_gateway = pyamf.remoting.gateway.BaseGateway(services)
      context = pyamf.get_context(pyamf.AMF0)
      pyamf_request = pyamf.remoting.decode(request.body.read(),
  context)
      pyamf_response = pyamf.remoting.Envelope(pyamf_request.amfVersion,
  pyamf_request.clientType)
      for name, message in pyamf_request:
          pyamf_response[name] = base_gateway.getProcessor(message)
  (message)
      response.headers['Content-Type'] = pyamf.remoting.CONTENT_TYPE
      return pyamf.remoting.encode(pyamf_response, context).getvalue()

  -

  After that, I tried accessing exposed amf services using both
  controllers respectively via browser through the following URLs:

 http://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/testhttp://127.0.0.1:...

  In both cases I recieve similar errors:

  forhttp://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/test:
  --- 
  --
  Traceback (most recent call last):
    File gluon/restricted.py, line 173, in restricted
    File //server2003/web2py/applications/AppTryout/controllers/
  rpc.py, line 13, in module
    File gluon/globals.py, line 96, in lambda
    File //server2003/web2py/applications/AppTryout/controllers/
  rpc.py, line 7, in call
    File gluon/tools.py, line 2942, in __call__
    File gluon/tools.py, line 2885, in serve_amfrpc
    File \\server2003\web2py\library.zip\pyamf\remoting\__init__.py,
  line 634, in decode
    File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
  322, in read_uchar
    File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
  298, in _read
    File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
  646, in read
  IOError: Attempted to read 1 bytes from the buffer but only 0 remain

  In file: \\server2003\web2py\applications\AppTryout/controllers/rpc.py
  from gluon.tools import Service
  service = Service(globals())

  def call():
      session.forget()
      return service()

  @service.amfrpc
  def test():
      return Test!!!

  response._vars=response._caller(call)

  forhttp://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/test:
  --- 
  --
  Traceback (most recent call last):
    File gluon/restricted.py, line 173, in restricted
    File //server2003/web2py/applications/AppTryout/controllers/
  rpc2.py, line 18, in module
    File gluon/globals.py, line 96, in lambda
    File //server2003/web2py/applications/AppTryout/controllers/
  rpc2.py, line 12, in gateway
    File \\server2003\web2py\library.zip\pyamf\remoting\__init__.py,
  line 634, in decode
    File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
  322, in read_uchar
    File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
  298, in _read
    File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
  646, in read
  IOError: Attempted to read 1 bytes from the buffer but only 0 remain

  In file: \\server2003\web2py\applications\AppTryout/controllers/
  rpc2.py
  import pyamf
  import pyamf.remoting.gateway

  def test():
      return Test!!!

  services={'test.test':test}

  def gateway():
      base_gateway = pyamf.remoting.gateway.BaseGateway(services)
      context = pyamf.get_context(pyamf.AMF0)
 

[web2py] Re: internal error in pyamf module when trying to invoke amfrpc service

2010-03-09 Thread mdipierro
One more test. delete all tickets (errors/*) and see if a new tickets
is generated by the flash request. It may contain some useful info.

massimo

On Mar 9, 3:39 pm, Igor Gassko gas...@gmail.com wrote:
 I embedded it right into the library.zip of web2py by openning .egg
 package and using its pyamf folder. I'm quite sure that pyamf is being
 imported, because before I did this trick I was getting no module
 named pyamf error. I also tried using the source version (by
 appending it directly to app.path) with the same result.
 The problem is that I don't know how to debug this scenario, the
 browser shows error, apparently because the request lacks some stuff.

 On Mar 9, 11:28 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  not sure but:
  1) let's concentrate on the first method since that is the new way of
  handling this
  2) you appear to be using the windows binary distribution of web2py.
  that does not come with pyamf and would not see it even if installed.
  Could that be the problem? Could you try using the source version. You
  would need to install pyamf separately.

  On Mar 9, 1:04 pm, iggass gas...@gmail.com wrote:

   Hello!

   I'm trying to deploy basic connectivity between Flex AS3 application
   and web2py server-side. In order to achieve this noble cause I studied
   the official tutorial (http://www.web2py.com/AlterEgo/default/show/22)
   and the official documentation (http://web2py.com/book/default/section/
   9/2).
   So, I created two controllers 'rpc' and 'rpc2' as follows:

   rpc.py
   ---
   from gluon.tools import Service
   service = Service(globals())

   def call():
       session.forget()
       return service()

   @service.amfrpc
   def test():
       return Test!!!

   rpc2.py
   ---
   import pyamf
   import pyamf.remoting.gateway

   def test():
       return Test!!!

   services={'test.test':test}

   def gateway():
       base_gateway = pyamf.remoting.gateway.BaseGateway(services)
       context = pyamf.get_context(pyamf.AMF0)
       pyamf_request = pyamf.remoting.decode(request.body.read(),
   context)
       pyamf_response = pyamf.remoting.Envelope(pyamf_request.amfVersion,
   pyamf_request.clientType)
       for name, message in pyamf_request:
           pyamf_response[name] = base_gateway.getProcessor(message)
   (message)
       response.headers['Content-Type'] = pyamf.remoting.CONTENT_TYPE
       return pyamf.remoting.encode(pyamf_response, context).getvalue()

   -

   After that, I tried accessing exposed amf services using both
   controllers respectively via browser through the following URLs:

  http://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/testhttp://127.0.0.1:...

   In both cases I recieve similar errors:

   forhttp://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/test:
   ---
--
   Traceback (most recent call last):
     File gluon/restricted.py, line 173, in restricted
     File //server2003/web2py/applications/AppTryout/controllers/
   rpc.py, line 13, in module
     File gluon/globals.py, line 96, in lambda
     File //server2003/web2py/applications/AppTryout/controllers/
   rpc.py, line 7, in call
     File gluon/tools.py, line 2942, in __call__
     File gluon/tools.py, line 2885, in serve_amfrpc
     File \\server2003\web2py\library.zip\pyamf\remoting\__init__.py,
   line 634, in decode
     File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
   322, in read_uchar
     File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
   298, in _read
     File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
   646, in read
   IOError: Attempted to read 1 bytes from the buffer but only 0 remain

   In file: \\server2003\web2py\applications\AppTryout/controllers/rpc.py
   from gluon.tools import Service
   service = Service(globals())

   def call():
       session.forget()
       return service()

   @service.amfrpc
   def test():
       return Test!!!

   response._vars=response._caller(call)

   forhttp://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/test:
   ---
--
   Traceback (most recent call last):
     File gluon/restricted.py, line 173, in restricted
     File //server2003/web2py/applications/AppTryout/controllers/
   rpc2.py, line 18, in module
     File gluon/globals.py, line 96, in lambda
     File //server2003/web2py/applications/AppTryout/controllers/
   rpc2.py, line 12, in gateway
     File \\server2003\web2py\library.zip\pyamf\remoting\__init__.py,
   line 634, in decode
     File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
   322, in read_uchar
     File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
   298, in _read
     File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
   646, in read
   IOError: Attempted to read 1 bytes from the buffer but only 0 remain

   In file: 

[web2py] Re: internal error in pyamf module when trying to invoke amfrpc service

2010-03-09 Thread Igor Gassko
I've debugged Flex for a while and found out that
Service.ResourceNotFound comes over from the server.
Since I don't have a clue how to debug web2py, I just dig in pyamf
sources untill I found out that Service.ResourceNotFound is a string
message of UnknownServiceError which is raised in
\pyamf\remoting\gateway\__init__.py at line 395 in 'def
getServiceRequest'.
I can't understandf much from the code of that function, because I'm
not too savvy with Python syntax or pyamf classes but I'm qute sure
that the problem is there. Or at least, this is where the request gets
rejected.
Is there any way to debug this stuff directly? SOS!

On Mar 9, 9:04 pm, iggass gas...@gmail.com wrote:
 Hello!

 I'm trying to deploy basic connectivity between Flex AS3 application
 and web2py server-side. In order to achieve this noble cause I studied
 the official tutorial (http://www.web2py.com/AlterEgo/default/show/22)
 and the official documentation (http://web2py.com/book/default/section/
 9/2).
 So, I created two controllers 'rpc' and 'rpc2' as follows:

 rpc.py
 ---
 from gluon.tools import Service
 service = Service(globals())

 def call():
     session.forget()
     return service()

 @service.amfrpc
 def test():
     return Test!!!

 rpc2.py
 ---
 import pyamf
 import pyamf.remoting.gateway

 def test():
     return Test!!!

 services={'test.test':test}

 def gateway():
     base_gateway = pyamf.remoting.gateway.BaseGateway(services)
     context = pyamf.get_context(pyamf.AMF0)
     pyamf_request = pyamf.remoting.decode(request.body.read(),
 context)
     pyamf_response = pyamf.remoting.Envelope(pyamf_request.amfVersion,
 pyamf_request.clientType)
     for name, message in pyamf_request:
         pyamf_response[name] = base_gateway.getProcessor(message)
 (message)
     response.headers['Content-Type'] = pyamf.remoting.CONTENT_TYPE
     return pyamf.remoting.encode(pyamf_response, context).getvalue()

 -

 After that, I tried accessing exposed amf services using both
 controllers respectively via browser through the following URLs:

 http://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/testhttp://127.0.0.1:8000/AppTryout/rpc2/gateway/test

 In both cases I recieve similar errors:

 forhttp://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/test:
 --- 
 --
 Traceback (most recent call last):
   File gluon/restricted.py, line 173, in restricted
   File //server2003/web2py/applications/AppTryout/controllers/
 rpc.py, line 13, in module
   File gluon/globals.py, line 96, in lambda
   File //server2003/web2py/applications/AppTryout/controllers/
 rpc.py, line 7, in call
   File gluon/tools.py, line 2942, in __call__
   File gluon/tools.py, line 2885, in serve_amfrpc
   File \\server2003\web2py\library.zip\pyamf\remoting\__init__.py,
 line 634, in decode
   File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
 322, in read_uchar
   File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
 298, in _read
   File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
 646, in read
 IOError: Attempted to read 1 bytes from the buffer but only 0 remain

 In file: \\server2003\web2py\applications\AppTryout/controllers/rpc.py
 from gluon.tools import Service
 service = Service(globals())

 def call():
     session.forget()
     return service()

 @service.amfrpc
 def test():
     return Test!!!

 response._vars=response._caller(call)

 forhttp://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/test:
 --- 
 --
 Traceback (most recent call last):
   File gluon/restricted.py, line 173, in restricted
   File //server2003/web2py/applications/AppTryout/controllers/
 rpc2.py, line 18, in module
   File gluon/globals.py, line 96, in lambda
   File //server2003/web2py/applications/AppTryout/controllers/
 rpc2.py, line 12, in gateway
   File \\server2003\web2py\library.zip\pyamf\remoting\__init__.py,
 line 634, in decode
   File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
 322, in read_uchar
   File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
 298, in _read
   File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
 646, in read
 IOError: Attempted to read 1 bytes from the buffer but only 0 remain

 In file: \\server2003\web2py\applications\AppTryout/controllers/
 rpc2.py
 import pyamf
 import pyamf.remoting.gateway

 def test():
     return Test!!!

 services={'test.test':test}

 def gateway():
     base_gateway = pyamf.remoting.gateway.BaseGateway(services)
     context = pyamf.get_context(pyamf.AMF0)
     pyamf_request = pyamf.remoting.decode(request.body.read(),
 context)
     pyamf_response = pyamf.remoting.Envelope(pyamf_request.amfVersion,
 pyamf_request.clientType)
     for name, message in pyamf_request:
         pyamf_response[name] = base_gateway.getProcessor(message)
 (message)
     

[web2py] Re: internal error in pyamf module when trying to invoke amfrpc service

2010-03-09 Thread Igor Gassko
Tried that, the situation remains the same: ticket (and HTTP 500 in
log) when accessing from the browser, no ticket (and HTTP 200 in log)
when calling from Flex.
But now I'm quite sure that the problem is either with my Flex code
(or services-config.xml) or with pyamf. I just wonder if web2py allows
to debug this stuff directy...
I searched for pyamf group to post my question there, found none. Am I
missing something?

On Mar 10, 12:17 am, mdipierro mdipie...@cs.depaul.edu wrote:
 One more test. delete all tickets (errors/*) and see if a new tickets
 is generated by the flash request. It may contain some useful info.

 massimo

 On Mar 9, 3:39 pm, Igor Gassko gas...@gmail.com wrote:



  I embedded it right into the library.zip of web2py by openning .egg
  package and using its pyamf folder. I'm quite sure that pyamf is being
  imported, because before I did this trick I was getting no module
  named pyamf error. I also tried using the source version (by
  appending it directly to app.path) with the same result.
  The problem is that I don't know how to debug this scenario, the
  browser shows error, apparently because the request lacks some stuff.

  On Mar 9, 11:28 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   not sure but:
   1) let's concentrate on the first method since that is the new way of
   handling this
   2) you appear to be using the windows binary distribution of web2py.
   that does not come with pyamf and would not see it even if installed.
   Could that be the problem? Could you try using the source version. You
   would need to install pyamf separately.

   On Mar 9, 1:04 pm, iggass gas...@gmail.com wrote:

Hello!

I'm trying to deploy basic connectivity between Flex AS3 application
and web2py server-side. In order to achieve this noble cause I studied
the official tutorial (http://www.web2py.com/AlterEgo/default/show/22)
and the official documentation (http://web2py.com/book/default/section/
9/2).
So, I created two controllers 'rpc' and 'rpc2' as follows:

rpc.py
---
from gluon.tools import Service
service = Service(globals())

def call():
    session.forget()
    return service()

@service.amfrpc
def test():
    return Test!!!

rpc2.py
---
import pyamf
import pyamf.remoting.gateway

def test():
    return Test!!!

services={'test.test':test}

def gateway():
    base_gateway = pyamf.remoting.gateway.BaseGateway(services)
    context = pyamf.get_context(pyamf.AMF0)
    pyamf_request = pyamf.remoting.decode(request.body.read(),
context)
    pyamf_response = pyamf.remoting.Envelope(pyamf_request.amfVersion,
pyamf_request.clientType)
    for name, message in pyamf_request:
        pyamf_response[name] = base_gateway.getProcessor(message)
(message)
    response.headers['Content-Type'] = pyamf.remoting.CONTENT_TYPE
    return pyamf.remoting.encode(pyamf_response, context).getvalue()

-

After that, I tried accessing exposed amf services using both
controllers respectively via browser through the following URLs:

   http://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/testhttp://127.0.0.1:...

In both cases I recieve similar errors:

forhttp://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/test:
---
 --
Traceback (most recent call last):
  File gluon/restricted.py, line 173, in restricted
  File //server2003/web2py/applications/AppTryout/controllers/
rpc.py, line 13, in module
  File gluon/globals.py, line 96, in lambda
  File //server2003/web2py/applications/AppTryout/controllers/
rpc.py, line 7, in call
  File gluon/tools.py, line 2942, in __call__
  File gluon/tools.py, line 2885, in serve_amfrpc
  File \\server2003\web2py\library.zip\pyamf\remoting\__init__.py,
line 634, in decode
  File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
322, in read_uchar
  File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
298, in _read
  File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
646, in read
IOError: Attempted to read 1 bytes from the buffer but only 0 remain

In file: \\server2003\web2py\applications\AppTryout/controllers/rpc.py
from gluon.tools import Service
service = Service(globals())

def call():
    session.forget()
    return service()

@service.amfrpc
def test():
    return Test!!!

response._vars=response._caller(call)

forhttp://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/test:
---
 --
Traceback (most recent call last):
  File gluon/restricted.py, line 173, in restricted
  File //server2003/web2py/applications/AppTryout/controllers/
rpc2.py, line 18, in module
 

[web2py] Re: internal error in pyamf module when trying to invoke amfrpc service

2010-03-09 Thread Igor Gassko
Case solved.
I used invalid URL, that why request handler didn't recognize the
service call.
Following is the code that works:

rpc.py:
---

from gluon.tools import Service
service = Service(globals())

def call():
session.forget()
return service()

@service.amfrpc3(mydomain)
def test():
return Test!!!


Flex
---

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute
mx:Script
![CDATA[
import mx.messaging.channels.NetConnectionChannel;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
import mx.messaging.channels.AMFChannel;

private function resultHandler(event:ResultEvent):void
{
trace(event.result.toString());
}

private function faultHandler(event:FaultEvent):void
{
trace(event.fault.message);
}

private function fire():void
{
amfService3.test();
}
]]
/mx:Script

mx:RemoteObject
id=amfService3
endpoint=http://127.0.0.1:8000/AppTryout/rpc/call/amfrpc3;
destination=mydomain
showBusyCursor=true
mx:method name=test result=resultHandler(event)
fault=faultHandler(event)/
/mx:RemoteObject
mx:Button x=250 y=150 label=Fire click=fire();/
/mx:Application

--

Massimo, thanks for your answers and sorry for trouble!

On Mar 10, 12:29 am, Igor Gassko gas...@gmail.com wrote:
 I've debugged Flex for a while and found out that
 Service.ResourceNotFound comes over from the server.
 Since I don't have a clue how to debug web2py, I just dig in pyamf
 sources untill I found out that Service.ResourceNotFound is a string
 message of UnknownServiceError which is raised in
 \pyamf\remoting\gateway\__init__.py at line 395 in 'def
 getServiceRequest'.
 I can't understandf much from the code of that function, because I'm
 not too savvy with Python syntax or pyamf classes but I'm qute sure
 that the problem is there. Or at least, this is where the request gets
 rejected.
 Is there any way to debug this stuff directly? SOS!

 On Mar 9, 9:04 pm, iggass gas...@gmail.com wrote:



  Hello!

  I'm trying to deploy basic connectivity between Flex AS3 application
  and web2py server-side. In order to achieve this noble cause I studied
  the official tutorial (http://www.web2py.com/AlterEgo/default/show/22)
  and the official documentation (http://web2py.com/book/default/section/
  9/2).
  So, I created two controllers 'rpc' and 'rpc2' as follows:

  rpc.py
  ---
  from gluon.tools import Service
  service = Service(globals())

  def call():
      session.forget()
      return service()

  @service.amfrpc
  def test():
      return Test!!!

  rpc2.py
  ---
  import pyamf
  import pyamf.remoting.gateway

  def test():
      return Test!!!

  services={'test.test':test}

  def gateway():
      base_gateway = pyamf.remoting.gateway.BaseGateway(services)
      context = pyamf.get_context(pyamf.AMF0)
      pyamf_request = pyamf.remoting.decode(request.body.read(),
  context)
      pyamf_response = pyamf.remoting.Envelope(pyamf_request.amfVersion,
  pyamf_request.clientType)
      for name, message in pyamf_request:
          pyamf_response[name] = base_gateway.getProcessor(message)
  (message)
      response.headers['Content-Type'] = pyamf.remoting.CONTENT_TYPE
      return pyamf.remoting.encode(pyamf_response, context).getvalue()

  -

  After that, I tried accessing exposed amf services using both
  controllers respectively via browser through the following URLs:

 http://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/testhttp://127.0.0.1:...

  In both cases I recieve similar errors:

  forhttp://127.0.0.1:8000/AppTryout/rpc/call/amfrpc/test:
  --- 
  --
  Traceback (most recent call last):
    File gluon/restricted.py, line 173, in restricted
    File //server2003/web2py/applications/AppTryout/controllers/
  rpc.py, line 13, in module
    File gluon/globals.py, line 96, in lambda
    File //server2003/web2py/applications/AppTryout/controllers/
  rpc.py, line 7, in call
    File gluon/tools.py, line 2942, in __call__
    File gluon/tools.py, line 2885, in serve_amfrpc
    File \\server2003\web2py\library.zip\pyamf\remoting\__init__.py,
  line 634, in decode
    File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
  322, in read_uchar
    File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
  298, in _read
    File \\server2003\web2py\library.zip\pyamf\util\__init__.py, line
  646, in read
  IOError: Attempted to read 1 bytes from the buffer but only 0 remain

  In file: 

Re: [web2py] Re: internal error in pyamf module when trying to invoke amfrpc service

2010-03-09 Thread Kuba Kucharski
could you, please, make a slice with both web2py and flex code? @
http://www.web2pyslices.com/
it would be useful since there is a few flex specialists to answer
these questions here

-- 
Kuba Kucharski

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: web2py HL7 certification

2010-03-09 Thread mikech
I'm attempting to log-in to this.  It's telling me that my login in is
invalid.  I just registered today, and haven't received an email
confirming the login info.

Mike

On Mar 9, 7:04 am, dbb asefa.deb...@gmail.com wrote:
 To Web2pyers:

 Massimo has posted a new speedier web2pyHL7, the goal is to certify
 the EHR ( EMR) as show by the demo, you can help in many ways, such
 as, :
  - read the specification for certification 
 athttp://xw2k.nist.gov/healthcare/use_testing/under_development.html
 and test the software suggestion
 - if you want a job as developers chech the site :www.himss.org,
 study the demo since it has all what is required, once web2pyHL7 is
 certified, it may open for you employment. Healthcare providers do not
 want to hardship for going through the certification process, and if
 we do it here, it will be a plus for everybody

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: web2py HL7 certification

2010-03-09 Thread mikech
Never mind got it.

On Mar 9, 3:33 pm, mikech mp.ch...@gmail.com wrote:
 I'm attempting to log-in to this.  It's telling me that my login in is
 invalid.  I just registered today, and haven't received an email
 confirming the login info.

 Mike

 On Mar 9, 7:04 am, dbb asefa.deb...@gmail.com wrote:



  To Web2pyers:

  Massimo has posted a new speedier web2pyHL7, the goal is to certify
  the EHR ( EMR) as show by the demo, you can help in many ways, such
  as, :
   - read the specification for certification 
  athttp://xw2k.nist.gov/healthcare/use_testing/under_development.html
  and test the software suggestion
  - if you want a job as developers chech the site :www.himss.org,
  study the demo since it has all what is required, once web2pyHL7 is
  certified, it may open for you employment. Healthcare providers do not
  want to hardship for going through the certification process, and if
  we do it here, it will be a plus for everybody

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] how to access db from module

2010-03-09 Thread Richard
I need to interact with the database from a module and I can't pass db
as an argument. (This is so I can use deferred on GAE:
http://groups.google.com/group/web2py/browse_thread/thread/d9092604580963f8)

Can this be done?

Richard

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: how to access db from module

2010-03-09 Thread Russell
You might need to import the DAL?

From 
http://groups.google.com/group/web2py/browse_thread/thread/159b44bfbb634df2/83751f3fd6e51578

 from gluon.sql import DAL, Field
db=DAL('sqlite://storage',folder='/path/to/databases/folder/')
db.define_table()
etc. etc.

On Mar 10, 12:43 pm, Richard richar...@gmail.com wrote:
 I need to interact with the database from a module and I can't pass db
 as an argument. (This is so I can use deferred on 
 GAE:http://groups.google.com/group/web2py/browse_thread/thread/d909260458...)

 Can this be done?

 Richard

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] How to use SUM()

2010-03-09 Thread minh
I couldn't find much documentation on sum() and I'm not sure how to
use it.

If I have something like

define_table('some_table',
   Field('amount', 'integer')
  ...

I try db(...).select(db.some_table.amount.sum())

When I print it out, I get something like:

SUM(some_table.amount)
300

How do I get it to print just the number?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: internal error in pyamf module when trying to invoke amfrpc service

2010-03-09 Thread Igor Gassko
Done :-)

http://www.web2pyslices.com/main/slices/take_slice/72

On Mar 10, 1:08 am, Kuba Kucharski kuba.kuchar...@gmail.com wrote:
 could you, please, make a slice with both web2py and flex code? 
 @http://www.web2pyslices.com/
 it would be useful since there is a few flex specialists to answer
 these questions here

 --
 Kuba Kucharski

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: How to use SUM()

2010-03-09 Thread mdipierro
rows=db(...).select(db.some_table.amount.sum())
print rows.first()[db.some_table.amount.sum()]

On Mar 9, 6:23 pm, minh mdn0...@gmail.com wrote:
 I couldn't find much documentation on sum() and I'm not sure how to
 use it.

 If I have something like

 define_table('some_table',
    Field('amount', 'integer')
   ...

 I try db(...).select(db.some_table.amount.sum())

 When I print it out, I get something like:

 SUM(some_table.amount)
 300

 How do I get it to print just the number?

 Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: How to use SUM()

2010-03-09 Thread Russell
The number is stored in a dictionary called '_extra'.  The top part of
what you are getting is the dictionary key.  Do something like this to
get just the number...

row = db(...).select(db.some_table.amount.sum())[0]
answer = row.'_extra['SUM(some_table.amount) ']

See pg 169 of the book.


On Mar 10, 1:23 pm, minh mdn0...@gmail.com wrote:
 I couldn't find much documentation on sum() and I'm not sure how to
 use it.

 If I have something like

 define_table('some_table',
    Field('amount', 'integer')
   ...

 I try db(...).select(db.some_table.amount.sum())

 When I print it out, I get something like:

 SUM(some_table.amount)
 300

 How do I get it to print just the number?

 Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: internal error in pyamf module when trying to invoke amfrpc service [SOLVED]

2010-03-09 Thread mdipierro
Thank you

On Mar 9, 6:39 pm, Igor Gassko gas...@gmail.com wrote:
 Done :-)

 http://www.web2pyslices.com/main/slices/take_slice/72

 On Mar 10, 1:08 am, Kuba Kucharski kuba.kuchar...@gmail.com wrote:

  could you, please, make a slice with both web2py and flex code? 
  @http://www.web2pyslices.com/
  it would be useful since there is a few flex specialists to answer
  these questions here

  --
  Kuba Kucharski

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: session_id is not getting set on GAE

2010-03-09 Thread stephen
Yes I am including the connection string

if request.env.web2py_runtime_gae:
db = DAL('gae')
session.connect(request, response, db=db)
else:
db = DAL('sqlite://storage.sqlite')

because it is working locally with the dev appengine server.
I did notice that it is not creating a session entry on the GAE
web2py_session_myapp table so i'll investigate that route. Why would
it not be able to create a session?

Thanks,

Stephen

On Mar 9, 4:31 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 I assume you have

 db=DLA('gae')
 session.connect(request,response,db)

 somewhere.

 Can you check on GAE console if any session record has been created?

 Massimo

 On Mar 9, 2:10 pm, stephen stephenino...@gmail.com wrote:



  Hello,

  I am having a problem running my web2py app on GAE. The login form
  seems to not be setting the session for the client. It is working when
  i run it locally with the web2py server, and the appengine local dev
  server, but not when I run it on GAE.

  When running it on GAE in my response var i get:

  session_id : None:770fb2da-a8fa-48dd-baba-07ee7df0e78f

  which is incorrect and not working, but when running locally with
  appengine dev server i am getting:

  session_id      : 94:a46d6f5b-cded-4b2c-9b07-b45fc5d9a117

  which is correct and working.

  Does anyone know how to solve this, or what might be the steps to fix
  this?

  Thanks,
  Stephen

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] meeting tonight

2010-03-09 Thread mdipierro
We have a meeting on IRC tonight at 10om central time, right?

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: How to use SUM()

2010-03-09 Thread Thadeus Burgess
Is it just me or is this archaic?

-Thadeus





On Tue, Mar 9, 2010 at 6:48 PM, Russell russell.mcmur...@gmail.com wrote:
 The number is stored in a dictionary called '_extra'.  The top part of
 what you are getting is the dictionary key.  Do something like this to
 get just the number...

 row = db(...).select(db.some_table.amount.sum())[0]
 answer = row.'_extra['SUM(some_table.amount) ']

 See pg 169 of the book.


 On Mar 10, 1:23 pm, minh mdn0...@gmail.com wrote:
 I couldn't find much documentation on sum() and I'm not sure how to
 use it.

 If I have something like

 define_table('some_table',
    Field('amount', 'integer')
   ...

 I try db(...).select(db.some_table.amount.sum())

 When I print it out, I get something like:

 SUM(some_table.amount)
 300

 How do I get it to print just the number?

 Thanks.

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@googlegroups.com.
 To unsubscribe from this group, send email to 
 web2py+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/web2py?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: How to use SUM()

2010-03-09 Thread mr.freeze
It's not just you.

On Mar 9, 8:23 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 Is it just me or is this archaic?

 -Thadeus

 On Tue, Mar 9, 2010 at 6:48 PM, Russell russell.mcmur...@gmail.com wrote:
  The number is stored in a dictionary called '_extra'.  The top part of
  what you are getting is the dictionary key.  Do something like this to
  get just the number...

  row = db(...).select(db.some_table.amount.sum())[0]
  answer = row.'_extra['SUM(some_table.amount) ']

  See pg 169 of the book.

  On Mar 10, 1:23 pm, minh mdn0...@gmail.com wrote:
  I couldn't find much documentation on sum() and I'm not sure how to
  use it.

  If I have something like

  define_table('some_table',
     Field('amount', 'integer')
    ...

  I try db(...).select(db.some_table.amount.sum())

  When I print it out, I get something like:

  SUM(some_table.amount)
  300

  How do I get it to print just the number?

  Thanks.

  --
  You received this message because you are subscribed to the Google Groups 
  web2py-users group.
  To post to this group, send email to web...@googlegroups.com.
  To unsubscribe from this group, send email to 
  web2py+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/web2py?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: How to use SUM()

2010-03-09 Thread Thadeus Burgess
Still doesn't seem natural.

db(...).select().sum(db.table.field) seems much more natural.

rows = db(db.table.id  0).select(orderby=~db.table.datetimestamp)

total_hours = rows.sum(db.table.hours_worked)
avg_hours = rows.avg(db.table.hours_worked)

Would the actual implementation of this be difficult ?

-Thadeus





On Tue, Mar 9, 2010 at 9:03 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 s=db.some_table.amount.sum()
 row = db(...).select(s).first()
 answer = row[s]

 On Mar 9, 8:23 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 Is it just me or is this archaic?

 -Thadeus

 On Tue, Mar 9, 2010 at 6:48 PM, Russell russell.mcmur...@gmail.com wrote:
  The number is stored in a dictionary called '_extra'.  The top part of
  what you are getting is the dictionary key.  Do something like this to
  get just the number...

  row = db(...).select(db.some_table.amount.sum())[0]
  answer = row.'_extra['SUM(some_table.amount) ']

  See pg 169 of the book.

  On Mar 10, 1:23 pm, minh mdn0...@gmail.com wrote:
  I couldn't find much documentation on sum() and I'm not sure how to
  use it.

  If I have something like

  define_table('some_table',
     Field('amount', 'integer')
    ...

  I try db(...).select(db.some_table.amount.sum())

  When I print it out, I get something like:

  SUM(some_table.amount)
  300

  How do I get it to print just the number?

  Thanks.

  --
  You received this message because you are subscribed to the Google Groups 
  web2py-users group.
  To post to this group, send email to web...@googlegroups.com.
  To unsubscribe from this group, send email to 
  web2py+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/web2py?hl=en.

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@googlegroups.com.
 To unsubscribe from this group, send email to 
 web2py+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/web2py?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Web2py Plugin IRC Chat

2010-03-09 Thread Thadeus Burgess
For your convenience, I have posted the entire IRC log of the plugin discussion.

Later I will be posting a PDF containing the summary of what was
discussed, and what has been decided as the current official plugin
spec.

http://static.thadeusb.com:50002/web2py_plugin_irc_log.txt

-Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.