[web2py] Re: web2py 1.98.2 is OUT

2011-08-05 Thread szimszon
Issue 292 is still there [normal and lazy virtual field behavior]

 http://code.google.com/p/web2py/issues/detail?id=292


Re: [web2py] Building web2py binary for windows with extra libs

2011-08-05 Thread Praneeth Bodduluri
Hello Syed,

It is possible for you to rebuild the web2py exe adding in your
required libraries.

The following links might be of help:

1) 
http://eden.sahanafoundation.org/browser/static/scripts/tools/standalone_exe.py
2) https://groups.google.com/d/topic/web2py/Lirvj_J8q1U/discussion


Regards,
Praneeth
IRC: lifeeth



On Fri, Aug 5, 2011 at 5:13 AM, Syed Mushtaq syed1.mush...@gmail.com wrote:
 Hi ,

 I have an app that I want to ship as a windows binary . I was looking at
 http://web2py.com/book/default/chapter/12#How-to-Distribute-your-Applications-as-Binaries
 . I use PIL in my
 app for doing some image manipulation . It is possible to generate the
 windows binary of web2py which includes PIL or any other library ?

 Thanks
 -Syed



[web2py] HTTP Error 502 Bad Gateway and Static-only option on Webfaction

2011-08-05 Thread Johann Spies
Some users complains about 'HTTP Error 502 Bad Gateway' on a Web2py site on
webfaction.

When I enquired about that support@webfaction mentioned that it is related
to my website and referred me to
http://docs.webfaction.com/software/static.html#serving-static-media for a
possible solution.

Now I have two questions:

1.  What common problem in a web2py-app can cause this error?
2.  Has somebody used this static-only option on Webfaction and were there
any negative side-effects?

Regards
Johann

-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


[web2py] Re: MongoDB supported by DAL

2011-08-05 Thread Francisco Costa
 Mongo over couch?
 Why?

basically performance, but you can read more here
http://www.mongodb.org/display/DOCS/Comparing+Mongo+DB+and+Couch+DB or
search for some benchmarks


[web2py] Re: MongoDB supported by DAL

2011-08-05 Thread David Marko
 Mongo over couch? 
 Why? 

Adhoc Queries ...


[web2py] Re: default function of a controller

2011-08-05 Thread Francisco Costa


On Aug 5, 12:54 am, pbreit pbreitenb...@gmail.com wrote:
 That should be easy to support. In default.py:

 def user():
     if request.args(0):
         user = request.args(0)
         ...
     else: # list
     ...

 def restaurant():
     if request.args(0):
         restaurant = request.args(0)
         ...
     else:  # list
     ...

and if you have them in different controllers?
I think that you should be able to define different default functions
for each controller in web2py


[web2py] Re: Trouble with components

2011-08-05 Thread Massimo Di Pierro
I know. They were just regular good practice suggestions. Sorry. Will
look for a solution.

On Aug 4, 6:44 pm, G glenn.calt...@gmail.com wrote:
 Hi Massimo,
 Thank you for the suggestions. I have implemented both, but neither
 helps with the original problem of having components with multiple
 buttons work with ajax=True. My new controller generates several forms
 each with just one button and with distinct formnames. It has an if
 form.accepts clause for each form to do the required action, and then
 returns all the forms to the view to be properly formatted. It seems a
 bit clumsy, but also seems to be working.
 Thanks again,
 G

 On Aug 4, 4:36 pm, Massimo Di Pierro massimo.dipie...@gmail.com
 wrote:







  if you do not need a view and your component only displays the form
  you can just return form and pypass the generic view. It will be
  faster. I also suggest you use ajax=True. Always call the component
  directly as a test that it is working.

  On Aug 4, 6:33 pm, G glenn.calt...@gmail.com wrote:

   I think I found a workable (but slightly annoying) solution: create
   several mini-forms that only have the submit button, each with a
   different form name. Then I can just use many
   if form_blah.accepts(request.vars, session, formname='form_blah'):
   clauses. I'd still be interested in knowing if there is a better way.
   Another idea I toyed with was using jQuery to connect the .click
   action of a button to cause a jQuery.post(URL('myfunction'),
   {button_name : yes}) to send the button press to myfunction, but I'm
   new to jQuery, so didn't put much time into trying it and don't know
   if it would work.
   Thanks,
   G

   On Aug 4, 2:23 am, pbreit pbreitenb...@gmail.com wrote:

