[web2py] Re: Online Book Typo

2011-11-06 Thread mikech
In the section Scheduler:

It provides a *standrad* mechanism for creating and scheduling tasks. 

The first argument of the Scheduler class must be the database to be used 
by the scheduler to communicate with the workers. This can be the db of the 
app or another* dedictade* db,perhaps one shared by multiple apps.

The second argument *if* a Python dicitonary  (should be is?)

The -K option starts a worker. The argument of the -K option is a list of 
app names, separated by *comman.* These are the apps that will be served by 
this worker. One can start many* workers,.*
*
*
 What is missing to *achtually* schedule the tasks: *
*


[web2py] Re: Please help me understand how 'lambda row, rc' works

2011-11-06 Thread Stefaan Himpe

tomt wrote:

I wanted to implement the 'extracolumns' feature of SQLTABLE
and the example provided in the source code is:

 :param extracolums = [{'label':A('Extra',_href='#'),
 'class': '', #class name of the header
 'width':'', #width in pixels or %
 'content':lambda row, rc: A('Edit',_href='edit/
%s'%row.id),
 'selected': False #agregate class selected to this
column
 }]

I don't understand this because I didn't define 'row' or 'rc' anywhere
in my controller, but the content definition worked anyways.


With lambda you create a function in-place (without giving it a name).
If you write lambda row, rc : ... you say that you define a function 
expecting two parameters: row and rc


To understand better, you could just as well write the following 
equivalent code with a normal function (untested):


def show_content(row, rc):
return A('Edit', _href='edit/%s'%row.id)

extracolums = [{'label':A('Extra',_href='#'),
  'class': '',
  'width':'',
  'content': show_content,
  'selected': False
  }]




[web2py] patch for web2py socket timeout

2011-11-06 Thread fox
Hi all,
we're developing a web2py application over a non reliable network
connection and we encountered some problems with file uploading that
made us going crazy.
We had the same error as:
http://markmail.org/message/vtduef55vy43zqsv#query:web2py%20socket%20timeout+page:1+mid:mhacsuphhsdxt43h+state:results
or
http://comments.gmane.org/gmane.comp.python.web2py/70636

The problem was always:
Traceback (most recent call last):
  File /srv/web2py/gluon/main.py, line 442, in wsgibase
parse_get_post_vars(request, environ)
  File /srv/web2py/gluon/main.py, line 276, in parse_get_post_vars
request.body = copystream_progress(request) ### stores request
body
  File /srv/web2py/gluon/main.py, line 144, in copystream_progress
copystream(source, dest, size, chunk_size)
  File /srv/web2py/gluon/fileutils.py, line 366, in copystream
data = src.read(chunk_size)
  File /usr/lib/python2.6/socket.py, line 377, in read
data = self._sock.recv(left)
timeout: timed out

We found out that tuning rocket setting SOCKET_TIMEOUT made everything
work. We changed that parameter from 1 second to 300 seconds. On a
test Tor Hidden Service we managed to upload more than 1.5GB without
any problem while with the default setting we had trouble even
uploading 4-5MB.


Here's the patch for web2py that adds the parameter --socket-timeout
and lets the user tweak this setting:
https://github.com/globaleaks/web2py/commit/75f84697c3db70c1f4da4550f1518ced879208ce

It would be great if this were merged to trunk so we don't have to
keep our own custom branch of web2py

Thank you ;)

--

fox


[web2py] After modifying routes.py, GAE still routing to Welcome rather than my app

2011-11-06 Thread Spring
Hi there,

I'm facing a problem with GAE deployment. GAE still routes to Welcome
rather than my app when hitting www.myapp.com. And because I skipped
the Welcome app in app.yaml, it gives invalid request. Tried
manually to go to www.myapp.com/myapp/default/index, still invalid
request. Things seem to be fine when running the app locally with
both web2py and GAE launcher. I even tried to give a new version
number and re-deploy, but the same happened.

Contents of routes.py modified as follows:

default_application = 'go2chongqing'# ordinarily set in base
routes.py
default_controller = 'default'  # ordinarily set in app-specific
routes.py
default_function = 'index'  # ordinarily set in app-specific
routes.py

routes_app = ((r'/(?Pappgo2chongqing|welcome|admin|app)\b.*',
r'\gapp'),
  (r'(.*)', r'go2chongqing'),
  (r'/?(.*)', r'go2chongqing'))

routes_in and routes_out remain unchanged.
=
Can anybody help on this. Thanks in advance.

Spring


[web2py] Re: Online Book Typo

2011-11-06 Thread Massimo Di Pierro
Thanks. 

Massimo

On Nov 6, 2011, at 1:17 AM, mikech wrote:

 In the section Scheduler:
 
 It provides a standrad mechanism for creating and scheduling tasks. 
 
 The first argument of the Scheduler class must be the database to be used by 
 the scheduler to communicate with the workers. This can be the db of the app 
 or another dedictade db,perhaps one shared by multiple apps.
 
 The second argument if a Python dicitonary  (should be is?)
 
 The -K option starts a worker. The argument of the -K option is a list of app 
 names, separated by comman. These are the apps that will be served by this 
 worker. One can start many workers,.
 
  What is missing to achtually schedule the tasks: 



Re: [web2py] patch for web2py socket timeout

2011-11-06 Thread Jonathan Lundell
On Nov 6, 2011, at 3:42 AM, fox wrote:

 we're developing a web2py application over a non reliable network
 connection and we encountered some problems with file uploading that
 made us going crazy.
 We had the same error as:
 http://markmail.org/message/vtduef55vy43zqsv#query:web2py%20socket%20timeout+page:1+mid:mhacsuphhsdxt43h+state:results
 or
 http://comments.gmane.org/gmane.comp.python.web2py/70636
 
 The problem was always:
 Traceback (most recent call last):
  File /srv/web2py/gluon/main.py, line 442, in wsgibase