Coupla other 
approaches:http://www.johnnycode.com/blog/2010/04/08/jquery-form-serialize-doesn..

I'm surprised Jquery doesn't provide better support for this. Seems 
like a
common pattern.


[web2py] Re: Database drivers lost

2011-08-05 Thread Massimo Di Pierro
You may have two python versions and one of them does not have sqlite.

On Aug 4, 10:06 pm, Matthew matthew.g.nor...@gmail.com wrote:
 I ran a functioning application using App Engine once. When I tried to
 run it again without GAE, I noticed that only the goolgle database
 driver was available now:

     Database drivers available: google

 And when I try to run the app, I get this error:

 Traceback (most recent call last):
   File /home/matthew/dev/projects/poprop_cameron/project/src/gluon/
 restricted.py, line 192, in restricted
     exec ccode in environment
   File /home/matthew/.local/share/Trash/files/src.3/applications/
 welcome/models/db.py, line 17, in module
     db = DAL('sqlite://storage.sqlite')       # if not, use SQLite or
 other DB
   File /home/matthew/dev/projects/poprop_cameron/project/src/gluon/
 dal.py, line 3981, in __init__
     raise RuntimeError, Failure to connect, tried %d times:\n%s %
 (attempts, error)
 RuntimeError: Failure to connect, tried 5 times:
 'NoneType' object has no attribute 'Connection'

 The sqlite file is still there, but it looks like I can't connect to
 it now due to the lack of a driver. How did the sqlite driver get
 removed and how do I restore it?

 Thanks,
 Matthew


[web2py] Re: customisation in dal.py - what is the best way

2011-08-05 Thread Massimo Di Pierro
if I understand the question. yes.


On Aug 5, 12:23 am, Vineet vineet.deod...@gmail.com wrote:
 @Massimo,
 If I get you right, the MySQLdb module is still there in web2py;
 and it is not replaced totally with pymysql;
 As such, we can choose from these 2 modules.
 Other statements would not break because pymysql is a drop-in
 replacement for MySQLdb.
 Is my understanding correct?

 @Richard,
 I will again work on datatable with json this weekend  post the
 feedback here.

 Thanks.
 Vineet

 On Aug 5, 3:04 am, Richard Vézina ml.richard.vez...@gmail.com wrote:







  Vineet if you still have your issue with ajaxsource with Datatables you
  should read this Thread :

 http://groups.google.com/group/web2py/browse_frm/thread/a3cfb94dbbfe6...

  I would appreciate if you get Datatables to work with JSON, if you report
  here... I am waiting for a solution since a lot of time, but I didn't have
  time to work on this issue...

  Cheer

  http://groups.google.com/group/web2py/browse_frm/thread/a3cfb94dbbfe6...
  Richard

  On Thu, Aug 4, 2011 at 9:49 AM, Vineet vineet.deod...@gmail.com wrote:
   I want to do some customisation in dal.py.
   Want to use MySQLdb instead of PyMySQL.
   Reason behind it:-- I am going to use a 3rd party lib known as
   'bizobj', which uses MySQLdb.
   I can change the code to --
   -
   import MySQLdb
   drivers.append('MySQL')
   etc.
   ---

   Pl. tell me whether the below-mentioned procedure will be correct :

   1) download the source
   2) change the dal.py
   3) compile it to .pyc file
   4) overwrite the existing dal.pyc with the modified file

   Also pl. indicate whether it may break any login in web2py.

   Thanks.


[web2py] CRUD full permission on tables

2011-08-05 Thread Angelo Compagnucci
Hello,

To enforce full CRUD permissions on a table, I have to manually add
read, select, create, update, delete permissions to
auth_permission table or there is a way to assign all permission with
a single shot?

In the same way, if I want a user with super admin rights on all the
tables, I have to add permission for each table manually or there is a
more web2pythonic way??