parse_get_post_vars(request, environ)
  File /srv/web2py/gluon/main.py, line 276, in parse_get_post_vars
request.body = copystream_progress(request) ### stores request
 body
  File /srv/web2py/gluon/main.py, line 144, in copystream_progress
copystream(source, dest, size, chunk_size)
  File /srv/web2py/gluon/fileutils.py, line 366, in copystream
data = src.read(chunk_size)
  File /usr/lib/python2.6/socket.py, line 377, in read
data = self._sock.recv(left)
 timeout: timed out
 
 We found out that tuning rocket setting SOCKET_TIMEOUT made everything
 work. We changed that parameter from 1 second to 300 seconds. On a
 test Tor Hidden Service we managed to upload more than 1.5GB without
 any problem while with the default setting we had trouble even
 uploading 4-5MB.
 
 
 Here's the patch for web2py that adds the parameter --socket-timeout
 and lets the user tweak this setting:
 https://github.com/globaleaks/web2py/commit/75f84697c3db70c1f4da4550f1518ced879208ce
 
 It would be great if this were merged to trunk so we don't have to
 keep our own custom branch of web2py

The patch looks good to me. 

I'm curious: what was the threshold that made your case work? Did you need all 
of the 300 seconds?

Re: [web2py] After modifying routes.py, GAE still routing to Welcome rather than my app

2011-11-06 Thread Jonathan Lundell
On Nov 6, 2011, at 5:28 AM, Spring wrote:

 I'm facing a problem with GAE deployment. GAE still routes to Welcome
 rather than my app when hitting www.myapp.com. And because I skipped
 the Welcome app in app.yaml, it gives invalid request. Tried
 manually to go to www.myapp.com/myapp/default/index, still invalid
 request. Things seem to be fine when running the app locally with
 both web2py and GAE launcher. I even tried to give a new version
 number and re-deploy, but the same happened.
 
 Contents of routes.py modified as follows:
 
 default_application = 'go2chongqing'# ordinarily set in base
 routes.py
 default_controller = 'default'  # ordinarily set in app-specific
 routes.py
 default_function = 'index'  # ordinarily set in app-specific
 routes.py
 
 routes_app = ((r'/(?Pappgo2chongqing|welcome|admin|app)\b.*',
 r'\gapp'),
  (r'(.*)', r'go2chongqing'),
  (r'/?(.*)', r'go2chongqing'))
 
 routes_in and routes_out remain unchanged.
 =
 Can anybody help on this. Thanks in advance.

Do you see anything routing-related in the GAE logs? You'll need to set the log 
viewing level to DEBUG.



[web2py] Re: Displaying custom error message instead of the ticketing system

2011-11-06 Thread Sathvik Ponangi
I'm using Web2py 1.99.2(Stable) on Google AppEngine (SDK v1.5.5) for Python 
2.5

[web2py] Displaying custom error message instead of the ticketing system

2011-11-06 Thread Sathvik Ponangi
Hello all,

 How do I display a custom error message instead of the ticket-issued 
screen?

 I've tried using the default routes.py, by setting : routes_onerror = 
 [(r'*/*',r'/init/static/error.html')]

Thanks in advance.

With Regards,
Sathvik


[web2py] Attribute of HTML element: define in controller

2011-11-06 Thread Vineet
In View, dataTables.net table is rendered.
It is using 'sAjaxSource'.
In each row, Add / Edit links are required in the last column.
Empty table structure is defined in View.
Table data is populated via sAjaxSource (controller action).

relevant code in that server-side controller function -- (pl. see the
3rd line with lnk_elmt = ')
[code]
aaData = []
for i in salheads_disp:
lnk_elmt = a href='%s' Edit /a % {{=URL(('empmast',
'emp_edit'))}}
aaData.append([i['salheadid'], i['headnm'], i['type'],
i['frequency'],[lnk_elmt]])

D=dict(sEcho=sEcho, iTotalRecords=iTotalRecords,
iTotalDisplayRecords=iTotalDisplayRecords,
iDisplayLength=iDisplayLength, aaData=aaData)
return response.json(D)
[/code]

The table displays the link correctly, but the 'href' is not formed
correctly.

It points to :---
http://127.0.0.1:8000/payroll/salheadmast/%7B%7B=URL((

What change I need to make in the code-line?

Thanks,

Vineet


Re: [web2py] patch for web2py socket timeout

2011-11-06 Thread fox91
2011/11/6 Jonathan Lundell jlund...@pobox.com

 I'm curious: what was the threshold that made your case work? Did you need
 all of the 300 seconds?


Well, with tor hidden service we tried at first with 600 seconds, then with
10, 60 or 120 but we got some timeouts so we chosen 300 seconds. Maybe we
should do more tests to find the right threshold but 300 seems ok.
Apache has a default timeout of a similar value so it's not so high :)

-- 
_fox91_

Dio creò il linguaggio macchina. Tutto il resto è opera dell'uomo

gpg key available at
http://keyserver.paranoici.org:11371/pks/lookup?op=getsearch=FA9C49D3


[web2py] Re: Attribute of HTML element: define in controller

2011-11-06 Thread Anthony
On Sunday, November 6, 2011 11:01:50 AM UTC-5, Vineet wrote:

 lnk_elmt = a href='%s' Edit /a % {{=URL(('empmast', 
 'emp_edit'))}}


You're using view syntax in a controller. No need for the {{=...}} (you've 
also got an extra set of parentheses inside URL). Just do:

'a href=%s Edit /a' % URL('empmast', 'emp_edit')

or even easier:

A('Edit', _href=URL('empmast', 'emp_edit'))

Anthony


[web2py] Re: Attribute of HTML element: define in controller

2011-11-06 Thread Vineet
Great! It worked.
Thanks Anthony.
I've been hunting on this since past few hours.

--- Vineet

On Nov 6, 9:36 pm, Anthony abasta...@gmail.com wrote:
 On Sunday, November 6, 2011 11:01:50 AM UTC-5, Vineet wrote:

              lnk_elmt = a href='%s' Edit /a % {{=URL(('empmast',
  'emp_edit'))}}

 You're using view syntax in a controller. No need for the {{=...}} (you've
 also got an extra set of parentheses inside URL). Just do:

 'a href=%s Edit /a' % URL('empmast', 'emp_edit')

 or even easier:

 A('Edit', _href=URL('empmast', 'emp_edit'))

 Anthony


[web2py] Re: question about include file

2011-11-06 Thread apple
I have done view source in the browser and looked line by line and
the two versions are identical.  How is it possible to have two
identical html source files that produce different results? Is there
some header that is not visible in the browser view source?

I have also simplified to the view below where crm/files.html is
empty. This works but when I move the js/crm.js line into crm/
files.html then it fails again when it accesses a jqueryui dialog
function with the error is Uncaught TypeError: Object [object Object]
has no method 'dialog')

{{extend 'layout.html'}}
link href=http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/
themes/{{=response.theme or smoothness}}/jquery-ui.css
rel=stylesheet type=text/css /
script src=http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/
jquery-ui.min.js type=text/javascript/script
link href={{=URL('static', 'css/crm.css')}} rel=stylesheet
type=text/css /
script src={{=URL('static', 'js/crm.js')}} type=text/javascript/
script
{{include 'crm/files.html'}}

div id=formdiv style=display:none/div