Thank you!


[web2py] Re: web2py 1.98.2 is OUT

2011-08-05 Thread Massimo Di Pierro
Your problem is solved here:

http://groups.google.com/group/web2py/msg/1757c6ffb7041e6c

see the copy.copy? That is the problem. It is a performance issue.
Web2py could do the copy for you (so you do need to) but it would come
at a penalty.

We need some major refactoring of virtual fields... will work on it.

On Aug 5, 2:19 am, szimszon szims...@gmail.com wrote:
 Issue 292 is still there [normal and lazy virtual field behavior]

  http://code.google.com/p/web2py/issues/detail?id=292


[web2py] GAE Question

2011-08-05 Thread Auden RovelleQuartz
After updating the GAE SDK to version 1.5.2, when I deploy and go to
the URL for my application, I am getting

Oops! This link appears to be broken.
Suggestions:
Go to appspot.­com
Search on Google:


error message

has anyone had similar issues?


[web2py] Re: mongoDBAdapter test ......

2011-08-05 Thread Francisco Costa
On Aug 4, 7:05 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 Nobody is really pushing for this... nobody has provided any feedback
 about the adapter.

I think there is a lot of people interested in this:
http://groups.google.com/group/web2py/browse_thread/thread/ec2a16b9f4e957a0

http://www.google.com/search?q=mongodb+%2B+web2py


Re: [web2py] CRUD full permission on tables

2011-08-05 Thread Richard Vézina
You can build function to do that massively!

Richard

On Fri, Aug 5, 2011 at 6:38 AM, Angelo Compagnucci 
angelo.compagnu...@gmail.com wrote:

 Hello,

 To enforce full CRUD permissions on a table, I have to manually add
 read, select, create, update, delete permissions to
 auth_permission table or there is a way to assign all permission with
 a single shot?

 In the same way, if I want a user with super admin rights on all the
 tables, I have to add permission for each table manually or there is a
 more web2pythonic way??

 Thank you!



Re: [web2py] Re: call web2py in view from a jQuery script

2011-08-05 Thread Richard Vézina
All is in the view :

{{extend 'layout.html'}}

{{=table}}

all needed dependency

$(document).ready(function() {
$(#tabs).tabs( {
show: function(event, ui) {
var oTable = $('div.dataTables_scrollBodytable.sortable',
ui.panel).dataTable();
if ( oTable.length  0 ) {
new FixedColumns( oTable, {
iLeftColumns: 1,
} );
}
}
} );

var sSwfPath_location =
{{=URL('static','plugin_added/DataTables-1.8.1/extras/TableTools/media/swf/copy_cvs_xls_pdf.swf')}}
$('table.sortable').dataTable( {
bJQueryUI: true,
bAutoWidth: false,
bScrollInfinite: true,
sScrollY: 300px,
sScrollX: 100%,
bPaginate: false,
bProcessing: true,
bSortClasses : false,
sDom: 'HTfrtFip',
oTableTools: {
aButtons: [
copy,
csv,
xls,
{
sExtends: pdf,
sPdfOrientation: landscape,
sPdfMessage: Your custom message would go here.
}
],
//sRowSelect: multi, // It copy all rows anyway?? + Glitch if
fixedcolumn
sSwfPath: sSwfPath_location
},
oLanguage: {
sSearch: Search:
 },
aoColumnDefs: [
{ sWidth: 10%, aTargets: [ -1 ] }
]
} );

} );
/script


I think the HMTL is already loaded... I think as I said that it coming from
the Datatable parsing and the {} that have a meanig in javascript...

I let you understand what for it works that way and not the other ;-)

Richard