a class=button onclick=javascript: createdialog('edit.html/
todo')\Submit/a

On Nov 6, 1:07 am, Anthony abasta...@gmail.com wrote:
 In the latter case, what does the generated HTML code look like? Is the
 dialog.js content in there?

 Also, is dialog.js just a static JS file? If so, why not put it in the
 /static folder and link it via a script tag where needed (or by adding it
 to response.files, so web2py_ajax.html will automatically link it)?

 Anthony







 On Saturday, November 5, 2011 8:49:46 PM UTC-4, apple wrote:

  I have a view which works as expected:

  {{extend 'layout.html'}}
  {{include 'crm/files.html'}}
  {{include 'crm/dialog.js'}}
  a class=button onclick=javascript: createdialog('edit.html/
  todo')\Submit/a

  However if I move the line {{include 'crm/dialog.js'}} to the end of
  the file crm/files/html then I get a javascript error when I click
  the submit button.

  Why does this make a difference? Does it not just append the files to
  my view in the order they are included?


Re: [web2py] patch for web2py socket timeout

2011-11-06 Thread Phyo Arkar
I think this is the problem that plaguing my JSON Responses. When large
data is responded over slow link it got timeout suddenly in the middle.

Thanks a lot for the patch fox!

On Sun, Nov 6, 2011 at 11:03 PM, fox91 fox1...@gmail.com wrote:

 2011/11/6 Jonathan Lundell jlund...@pobox.com

 I'm curious: what was the threshold that made your case work? Did you
 need all of the 300 seconds?


 Well, with tor hidden service we tried at first with 600 seconds, then
 with 10, 60 or 120 but we got some timeouts so we chosen 300 seconds. Maybe
 we should do more tests to find the right threshold but 300 seems ok.
 Apache has a default timeout of a similar value so it's not so high :)

 --
 _fox91_

 Dio creò il linguaggio macchina. Tutto il resto è opera dell'uomo

 gpg key available at
 http://keyserver.paranoici.org:11371/pks/lookup?op=getsearch=FA9C49D3



[web2py] Problem with using a method from a module

2011-11-06 Thread Sathvik Ponangi
Hi,

 I'm using Web2py (1.99.2_Stable) on GAE (1.5.5). 

I have the following class in a module named commons.py:

 class FileSystem():

 def get_file(self, bash):
 return db(db.files.bash==bash).select().first()

 I'm trying to invoke this method from my controller as:

 import commons

commons.FileSystem().get_file(Testing).split(,) 

 
But I get a ticket with the following error:

 AttributeError: FileSystem instance has no attribute 'get_file' 


How do I fix this?

With Regards,
Sathvik 


[web2py] Re: Problem with using a method from a module

2011-11-06 Thread Sathvik Ponangi
The code works fine when the class is a part of the controller itself, but 
not as a module...

[web2py] Re: Usability: SQLFORM.grid column order with foreign table

2011-11-06 Thread luismurciano
Hi Cliff.

Our friend Hosoda Kenji has a awesome collection of web2py plugins
http://dev.s-cubism.com/web2py_plugins
you could use Solid Form, it's allows you to place fields in any order
you want.

All plugins are well documented and has examples.

Enjoy :D


[web2py] Re: Displaying custom error message instead of the ticketing system

2011-11-06 Thread Massimo Di Pierro
http://web2py.com/book/default/chapter/04?search=onerror

On Nov 6, 9:18 am, Sathvik Ponangi psath...@gmail.com wrote:
 Hello all,

  How do I display a custom error message instead of the ticket-issued
 screen?

  I've tried using the default routes.py, by setting : routes_onerror =
  [(r'*/*',r'/init/static/error.html')]

 Thanks in advance.

 With Regards,
 Sathvik


[web2py] Re: patch for web2py socket timeout

2011-11-06 Thread Massimo Di Pierro
In trunk! Thank you.

On Nov 6, 5:42 am, fox fox1...@gmail.com wrote:
 Hi all,
 we're developing a web2py application over a non reliable network
 connection and we encountered some problems with file uploading that
 made us going crazy.
 We had the same error 
 as:http://markmail.org/message/vtduef55vy43zqsv#query:web2py%20socket%20...
 orhttp://comments.gmane.org/gmane.comp.python.web2py/70636

 The problem was always:
 Traceback (most recent call last):
   File /srv/web2py/gluon/main.py, line 442, in wsgibase
     parse_get_post_vars(request, environ)
   File /srv/web2py/gluon/main.py, line 276, in parse_get_post_vars
     request.body = copystream_progress(request) ### stores request
 body
   File /srv/web2py/gluon/main.py, line 144, in copystream_progress
     copystream(source, dest, size, chunk_size)
   File /srv/web2py/gluon/fileutils.py, line 366, in copystream
     data = src.read(chunk_size)
   File /usr/lib/python2.6/socket.py, line 377, in read
     data = self._sock.recv(left)
 timeout: timed out

 We found out that tuning rocket setting SOCKET_TIMEOUT made everything
 work. We changed that parameter from 1 second to 300 seconds. On a
 test Tor Hidden Service we managed to upload more than 1.5GB without
 any problem while with the default setting we had trouble even
 uploading 4-5MB.

 Here's the patch for web2py that adds the parameter --socket-timeout
 and lets the user tweak this 
 setting:https://github.com/globaleaks/web2py/commit/75f84697c3db70c1f4da4550f...

 It would be great if this were merged to trunk so we don't have to
 keep our own custom branch of web2py

 Thank you ;)

 --

 fox


[web2py] Re: Problem with using a method from a module

2011-11-06 Thread Massimo Di Pierro
Are you sure this is exactely your code?

commons.FileSystem().get_file(Testing).split(,)

On Nov 6, 11:57 am, Sathvik Ponangi psath...@gmail.com wrote:
 Hi,

  I'm using Web2py (1.99.2_Stable) on GAE (1.5.5).

 I have the following class in a module named commons.py:

  class FileSystem():

      def get_file(self, bash):
          return db(db.files.bash==bash).select().first()

  I'm trying to invoke this method from my controller as:
  import commons

 commons.FileSystem().get_file(Testing).split(,)

 But I get a ticket with the following error:

  AttributeError: FileSystem instance has no attribute 'get_file'

 How do I fix this?

 With Regards,
 Sathvik


[web2py] new web site

2011-11-06 Thread Massimo Di Pierro
We have a new web site

   http://web2py.com/new_examples

Please check it out before we replace the old one.


Re: [web2py] we need some good web2py quotes ....

2011-11-06 Thread Vinicius Assef
As a freelancer, I invest time learning tools and techniques. It's
worth seeing my 3 years old codes running today without no
modification. Backwards compatibility is a great feature you should
try for yourself.

--
Vinicius Assef.



2011/11/4 Massimo Di Pierro massimo.dipie...@gmail.com:
 more or less as long as this one:

 bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
 bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
 bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
 bla bla bla bla bla bla bla

 if it looks good but not cheesy we will use for the web2py.com site.


[web2py] Re: Displaying custom error message instead of the ticketing system

2011-11-06 Thread Anthony
Is there an actual '/init/static/error.html' file in your GAE installation 
of web2py?

On Sunday, November 6, 2011 10:18:29 AM UTC-5, Sathvik Ponangi wrote:

 Hello all,

  How do I display a custom error message instead of the ticket-issued 
 screen?

 I've tried using the default routes.py, by setting : routes_onerror = 
 [(r'*/*',r'/init/static/error.html')]

 Thanks in advance.

 With Regards,
 Sathvik



Re: [web2py] new web site

2011-11-06 Thread António Ramos
nice layout

2011/11/6 Massimo Di Pierro massimo.dipie...@gmail.com

 We have a new web site

   http://web2py.com/new_examples

 Please check it out before we replace the old one.


[web2py] Re: new web site

2011-11-06 Thread Gour
On Sun, 6 Nov 2011 12:02:23 -0800 (PST)
Massimo Di Pierro
massimo.dipie...@gmail.com wrote:

 We have a new web site
 
http://web2py.com/new_examples
 
 Please check it out before we replace the old one.

Congratulations!

It looks beautiful.


Sincerely,
Gour


-- 
The senses are so strong and impetuous, O Arjuna, 
that they forcibly carry away the mind even of a man 
of discrimination who is endeavoring to control them.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810


signature.asc
Description: PGP signature


Re: [web2py] Re: nyroModal

2011-11-06 Thread Russell McMurray
Hi Kenneth,

nyroModalRemove() is a standard nyroModal call.  What version of nyroModal
are you using?  I'm using 1.6.2, which I see has been replaced by version
2, so maybe the call is depreciated?  My only other thought is...are you
opening nyroModal in an iframe?  I initiate the modal window from the
parent view like this:

  $('.nyroEdit').click(function(e) {
e.preventDefault();
$.nyroModalManual({
  url: $(this).attr('href'),
  forceType: 'iframe'
});
return false;
  });
With links that look like this...

a href={{=URL(r=request, f='function_name_goes_here/%s' %
record_id_goes_here)}} class=nyroEdit target=_blankname_goes_here/a

It works for me.

2011/11/5 Kenneth Lundström kenneth.t.lundst...@gmail.com

 Hi Russell,

 Have you defined nyroModalRemove somewhere? I'm getting
 parent.$.nyroModalRemove is not a function when using your suggested
 three lines.


 Kenneth

 return_script = ['parent.$.nyroModalRemove();'**]
 return_script.append('parent.**window.location.reload();')
 return HTML(BODY(SCRIPT(''.join(**return_script.xml()





[web2py] question: why changing js\jquery.dropdown.js to replace $ with jQuery?

2011-11-06 Thread Carlos
Hi,

Just a quick question: why have you changed 
\applications\welcome\static\js\jquery.dropdown.js, replacing all 
occurrences of $ with jQuery?.

Thanks,

   Carlos



Re: [web2py] question: why changing js\jquery.dropdown.js to replace $ with jQuery?

2011-11-06 Thread Ovidio Marinho
  you ask who?


   Ovidio Marinho Falcao Neto
Web Developer
 ovidio...@gmail.com
  ovidiomari...@itjp.net.br
 ITJP - itjp.net.br
   83   8826 9088 - Oi
   83   9334 0266 - Claro
Brasil

Apóio



2011/11/6 Carlos carlosgali...@gmail.com

 Hi,

 Just a quick question: why have you changed
 \applications\welcome\static\js\jquery.dropdown.js, replacing all
 occurrences of $ with jQuery?.

 Thanks,

Carlos




[web2py] Re: data from request.vars

2011-11-06 Thread petrasadi
The strftime() function didn't work for me, but the I solved the
problem using the sample function. Thank you for your replies.


Re: [web2py] question: why changing js\jquery.dropdown.js to replace $ with jQuery?

2011-11-06 Thread Bruno Rocha
It is for avoid confllicts, $ and jQuery has same purpose, and the use of
jQuery is recommended to avoid conflicts with another JS frameworks.
-- 

Bruno Rocha
[http://rochacbruno.com.br]


[web2py] Re: new web site

2011-11-06 Thread Pystar
+1 awesome, very professional looking

On Nov 6, 9:36 pm, Gour g...@atmarama.net wrote:
 On Sun, 6 Nov 2011 12:02:23 -0800 (PST)
 Massimo Di Pierro

 massimo.dipie...@gmail.com wrote:
  We have a new web site

     http://web2py.com/new_examples

  Please check it out before we replace the old one.

 Congratulations!

 It looks beautiful.

 Sincerely,
 Gour

 --
 The senses are so strong and impetuous, O Arjuna,
 that they forcibly carry away the mind even of a man
 of discrimination who is endeavoring to control them.

 http://atmarama.net| Hlapicina (Croatia) | GPG: 52B5C810

  signature.asc
  1KViewDownload


[web2py] Re: new web site

2011-11-06 Thread LightDot
I like it! Layout is nice, content categorization is similar to the 
existing one, which wasn't bad. It's a very nice evolution, not a 
revolution, and that's a positive thing. Looks polished and it's giving a 
good impression about the web2py project.

Just a couple of things I noticed:

- main menu: should be centred like the rest of the page, left alignment 
looks odd on higher screen resolutions (1920+)
- index page, in the text above the download button: a dot missing at the 
end of the sentence: programmable in Python. LGPLv3 License
- index page, bottom quotations about web2py: perhaps a bit smaller font 
size, more padding between the three columns? Especially the quotation 
author's signatures should have more padding on the right, so that they are 
always well beneath the quotation text.

I'm not sure that I like the free in the download now (free) button. 
But I guess not everybody automatically connects free with lgpl and web2py, 
so why not...


Re: [web2py] Facebook Auth password cleanup

2011-11-06 Thread Tito Garrido
Hey!

What did you change on Michele's facebook api?

Thanks

Tito

On Mon, Sep 5, 2011 at 9:10 AM, Bruno Rocha rochacbr...@gmail.com wrote:

 Hi,

 I am using Michele's Facebook API, works like a charm (with few
 modifications)

 But, every time an existing user signin-in the password is cleaned, I
 would like to keep the password unchanged because my users will login via
 facebook and normal auth.

 I changed a littlem included more permissions and changed from username to
 email for auth, just need to know how to keep email. somebody knows about
 it?

 (I also found that it is impossible to get offline_access permission due
 to 'expires' KeyError in contrib/Oauth20...)




 http://code.google.com/r/michelecomitini-facebookaccess/source/browse/
 --
 Bruno Rocha
 [ About me: http://zerp.ly/rochacbruno ]




-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___


Re: [web2py] question: why changing js\jquery.dropdown.js to replace $ with jQuery?

2011-11-06 Thread Carlos
Hi Bruno,

I know that $ and jQuery are the same, but my question is more about why to 
change these external (jQuery plugin) files, which we would need to update 
every time the next version comes out, and the same for all other jQuery 
plugins?, or I guess it's just this one because it's included in web2py 
default app.

Anyways I was just wondering about it, thanks,

   Carlos



[web2py] Re: new web site

2011-11-06 Thread Joseph Jude
Just a personal opinion: web2py should come out of the shadows of django. 
Two of the three quotes are directed towards django.

[web2py] Re: Please help me understand how 'lambda row, rc' works

2011-11-06 Thread tomt
Thanks for your response.

Using your suggestion of implementing a controller helped me to see
that
defining the 'content' statement in extracolumns causes SQLTABLE to
pass
the current record and rc(rowcount) to be used by a controller
or function, that can then be used by the A() helper.

- Tom

On Nov 6, 6:42 am, Stefaan Himpe stefaan.hi...@gmail.com wrote:
 tomt wrote:
  I wanted to implement the 'extracolumns' feature of SQLTABLE
  and the example provided in the source code is:

       :param extracolums = [{'label':A('Extra',_href='#'),
                       'class': '', #class name of the header
                       'width':'', #width in pixels or %
                       'content':lambda row, rc: A('Edit',_href='edit/
  %s'%row.id),
                       'selected': False #agregate class selected to this
  column
                       }]

  I don't understand this because I didn't define 'row' or 'rc' anywhere
  in my controller, but the content definition worked anyways.

 With lambda you create a function in-place (without giving it a name).
 If you write lambda row, rc : ... you say that you define a function
 expecting two parameters: row and rc

 To understand better, you could just as well write the following
 equivalent code with a normal function (untested):

 def show_content(row, rc):
         return A('Edit', _href='edit/%s'%row.id)

 extracolums = [{'label':A('Extra',_href='#'),
                        'class': '',
                        'width':'',
                        'content': show_content,
                        'selected': False
                        }]


[web2py] Unable to write to file error in GAE

2011-11-06 Thread Joseph Jude
Hi,
I get the below error in GAE. Unable to write to file 
/base/data/home/apps/s~123-check/1.354481446592778594/applications/init/languages/pl-pl.py

In fact it is repeated for other languages too. Please note that I'm not 
using any translations (my guess is some of the gluon tools may be using 
these files).

How to resolve this?

Thank you,
Joseph



[web2py] Re: new web site

2011-11-06 Thread Anthony
On Sunday, November 6, 2011 8:22:43 PM UTC-5, Joseph Jude wrote:

 Just a personal opinion: web2py should come out of the shadows of django. 
 Two of the three quotes are directed towards django.


Agree. We shouldn't use quotes that mention Django or other frameworks by 
name. 


Re: [web2py] new web site

2011-11-06 Thread Andrew Thompson
Is the content being pulled from existing data, or was it re-entered?In the third-party code section of the staff page, the markdown2 link is old, they moved to github. The feedparser website is 410 Gone(not sure how long, or if it moved). The fcgi.py link is dead as well.Can someone else check with a tablet turned portrait? On my touchpad, it squeezes the layout strange.--Andrew Thompsonhttp://aktzero.com/ 


[web2py] Re: data from request.vars

2011-11-06 Thread Vineet
Sometimes it is better to brew the wine at home.

;-)
Vineet

On Nov 7, 3:09 am, petrasadi petras...@gmail.com wrote:
 The strftime() function didn't work for me, but the I solved the
 problem using the sample function. Thank you for your replies.


[web2py] Re: Online Book Typo

2011-11-06 Thread mikech
I would be glad to help clean up the book if you need it.  Otherwise I will 
post the issues here.

Mike


[web2py] Re: Online Book Typo

2011-11-06 Thread mikech
Further down in the chapter on scheduler there are these paragraphs.

Once a task exists (there is a record in the scheduler_talk table), is 
QUEUED, and is ready (*mmeets* all the conditions specified in the 
record) it can be picked up by a worker. As soon as a worker is available 
it picks the first ready task schduled to run. The worker *create(s)* an 
entry in a another table scheduler_run (also create*(d)* by the 
scheduler).

The table scheduler_run stores the status of all running tasks. Each 
record references a task that has been picked up by a worker. *Once* task 
can have muliple runs. For example *on/a *task scheduled to repeat 10 times 
at 1h *distance/intervals?*, will probably have 10 runs (unless one *failes*or 
they take longer than 1h).



[web2py] Re: Online Book Typo

2011-11-06 Thread mikech
One more thing:
 As soon as a worker is available it picks the first ready task schduled to 
run  -
As soon as a worker is available it picks the first scheduled task that is 
ready to run.


[web2py] Re: Unable to write to file error in GAE

2011-11-06 Thread Massimo Di Pierro
Can you give us the complete traceback?

On Nov 6, 7:48 pm, Joseph Jude ceph...@gmail.com wrote:
 Hi,
 I get the below error in GAE. Unable to write to file
 /base/data/home/apps/s~123-check/1.354481446592778594/applications/init/lan 
 guages/pl-pl.py

 In fact it is repeated for other languages too. Please note that I'm not
 using any translations (my guess is some of the gluon tools may be using
 these files).

 How to resolve this?

 Thank you,
 Joseph


[web2py] Re: new web site

2011-11-06 Thread Massimo Di Pierro
The layout is derived from this April's fool joke they played on us:
http://web2pyramid.pylonsproject.org/

The content is the same the old site.

The quotes are taken from twitter #web2py.

Massimo

On Nov 6, 9:03 pm, Andrew Thompson andre...@aktzero.com wrote:
 Is the content being pulled from existing data, or was it re-entered?
 In the third-party code section of the staff page, the markdown2 link is old, 
 they moved to github.
 The feedparser website is 410 Gone(not sure how long, or if it moved).
 The fcgi.py link is dead as well.
 Can someone else check with a tablet turned portrait? On my touchpad, it 
 squeezes the layout strange.--
 Andrew Thompson
 http://aktzero.com/


Re: [web2py] Re: Displaying custom error message instead of the ticketing system

2011-11-06 Thread Sathvik Ponangi
@Massimo: I've tried it with routes_onerror = [('*/*', '/init/static/error.*
*html')] in routes.py  it still shows me a ticket.
@Anthony: Of course, I can access it directly at
http://localhost:8080/init/static/error.html

On Mon, Nov 7, 2011 at 2:03 AM, Anthony abasta...@gmail.com wrote:

 Is there an actual '/init/static/error.html' file in your GAE installation
 of web2py?


 On Sunday, November 6, 2011 10:18:29 AM UTC-5, Sathvik Ponangi wrote:

 Hello all,

  How do I display a custom error message instead of the ticket-issued
 screen?

 I've tried using the default routes.py, by setting : routes_onerror =
 [(r'*/*',r'/init/static/error.**html')]

 Thanks in advance.

 With Regards,
 Sathvik




-- 
Sathvik Ponangi


Re: [web2py] Re: Displaying custom error message instead of the ticketing system

2011-11-06 Thread Sathvik Ponangi
Restarting my AppEngine server has fixed this issue. Thank you all for your
help.

On Mon, Nov 7, 2011 at 10:05 AM, Sathvik Ponangi psath...@gmail.com wrote:

 @Massimo: I've tried it with routes_onerror = [('*/*',
 '/init/static/error.**html')] in routes.py  it still shows me a ticket.
 @Anthony: Of course, I can access it directly at
 http://localhost:8080/init/static/error.html


 On Mon, Nov 7, 2011 at 2:03 AM, Anthony abasta...@gmail.com wrote:

 Is there an actual '/init/static/error.html' file in your GAE
 installation of web2py?


 On Sunday, November 6, 2011 10:18:29 AM UTC-5, Sathvik Ponangi wrote:

 Hello all,

  How do I display a custom error message instead of the ticket-issued
 screen?

 I've tried using the default routes.py, by setting : routes_onerror =
 [(r'*/*',r'/init/static/error.**html')]

 Thanks in advance.

 With Regards,
 Sathvik




 --
 Sathvik Ponangi




-- 
Sathvik Ponangi


Re: [web2py] Re: Problem with using a method from a module

2011-11-06 Thread Sathvik Ponangi
Dear Massimo,
Restarting AppEngine seems to have fixed this as well.
But now I get an error saying that

 NameError: global name 'db' is not defined

How do import db.py onto the module?

With Regards,
Sathvik

On Mon, Nov 7, 2011 at 1:28 AM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 Are you sure this is exactely your code?

 commons.FileSystem().get_file(Testing).split(,)

 On Nov 6, 11:57 am, Sathvik Ponangi psath...@gmail.com wrote:
  Hi,
 
   I'm using Web2py (1.99.2_Stable) on GAE (1.5.5).
 
  I have the following class in a module named commons.py:
 
   class FileSystem():
 
   def get_file(self, bash):
   return db(db.files.bash==bash).select().first()
 
   I'm trying to invoke this method from my controller as:
   import commons
 
  commons.FileSystem().get_file(Testing).split(,)
 
  But I get a ticket with the following error:
 
   AttributeError: FileSystem instance has no attribute 'get_file'
 
  How do I fix this?
 
  With Regards,
  Sathvik




-- 
Sathvik Ponangi


Re: [web2py] Re: new web site

2011-11-06 Thread Bruno Rocha
At the footer you forgot to mention the Portuguese user group, also I miss
the links in side navigation bar of current website.


Re: [web2py] Re: Problem with using a method from a module

2011-11-06 Thread Bruno Rocha
On Mon, Nov 7, 2011 at 2:55 AM, Sathvik Ponangi psath...@gmail.com wrote:

 Dear Massimo,
 Restarting AppEngine seems to have fixed this as well.
 But now I get an error saying that

 NameError: global name 'db' is not defined

 How do import db.py onto the module?


You cant import db onto a module, db is not seriazable.

You have to pass it explicitly to the class instance

class Foo(object):
def __init__(self, db):
self.db = db

in controller

from module import Foo
foo = Foo(db)


Re: [web2py] GAE Python 2.7 update

2011-11-06 Thread Jonathan Lundell
On Nov 5, 2011, at 5:24 PM, Massimo Di Pierro wrote:

 I know I said otherwise before but perhaps we should continue to
 default to 2.5 until App Launcher supports 2.7

I have, btw, some changes to gaehandler.py. For example, GAE+2.7 now has 
cPickle, and GAE+2.5 already aliases it, so that logic needs to come out. And 
I've got code to support cProfile, so maybe the timing logic can go away.

There are also a couple of workarounds that might no longer be necessary (not 
sure), and I don't think the background task logic is up to date, but I don't 
use it, so I haven't tried.

 
 On Nov 5, 1:28 pm, Jonathan Lundell jlund...@pobox.com wrote:
 I thought I'd pass on my recent experience deploying an app to GAE with 
 Python 2.7. My motivation was the new features available, in particular 
 concurrent requests and WSGI operation, and secondarily some other 
 performance improvements (like the native JSON 
 library).Seehttp://code.google.com/appengine/docs/python/python27/newin27.htmlfor
  more info.
 
 There are a couple of downsides.
 
 1. The App Launcher doesn't support 2.7 yet, so you need to deploy from the 
 command line. I'm not entirely clear on whether there's any way at all to 
 run a 2.7 app locally.
 
 2. You must use the High Replication datastore. That's not necessarily a bad 
 thing, but a) it's more expensive (if you have enough traffic to be paying), 
 and b) run_in_transaction only works with ancestor queries, which the DAL 
 does not support.
 
 Fortunately, my db requirements aren't too complicated, and I was able to 
 put all my db accesses behind a class that allowed me to talk to the 
 datastore through its native API while preserving compatibility with DAL on 
 other servers. (There were some other advantages to doing this, and it was 
 an interesting learning experience.)
 
 The trunk's app.example.yaml defaults to 2.7; that part was fairly simple 
 (it supports 2.5 as well; just change some commenting-out stuff).
 
 I like the way GAE is going, and I really like being able to deploy an app 
 in the cloud without having to become a sysadmin.




[web2py] Re: After modifying routes.py, GAE still routing to Welcome rather than my app

2011-11-06 Thread Spring
Hi Jonathan,

I checked the debug logs on GAE as you suggested, and here is the
detail after I hit www.mydomain.com:

2011-11-06 22:35:29.090 /favicon.ico 404 22ms 0cpu_ms 0kb
W 2011-11-06 22:35:29.090 Static file referenced by handler not found:
applications/go2chongqing/static/favicon.ico
2011-11-06 22:35:28.674 /welcome/default/index 404 34ms 46cpu_ms 0kb
Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko)
Chrome/15.0.874.106 Safari/535.2
D 2011-11-06 22:35:28.667 routes_app: [182.54.127.197:http://
www.go2chongqing.com:get /welcome/default/index] [go2chongqing] -
go2chongqing
D 2011-11-06 22:35:28.667 select routing parameters: BASE
D 2011-11-06 22:35:28.667 routes_in: [182.54.127.197:http://
www.go2chongqing.com:get /welcome/default/index] - /welcome/default/
index (not rewritten)
I 2011-11-06 22:35:28.671 Saved; key: __appstats__:028600, part: 39
bytes, full: 1488 bytes, overhead: 0.000 + 0.003; link:
http://www.go2chongqing.com/_ah/stats/details?time=1
=
Base routes.py:
default_application = 'init'# ordinarily set in base routes.py
default_controller = 'default'  # ordinarily set in app-specific
routes.py
default_function = 'index'  # ordinarily set in app-specific
routes.py

routes_app = ((r'/(?Pappgo2chongqing)\b.*', r'\gapp'),
  (r'(.*)', r'go2chongqing'),
  (r'/?(.*)', r'go2chongqing'))
routes_in = ((r'.*:/favicon.ico', r'/examples/static/favicon.ico'),
 (r'.*:/robots.txt', r'/examples/static/robots.txt'),
 ((r'.*http://otherdomain.com.* (?Pany.*)', r'/app/ctr
\gany')))
routes_out = ((r'.*http://otherdomain.com.* /app/ctr(?Pany.*)',
r'\gany'),
  (r'/app(?Pany.*)', r'\gany'))
==
routes.py under application/myapp/:

default_application = 'go2chongqing'# ordinarily set in base
routes.py
default_controller = 'default'  # ordinarily set in app-specific
routes.py
default_function = 'index'  # ordinarily set in app-specific
routes.py

routes_app = ((r'/(?Pappgo2chongqing)\b.*', r'\gapp'),
  (r'(.*)', r'go2chongqing'),
  (r'/?(.*)', r'go2chongqing'))

routes_in = ((r'/static/(?Pfile[\w./-]+)', r'/go2chongqing/static/
\gfile'))
routes_in = ((r'.*:/favicon.ico', r'/go2chongqing/static/
favicon.ico'),
 (r'.*:/robots.txt', r'/go2chongqing/static/robots.txt'),
 ((r'.*http://go2chongqing.com.* (?Pany.*)', r'/app/ctr
\gany')))
routes_out = ((r'.*http://go2chongqing.com.* /app/ctr(?Pany.*)',
r'\gany'),
  (r'/app(?Pany.*)', r'\gany'))
==

The only welcome I can find out in both routes.py is udner
__routes_doctest(). Have no idea how GEA redirects to welcome/default/
index.

Spring



On 11月6日, 下午11时26分, Jonathan Lundell jlund...@pobox.com wrote:
 On Nov 6, 2011, at 5:28 AM, Spring wrote:





  I'm facing a problem with GAE deployment. GAE still routes to Welcome
  rather than my app when hittingwww.myapp.com. And because I skipped
  the Welcome app in app.yaml, it gives invalid request. Tried
  manually to go to www.myapp.com/myapp/default/index, still invalid
  request. Things seem to be fine when running the app locally with
  both web2py and GAE launcher. I even tried to give a new version
  number and re-deploy, but the same happened.

  Contents of routes.py modified as follows:

  default_application = 'go2chongqing'    # ordinarily set in base
  routes.py
  default_controller = 'default'  # ordinarily set in app-specific
  routes.py
  default_function = 'index'      # ordinarily set in app-specific
  routes.py

  routes_app = ((r'/(?Pappgo2chongqing|welcome|admin|app)\b.*',
  r'\gapp'),
               (r'(.*)', r'go2chongqing'),
               (r'/?(.*)', r'go2chongqing'))

  routes_in and routes_out remain unchanged.
  =
  Can anybody help on this. Thanks in advance.

 Do you see anything routing-related in the GAE logs? You'll need to set the 
 log viewing level to DEBUG.- 隐藏被引用文字 -

 - 显示引用的文字 -


[web2py] web(2/3)-based CMS (was Re: Mixing/supporting CMS with Web2py)

2011-11-06 Thread Gour
On Fri, 4 Nov 2011 10:38:06 -0700 (PDT)

Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
i
Dear Massiomo,

 perhaps we should make a list of desired features.

After I put some more thought into it, I've arrived at the conclusion that,
imho, Concrete5 (http://www.concrete5.org/) is, philosophically closer to
web2py than Wordpress, so it would be nice if you can check it out briefly.

Here are some of the C5 features:

- in-context (inline) editing
- easy styling (very easy to convert HTML/CSS/JS design into C5 theme)
- pages are based on theme/template and bunch of blocks (can we call 'em
  widgets) which can be freely moved around the pre-defined slots (based on the
theme)
- based on MBC framework using jQuery, DA (ADOdb), Zend...
- advanced permission system
- sensible defaults with the ability for user to override (almost) everything
- lot of add-ons available

So, C5 is primarily CMS and not blog like WP, although there are few blogs
written as add-ons.

Having something like that based on web2py would bring horde of new users
(dunno if web2py devs are ready to embrace 'em) to web2py 'cause there is
simply no such beast available on the planet Earth combining such features
(e.g. easy designing of layout, inline editing, blocks...) with the well-known
advantages of web2py.

However, it might be that such project is more suitable for Web3py...it would
be pity if it should be rewritten.



Sincerely,
Gour
 

-- 
In this endeavor there is no loss or diminution, 
and a little advancement on this path can protect 
one from the most dangerous type of fear.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810


signature.asc
Description: PGP signature


[web2py] web2py with SAE Python

2011-11-06 Thread chinakr
SAE means Sina App Engine, which is a public cloud computing platform
like GAE. It's the most mature and famous public cloud in China, where
people can't access GAE freely. SAE only supports PHP in the last 3
years.

Recently, SAE started internal testing with Python support, with code
name SAE Python.

I would like to deploy web2py on SAE Python. And as GAE, SAE Python
doesn't provide local file I/O, etc. I have to modify a lot of things
manually.

As lack of experience and time, it seems a hard task for me. So anyone
can help?

http://3.web2py.sinaapp.com/welcome/default/index
will get 'invalid request' message with following index.wsgi:

import sae
import gluon.main

app = gluon.main.wsgibase
application = sae.create_wsgi_app(app)

I also comment mkdir and open code in main.py.

SAE Python documents:
http://appstack.sinaapp.com/static/doc/release/testing/index.html