On Thu, Aug 4, 2011 at 6:24 PM, Anthony abasta...@gmail.com wrote:

 Can you show more of your code? I don't see why your second version should
 work if the first one didn't. Was the original code inside a web2py view (so
 the URL would get rendered before the HTML was sent to the browser)?

 Anthony

 On Thursday, August 4, 2011 5:58:49 PM UTC-4, Richard wrote:

 No, I think it a Datatables parsing issue since Datatables TableTools
 is waiting for a URL... I don't know why...

 Richard

 On 4 août, 17:56, Anthony abas...@gmail.com wrote:
  On Thursday, August 4, 2011 5:36:13 PM UTC-4, Richard wrote:
 
   Hello,
 
   I try to do this :
 
   $(document).ready(function() {
   $('table.sortable').dataTable( {
   sDom: 'HTfrtFip',
   oTableTools: {
   sSwfPath: {{=URL('static','plugin_**added/DataTables-1.8.1/extras/

   TableTools/media/swf/copy_cvs_**xls_pdf.swf')}}
 
  Is the line break after extras/ in your original code? If so, that
 should
  be causing a syntax error in the web2py view rendering. If you remove
 that
  line break, web2py should fill in the URL properly. If it still doesn't
  work, it probably has something to do with not setting up DataTables
  properly.
 
  Anthony




Re: [web2py] GAE Question

2011-08-05 Thread qasimak...@gmail.com
Yes I am having the same issue. I am new to web2py so I thought maybe I was
doing some thing wrong :-)
On Aug 5, 2011 4:30 PM, Auden RovelleQuartz oves@gmail.com wrote:
 After updating the GAE SDK to version 1.5.2, when I deploy and go to
 the URL for my application, I am getting

 Oops! This link appears to be broken.
 Suggestions:
 Go to appspot.­com
 Search on Google:


 error message

 has anyone had similar issues?


[web2py] Re: Trouble with components

2011-08-05 Thread G
Having many small forms is actually working out pretty well, and seems
to be a resonable solution. It was not intuitive to me, but I think
it's just a disconnect between the way I would do things in a GUI
framework versus the way things need to be done for web applications.
By the way, I think it would be helpful to many people to have a
tutorial that approaches web2py (or another framework) from the point
of transitioning from a GUI framework to the web. As it is, the web2py
book seems to assume a lot of familiarity with creating web
applications and less familiarity with Python. I imagine several
people like me are in the opposite situation.
Thanks for the help and the great work,
G

On Aug 5, 3:34 am, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 I know. They were just regular good practice suggestions. Sorry. Will
 look for a solution.

 On Aug 4, 6:44 pm, G glenn.calt...@gmail.com wrote:

  Hi Massimo,
  Thank you for the suggestions. I have implemented both, but neither
  helps with the original problem of having components with multiple
  buttons work with ajax=True. My new controller generates several forms
  each with just one button and with distinct formnames. It has an if
  form.accepts clause for each form to do the required action, and then
  returns all the forms to the view to be properly formatted. It seems a
  bit clumsy, but also seems to be working.
  Thanks again,
  G

  On Aug 4, 4:36 pm, Massimo Di Pierro massimo.dipie...@gmail.com
  wrote:

   if you do not need a view and your component only displays the form
   you can just return form and pypass the generic view. It will be
   faster. I also suggest you use ajax=True. Always call the component
   directly as a test that it is working.

   On Aug 4, 6:33 pm, G glenn.calt...@gmail.com wrote:

I think I found a workable (but slightly annoying) solution: create
several mini-forms that only have the submit button, each with a
different form name. Then I can just use many
if form_blah.accepts(request.vars, session, formname='form_blah'):
clauses. I'd still be interested in knowing if there is a better way.
Another idea I toyed with was using jQuery to connect the .click
action of a button to cause a jQuery.post(URL('myfunction'),
{button_name : yes}) to send the button press to myfunction, but I'm
new to jQuery, so didn't put much time into trying it and don't know
if it would work.
Thanks,
G

On Aug 4, 2:23 am, pbreit pbreitenb...@gmail.com wrote:

 Coupla other 
 approaches:http://www.johnnycode.com/blog/2010/04/08/jquery-form-serialize-doesn..

 I'm surprised Jquery doesn't provide better support for this. Seems 
 like a
 common pattern.




Re: [web2py] JqGrid module

2011-08-05 Thread Jim Karsten
Johann, I updated the jqgrid application to include demos for using complex 
queries and accessing data from a webservice. Demos are found in the 
default.py controller. If you cloned the git repo, just run 'git pull' in 
the repo directory and you should get the latest.

Cheers,
Jim


[web2py] Re: jqgrid widget with no table source

2011-08-05 Thread Jim Karsten
xenebros, I updated the jqgrid application avaliable on the web2pyslice page 
to include a demo for accessing data from a webservice. Demos are found in 
the default.py controller.

Cheers,
Jim

[web2py] Re: Trouble with components

2011-08-05 Thread Gour-Gadadhara Dasa
On Fri, 5 Aug 2011 08:24:54 -0700 (PDT)
G glenn.calt...@gmail.com wrote:

 As it is, the web2py book seems to assume a lot of familiarity with creating
 web applications and less familiarity with Python. I imagine several people
 like me are in the opposite situation.

At the moment I'm on the verge of learning bout both web development and GUI
(py+qt), and although I skimmed thropugh Django book, I really prefer web2py's
style and (hope) to undestand more about the subject. However, I assume, it
mostly has to do with web2py's design itself and now I'm waiting for a new book
to appear 'cause I like holding books in my hands and learning in that way.

The only problem I have with web2py so far, is not getting reply to my
query...hopefully there will be some answer at SO.


Sincerely,
Gour


-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

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




signature.asc
Description: PGP signature


Re: [web2py] GAE Question

2011-08-05 Thread howesc
do you have more details?  i upgraded to GAE 1.5.2 when it came out and am 
using it without problem.  though i always invoke it via a command line 
script (even though i'm on a mac right now).  i'm running several differing 
versions of web2py for various clients without problem.

note that keep access to test data i did what i mention here: 
https://groups.google.com/forum/#!searchin/web2py/gae|sort:date/web2py/M_4sbSGKtoA/80gw_I0NSEYJ

cfh


[web2py] Update web2py version 1.98.2

2011-08-05 Thread Ovidio Marinho
I updated the new version but in the read-me file did not say anything of
1.98.2,why?



   Ovidio Marinho Falcao Neto
 ovidio...@gmail.com
 88269088
   Paraiba-Brasil


[web2py] Re: celery integration?

2011-08-05 Thread pbreit
Celery 2.3 just came out (http://www.celeryproject.org/) which prompted me 
to have a look. The DatabaseBackend doesn't look too bad:
https://github.com/ask/celery/blob/master/celery/backends/database.py

I don't totally understand all of it but if I get super ambitious, maybe 
I'll take a crack at it.


[web2py] Trigger javascript to run after components are loaded

2011-08-05 Thread Jim Steil

Hi

I have a bunch of pages that load a number of components.  On these 
pages I have a script that fires after the  page is loaded that resizes 
a few things and places my footer where it should be.  Unfortunately, 
this is all happening before my components are completely loaded and 
therefore things are looking funny after my pages load.  Is there a way 
to trigger some javascript to run after my component is completely loaded?


Thanks!

-Jim






[web2py] Re: Trigger javascript to run after components are loaded

2011-08-05 Thread Anthony
You can set response.js to some javascript (set it in the component 
controller), and it will be run after the component is loaded.

On Friday, August 5, 2011 3:21:03 PM UTC-4, Jim S wrote:

 Hi

 I have a bunch of pages that load a number of components.  On these 
 pages I have a script that fires after the  page is loaded that resizes 
 a few things and places my footer where it should be.  Unfortunately, 
 this is all happening before my components are completely loaded and 
 therefore things are looking funny after my pages load.  Is there a way 
 to trigger some javascript to run after my component is completely loaded?

 Thanks!

  -Jim




Re: [web2py] Re: multiselect with part of a table

2011-08-05 Thread Nicolas Palumbo
I fixed it with a custom validator as howesc suggested.Basically i
added a second set parameter which has the selected items of other
products, without changing the items that the widget will use, but
affecting the final values variable used for persistence:
class CUSTOM_IS_IN_DB(Validator):
def __init__(
self,
dbset,
dbsetOtherProducts,

if not [x for x in values if not x in self.theset]:
values =values + self.thesetOtherProducts
return (values, None)


now that the issue is solved, due to the amount of time spent on it,
perhaps was easier to split each select in a different table... for
each category.

Thanks for the help provided


Re: [web2py] Re: Trigger javascript to run after components are loaded

2011-08-05 Thread Jim Steil
Thanks Anthony - should I be able to see that executing in firebug 
somewhere?  I tested first by putting an alert in response.js and it 
worked.  However, when I try to call my resize function I can't see it 
firing through firebug.  Thoughts?


-Jim

On 8/5/2011 2:35 PM, Anthony wrote:
You can set response.js to some javascript (set it in the component 
controller), and it will be run after the component is loaded.


On Friday, August 5, 2011 3:21:03 PM UTC-4, Jim S wrote:

Hi

I have a bunch of pages that load a number of components.  On these
pages I have a script that fires after the  page is loaded that
resizes
a few things and places my footer where it should be.  Unfortunately,
this is all happening before my components are completely loaded and
therefore things are looking funny after my pages load.  Is there
a way
to trigger some javascript to run after my component is completely
loaded?

Thanks!

 -Jim




[web2py] bug and fix in Storage.__setattr__ when assigning Field instances as values

2011-08-05 Thread Carlos
Hi,

When I try to assign a Field instance as a value in a Storage object, it 
fails by simply not assigning anything (and in fact removing the key if it 
was already present).

   x = Storage()
   x.any = (any Field instance)
   print x ... Storage {}

In summary, it treats Field instances as None because of the condition [ if 
value == None ] used in Storage.__setattr__, which (incorrectly) causes a 
Query object to be created, thus causing the condition to be incorrectly 
evaluated to True.

The fix is to use [ if value *is None* ]  instead of [ if value == None ].

In fact, I recommend to use [ is None / is not None ] everywhere instead 
of [ == / != None ], precisely to avoid these kind of problems.

Thanks,

   Carlos



[web2py] Re: celery integration?

2011-08-05 Thread Massimo Di Pierro
web2py-celery will be reased in less than one week. I am almost done.

On Aug 5, 1:26 pm, pbreit pbreitenb...@gmail.com wrote:
 Celery 2.3 just came out (http://www.celeryproject.org/) which prompted me
 to have a look. The DatabaseBackend doesn't look too 
 bad:https://github.com/ask/celery/blob/master/celery/backends/database.py

 I don't totally understand all of it but if I get super ambitious, maybe
 I'll take a crack at it.


[web2py] web2py.com down?

2011-08-05 Thread Nicolas Palumbo
can't access no page in  web2py.com


Re: [web2py] web2py.com down?

2011-08-05 Thread Jim Steil

...same for me

On 8/5/2011 3:07 PM, Nicolas Palumbo wrote:

can't access no page in  web2py.com


Re: [web2py] web2py.com down?

2011-08-05 Thread Anthony
Seems to be happening a lot recently.

Re: [web2py] Re: Trigger javascript to run after components are loaded

2011-08-05 Thread Anthony
On Friday, August 5, 2011 3:38:57 PM UTC-4, Jim S wrote:

  Thanks Anthony - should I be able to see that executing in firebug 
 somewhere?  I tested first by putting an alert in response.js and it 
 worked.  However, when I try to call my resize function I can't see it 
 firing through firebug.  Thoughts?

 
Hmm. Here is where response.js is handled on the client side: 
http://code.google.com/p/web2py/source/browse/applications/welcome/static/js/web2py_ajax.js#81.
 
web2py puts the response.js into the web2py-component-command header, and it 
is then eval'ed (in line 81) after the component ajax call completes. Not 
sure why it's not working for you.
 
Anthony
 


[web2py] Re: Do we need a Web2py micro-framework , or split web2py into multiple components ?

2011-08-05 Thread Christopher Steel
*pip install web2py* from a virtualenv give you a pretty slim setup although 
it is not very well documented, yet...




[web2py] Re: web2py.com down?

2011-08-05 Thread pbreit
If you have any free time, check out CloudFlare. It's a free service that 
caches all your assets and tries to prevent threats such as DoS. All you do 
is switch your DNS hosting to the.

[web2py] Re: default function of a controller

2011-08-05 Thread pbreit
Then this should work:

=== user.py ===
def index()
if request.args(0):
user = request.args(0)
...
else: # list
...

=== restuarant.py ===
def index()
if request.args(0):
user = request.args(0)
...
else: # list
...



[web2py] Re: default function of a controller

2011-08-05 Thread Anthony

On Friday, August 5, 2011 6:26:04 AM UTC-4, Francisco Costa wrote:



 On Aug 5, 12:54 am, pbreit pbreit...@gmail.com wrote: 
  That should be easy to support. In default.py: 
  
  def user(): 
  if request.args(0): 
  user = request.args(0) 
  ... 
  else: # list 
  ... 
  
  def restaurant(): 
  if request.args(0): 
  restaurant = request.args(0) 
  ... 
  else:  # list 
  ... 

 and if you have them in different controllers? 
 I think that you should be able to define different default functions 
 for each controller in web2py

That would be a nice addition, but if the purpose of defining a default 
function is to hide it in the URL, then you can just use the same default 
function name in each controller -- since the name won't appear in the URL 
anyway, it's not too important what it is (from the end-user perspective).
 
In your case, can't you just set the default function to 'view' (the 
function you want to hide is called 'view' in both controllers)? Or set it 
to 'index', but move the 'view' functionality to the 'index' function, and 
then rename the current 'index' function to something else, such as 'list'.
 
Anthony
 


[web2py] Re: celery integration?

2011-08-05 Thread mart
i put together app for queuing tasks (although tasks are not executed
by this app, just for queueing). I get the feeling that celery +
whatever you are doing is better than anything I can come up with
(although it does the job well enough) :) LOL

If you want some help testing, I'd be happy to help out and see how it
integrates.

Mart :)

On Aug 5, 4:00 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 web2py-celery will be reased in less than one week. I am almost done.

 On Aug 5, 1:26 pm, pbreit pbreitenb...@gmail.com wrote:







  Celery 2.3 just came out (http://www.celeryproject.org/) which prompted me
  to have a look. The DatabaseBackend doesn't look too 
  bad:https://github.com/ask/celery/blob/master/celery/backends/database.py

  I don't totally understand all of it but if I get super ambitious, maybe
  I'll take a crack at it.


Re: [web2py] Re: celery integration?

2011-08-05 Thread Vasile Ermicioi
will celery substitute web2py cronjobs ?


Re: [web2py] Re: celery integration?

2011-08-05 Thread pbreit
Only if you are using cron jobs to process tasks asynchronously. Cron is 
usually for running tasks on a scheduled basis.

Re: [web2py] Re: celery integration?

2011-08-05 Thread Vasile Ermicioi
from celery home page:

Celery is an asynchronous task queue/job queue based on distributed message
 passing. It is focused on real-time operation, but supports *scheduling *as
 well.
 The execution units, called tasks, are executed concurrently on a single or
 more worker servers using multiprocessing, Eventlet, or gevent. Tasks can
 execute asynchronously (in the background) or synchronously (wait until
 ready).


Re: [web2py] Re: celery integration?

2011-08-05 Thread pbreit
I guess you could but I doubt Web2py would swap out crontab for celery since 
cron works fine and is well known.

http://ask.github.com/celery/userguide/periodic-tasks.html#crontab-schedules


[web2py] What is the best deployment method.

2011-08-05 Thread Jason Brower

I see three places that I have to work in a modern team based development.
Local Machine: Where I host my own server and settings.
Testing Machine: Server that should mimic live production to work out 
any details.
Production: Server with publicly available sites and where data kept 
vital over everything else.


What is the best recommended way to push a web2py application to deployment?
Personally, I think it would be nice to have a way to do that from the 
web2py framework itself.
I am sure there is a way to only allow certain connections into the 
deployment site. Amazon cloud does it, why couldn't we do it. For 
example some kind of package verification on upload to make sure the 
package has come from the right place.


Best Regards,
Jason Brower



[web2py] Re: Building web2py binary for windows with extra libs

2011-08-05 Thread Iceberg
Nice tips, Praneeth. And looks like Massimo has not objection to these
kind of attempts (he even participated in some of the discussions). So
I guess all these kind of approaches are not considered as violation
of the web2py license. Yes? No?

http://web2py.com/book/default/chapter/12#How-to-Distribute-your-Applications-as-Binaries

said: make sure it states that it (your app) is being distributed
with an unmodified copy of web2py from web2py.com

Regards,
Ray (a.k.a. Iceberg)

On Aug 5, 3:34 pm, Praneeth Bodduluri life...@gmail.com wrote:
 Hello Syed,

 It is possible for you to rebuild the web2py exe adding in your
 required libraries.

 The following links might be of help:

 1)http://eden.sahanafoundation.org/browser/static/scripts/tools/standal...
 2)https://groups.google.com/d/topic/web2py/Lirvj_J8q1U/discussion

 Regards,
 Praneeth
 IRC: lifeeth







 On Fri, Aug 5, 2011 at 5:13 AM, Syed Mushtaq syed1.mush...@gmail.com wrote:
  Hi ,

  I have an app that I want to ship as a windows binary . I was looking at
 http://web2py.com/book/default/chapter/12#How-to-Distribute-your-Appl...
  . I use PIL in my
  app for doing some image manipulation . It is possible to generate the
  windows binary of web2py which includes PIL or any other library ?

  Thanks
  -Syed


[web2py] Re: What is the best deployment method.

2011-08-05 Thread pbreit
I do my dev on a Mac and deploy to 2 Ubuntu cloud servers, one for testing 
and one for production. I use Fabric scripts to pull from a Bitbucket repo. 
Works fine.




Re: [web2py] Re: What is the best deployment method.

2011-08-05 Thread Bruno Rocha

 I do my dev on a Mac and deploy to 2 Ubuntu cloud servers, one for testing
 and one for production. I use Fabric scripts to pull from a Bitbucket repo.
 Works fine.


I use Ubuntu on local  server, I jsut use mercurial to deploy, push from
local, pull from remote. managing branches etc...

I created a bunch of Python + sh + paramiko scripts that I manage myself, I
have to try Fabric..


[web2py] Re: What is the best deployment method.

2011-08-05 Thread Dane
For me git + simple sh hooks has been an easy and effective method.

On Aug 6, 12:18 am, Jason Brower encomp...@gmail.com wrote:
 I see three places that I have to work in a modern team based development.
 Local Machine: Where I host my own server and settings.
 Testing Machine: Server that should mimic live production to work out
 any details.
 Production: Server with publicly available sites and where data kept
 vital over everything else.

 What is the best recommended way to push a web2py application to deployment?
 Personally, I think it would be nice to have a way to do that from the
 web2py framework itself.
 I am sure there is a way to only allow certain connections into the
 deployment site. Amazon cloud does it, why couldn't we do it. For
 example some kind of package verification on upload to make sure the
 package has come from the right place.

 Best Regards,
 Jason Brower


[web2py] Re: New Plugin: plugin_ckeditor

2011-08-05 Thread tomt
Hi,

I was having trouble editing existing data with web2py_ckeditor until
I applied Bruno's patch.

Before applying this patch, the plugin could save new data, but it
wouldn't edit existing data.  It always started with an empty
textarea.  Now it works as I would expect. (I'm using web2py Version
1.98.2 (2011-08-04 00:47:09 and Python 2.7.2)

Thanks for the great plugin Ross, and thanks to Bruno for the patch.

I looking forward to using this plugin a lot.

On Aug 3, 2:36 am, Bruno Rocha rochacbr...@gmail.com wrote:
 I found an issue, as issues is disabled in your bitbucket, I created a wiki
 page.

 https://bitbucket.org/PhreeStyle/web2py_ckeditor/wiki/issue


[web2py] Re: Mix query and string types?

2011-08-05 Thread pbreit
I'm taking a closer look at this again. Can I subclass or extend DAL or do I 
have to edit dal.py directly?

I was trying to do this with executesql and one problem I ran into is that 
my virtualfields did not seem to be coming through. Is that expected?