[web2py] Re: --no-gui option

2010-01-17 Thread mdipierro
I will look at your patch asap. On Jan 17, 7:12 pm, Jeff Bauer wrote: > When running web2py on a headless server (e.g. Amazon EC2 > instance), it's annoying to get a warning message from the > command line and not be able to turn it off.  I've attached > a patch to fix this behavior as an issue i

[web2py] Re: dynamic importing from an external module

2010-01-17 Thread mdipierro
Where is the module? Did you chance sys.path? If so, how/where? On Jan 17, 11:32 pm, Jeff Bauer wrote: > I've got an external module /odt/dispatcher.py, with > a class defined: > > class Dispatcher: >      pass > > I can import Dispatcher into controllers/default.py. > However, if I edit dispatch

[web2py] Re: Easy way to export and import all the tabes at once?

2010-01-17 Thread mdipierro
db.export_to_csv_file(open(filename,'w')) db.import_from_csv_file(open(filename,'r')) On Jan 18, 1:18 am, Miguel wrote: > Hi > > Is there an easy way to export and import (.csv) all the tables of a > given application at once? > In the admin UI I can export tables individually but I did not fi

[web2py] Re: How would you best implement a countdown?

2010-01-17 Thread mdipierro
http://keith-wood.name/countdown.html On Jan 18, 12:17 am, Jason Brower wrote: > I want a countdown that works for that session that will never be > interupted by the refresh of the browser. > My guess, in theory, is to the following: > Set the time of the count down and when it started. > When e

[web2py] Re: jquery help

2010-01-17 Thread mdipierro
I do not care anymore. Solved the problem serverside. On Jan 17, 9:36 pm, "mr.freeze" wrote: > I think that selectedIndex will default to 0 if the selected attribute > is not set explicitly.  The only workaround/hack I can think of is to > look at the innerHTML to see if it was set explicitly. Ma

[web2py] Re: Table id referenced to another table error?

2010-01-17 Thread mdipierro
yes or db.define_table('Person', Field('name',length=45), Field('info','text'), format = '%(name)s', <<< gives you automatic validator migrate=False) db.define_table('Activity', Field('type',length=45),

[web2py] Re: boolean field not updated

2010-01-17 Thread mdipierro
By custom you mean {{=form.custom.widget.field}} or something else? On Jan 17, 5:56 pm, Miguel Lopes wrote: > With crud when using a custom form boolean fields are not being updated. > If using the default form booleans get updated. > > Leopard > web2py source 1.74.4 > db SQLite > MacPython 2.5.4

[web2py] Re: testers needed

2010-01-17 Thread mdipierro
On Jan 17, 7:06 pm, Jeff Bauer wrote: > On 01/17/2010 03:27 PM, mdipierro wrote: > > > I have rewritten some of the code that deals with dropdowns, in trunk. > > In particular now you can do > > > IS_IN_SET(...,sorted=True) > > IS_IN_DB(...,sorted=True) > > IS_EMPTY_OR(IS_IN_SET(...,sorted=True)

[web2py] Easy way to export and import all the tabes at once?

2010-01-17 Thread Miguel
Hi Is there an easy way to export and import (.csv) all the tables of a given application at once? In the admin UI I can export tables individually but I did not find a way of exporting all at them at once. It would be really useful for testing and while working on the same application across mul

Re: [web2py] How would you best implement a countdown?

2010-01-17 Thread Thadeus Burgess
If you can pass the status of the timer along to the view, then you can use this time javascript countdown to determine when to make the ajax call back to the server. -Thadeus On Mon, Jan 18, 2010 at 12:17 AM, Jason Brower wrote: > > --- -- You received this message because you are subscrib

[web2py] How would you best implement a countdown?

2010-01-17 Thread Jason Brower
I want a countdown that works for that session that will never be interupted by the refresh of the browser. My guess, in theory, is to the following: Set the time of the count down and when it started. When ever the page is loaded it subtracts the time passed by the total of the countdown, then use

[web2py] dynamic importing from an external module

2010-01-17 Thread Jeff Bauer
I've got an external module /odt/dispatcher.py, with a class defined: class Dispatcher: pass I can import Dispatcher into controllers/default.py. However, if I edit dispatcher.py to add a new element while the web2py server is running and attempt to import it ... RPATH2 = "411" ... web2py

[web2py] Re: crud.select headers attribute

2010-01-17 Thread Michael Howden
>From my use of the crud.select, I found it needed to be: headers={'name':'Name'} (Field name only, not table name) On Nov 23 2009, 9:33 pm, annet wrote: > Massimo, > > On page 218 of the web2py manual it says: > > headers={'person.name', 'Name'} > > That should read like: > > headers={'person.na

[web2py] Re: jquery help

2010-01-17 Thread mr.freeze
I think that selectedIndex will default to 0 if the selected attribute is not set explicitly. The only workaround/hack I can think of is to look at the innerHTML to see if it was set explicitly. Maybe something like this: jQuery("select").each(function(){ var thisSel

[web2py] Re: Table id referenced to another table error?

2010-01-17 Thread KMax
On 18 янв, 08:20, Gibran Rodriguez wrote: > db.define_table('Activity', >                 Field('type',length=45), >                 Field('start_date','date'), >                 Field('end_date','date'), >                 Field('money',length=45), >                 Field('price','double'), >    

Re: [web2py] Table id referenced to another table error?

2010-01-17 Thread Jeff Bauer
Gibran, Just use db.Person, not db.Person.id: Field('person_id',db.Person) You can then specify the dropdown: db.Activity.person_id.requires = IS_IN_DB(db, 'Person.id', '%(id)s %(name)s',) Or formatted however y

[web2py] Table id referenced to another table error?

2010-01-17 Thread Gibran Rodriguez
I have 2 tables db.define_table('Person', Field('name',length=45), Field('info','text'), migrate=False) db.define_table('Activity', Field('type',length=45), Field('start_date','date'), Field('end_date'

[web2py] --no-gui option

2010-01-17 Thread Jeff Bauer
When running web2py on a headless server (e.g. Amazon EC2 instance), it's annoying to get a warning message from the command line and not be able to turn it off. I've attached a patch to fix this behavior as an issue in the mercurial repository. -- Jeff Bauer Rubicon, Inc. -- You received this

Re: [web2py] testers needed

2010-01-17 Thread Jeff Bauer
On 01/17/2010 03:27 PM, mdipierro wrote: I have rewritten some of the code that deals with dropdowns, in trunk. In particular now you can do IS_IN_SET(...,sorted=True) IS_IN_DB(...,sorted=True) IS_EMPTY_OR(IS_IN_SET(...,sorted=True)) IS_EMPTY_OR(IS_IN_DB(...,sorted=True)) If your app uses a lot

[web2py] Re: python vs haskel vs erlang benchmarks

2010-01-17 Thread Jake
O.o Wow. I would not have not predicted these results at all. Very interesting- thanks for the tip. In the immortal words of flavor flav: DON'T- DON'T DON'T- DON'T DON'T- DON'T BELIEVE THE HYPE! Jake On Jan 17, 1:39 pm, mdipierro wrote: > http://www.codexon.com/posts/debunking-the-erlang-and-

[web2py] Re: Activerecord for web2py - version 0.1

2010-01-17 Thread Jake
Very cool man! Good work. Can't wait to see where this goes! Jake -- 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...@g

[web2py] boolean field not updated

2010-01-17 Thread Miguel Lopes
With crud when using a custom form boolean fields are not being updated. If using the default form booleans get updated. Leopard web2py source 1.74.4 db SQLite MacPython 2.5.4 Miguel -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to t

Re: [web2py] Re: Filtering record sets

2010-01-17 Thread Miguel Lopes
On Sun, Jan 17, 2010 at 10:55 PM, mdipierro wrote: > No auth takes security by the book. If used everything is restricted > unless permission is granted explicitly. > > In your case is would just add a Field > ('private','boolean',default=False) and if a user tried to access a > record with priva

[web2py] Re: Filtering record sets

2010-01-17 Thread mdipierro
No auth takes security by the book. If used everything is restricted unless permission is granted explicitly. In your case is would just add a Field ('private','boolean',default=False) and if a user tried to access a record with private==True thet he/she did not create, block it. On Jan 17, 4:43

Re: [web2py] testers needed

2010-01-17 Thread Miguel Lopes
Cool! Has soon as I clean somethings I'll upgrade my development version and check! Miguel On Sun, Jan 17, 2010 at 9:27 PM, mdipierro wrote: > I have rewritten some of the code that deals with dropdowns, in trunk. > In particular now you can do > > IS_IN_SET(...,sorted=True) > IS_IN_DB(...,sort

Re: [web2py] Re: Filtering record sets

2010-01-17 Thread Miguel Lopes
On Sun, Jan 17, 2010 at 4:50 PM, mdipierro wrote: > Yes. Look into auth.accessible_query. > > For example: > > db(auth.accessible_query('read', db.mytable)).select(db.mytable.ALL) > > returns a all records of mytable that current logged in user has > access to: > > This does nested select so it i

[web2py] python vs haskel vs erlang benchmarks

2010-01-17 Thread mdipierro
http://www.codexon.com/posts/debunking-the-erlang-and-haskell-hype-for-servers -- 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+uns

[web2py] testers needed

2010-01-17 Thread mdipierro
I have rewritten some of the code that deals with dropdowns, in trunk. In particular now you can do IS_IN_SET(...,sorted=True) IS_IN_DB(...,sorted=True) IS_EMPTY_OR(IS_IN_SET(...,sorted=True)) IS_EMPTY_OR(IS_IN_DB(...,sorted=True)) If your app uses a lot of dropdowns please check nothing is broke

[web2py] Re: uWSGI + Cherokee + web2py - a howto.

2010-01-17 Thread mdipierro
In your benchmark, did you set migrate=False and bytecode compile the app? Did you use Auth? How many additional tables? On Jan 17, 3:11 pm, mdipierro wrote: > These tests basically measure lots of things at once and are dominated > by the database. If your are using sqlite, it locks the database

[web2py] Re: uWSGI + Cherokee + web2py - a howto.

2010-01-17 Thread mdipierro
These tests basically measure lots of things at once and are dominated by the database. If your are using sqlite, it locks the database completely on every request so there is no concurrency. I think we need a standard app for testing with various options: 1) db, no-db 2) 1,10,100 tables 3) view,

[web2py] Re: uWSGI + Cherokee + web2py - a howto.

2010-01-17 Thread Ivan P
Alex, Actually, this is my first try at a production deployment, and I have not set up another to test against. Is there a standard "ab" test that is usually run for comparison in web2py community? In any case I ran the following command with sqlite as the backend server (but doubt it matters for t

[web2py] Re: uWSGI + Cherokee + web2py - a howto.

2010-01-17 Thread Ivan P
mdipierro: It works. Running http://localhost/admin/default/site all the CSS, images and scripts are loaded fine. On Jan 17, 11:13 pm, mdipierro wrote: > Have you tried if web2py file streaming works with cherokee? > > On Jan 14, 4:14 pm, Ivan P wrote: > > > Inspired by Phyo Arkar's howto on s

[web2py] Re: Activerecord for web2py - version 0.1

2010-01-17 Thread Jon Romero
If you want I can post a full working application. It's awesome because it reduces the amount of code that needs to be written and (in later versions) I am thinking about putting a Proxy class that does caching. Of course this is a ROUGH prototyping (for example I can setattr for every function tha

[web2py] Re: uWSGI + Cherokee + web2py - a howto.

2010-01-17 Thread mdipierro
Have you tried if web2py file streaming works with cherokee? On Jan 14, 4:14 pm, Ivan P wrote: > Inspired by Phyo Arkar's howto on setting up web2py with Cherokee and > FCGI I tried the setup, but was somewhat unsatisfied with the fcgi > method and decided to try uWSGI. I am happy I did so, sin

Re: [web2py] Activerecord for web2py - version 0.1

2010-01-17 Thread Alex Fanjul
It sounds very cool for fast prototyping too. Alex F El 17/01/2010 14:44, Jon Romero escribió: I created a small lib which adds an abstraction over DAL and makes it feel like Rails' Activerecord. For example: user = User.find_by_name("Jon") It creates queries on the fly (you don't have to creat

[web2py] Re: Filtering record sets

2010-01-17 Thread mdipierro
Permission are strings like "read", "create", "update", "send email", "eat chocolate". They do not need anything except that you can check for permissions when you perform an action. Permissions apply to a (tablename, record_id). If record_id==0 then they apply to entire table, else to a specific

Re: [web2py] uWSGI + Cherokee + web2py - a howto.

2010-01-17 Thread Alex Fanjul
Many thanks for your tutorial Ivan, I'll give it a try... have you noticed any improvements with cherokee? could you show us your "ab" benchmarks? regards, Alex F P.S: try to make an slice in web2pyslices.com El 14/01/2010 23:14, Ivan P escribió: Inspired by Phyo Arkar's howto on setting up

[web2py] Re: Detached entities with web2py

2010-01-17 Thread mdipierro
I cannot answer the question whether web2py is the right choice for not since I am not familiar with JDO/JPA and therefore I am not sure about what they do. I can anyway answer your specific questions. The answer is yes, you can to both with a caveat discussed below: Say for example that you have

Re: [web2py] Re: Filtering record sets

2010-01-17 Thread Thadeus Burgess
please explain how we give a use those necessary permissions? Is it possible to give a user permission to all records in a table, but only *some* of the fields? -Thadeus On Sun, Jan 17, 2010 at 10:50 AM, mdipierro wrote: > Yes. Look into auth.accessible_query. > > For example: > > db(auth.a

[web2py] Re: Activerecord for web2py - version 0.1

2010-01-17 Thread K.R.Arun
interesting keep going :-) On Jan 17, 6:44 pm, Jon Romero wrote: > I created a small lib which adds an abstraction over DAL and makes it > feel like Rails' Activerecord. > For example: > user = User.find_by_name("Jon") > > It creates queries on the fly (you don't have to create a function > '

[web2py] Detached entities with web2py

2010-01-17 Thread K.R.Arun
hi, Today I had been thinking about JDO/JPA stuff that I did for my GWT based project. And I figured something out of python-gwt-rpc. But I have a doubt that, whether I can use web2py for server side or not?!! I doubted because I don't know whether detached entities are possible as in JDO/JPA wit

[web2py] Re: format = lambda ... give error

2010-01-17 Thread KMax
Ok! 1.74.6 helps. My linux instalation was not updated, while windows is update date which confuse me. On 17 янв, 19:02, KMax wrote: > my fall, > I'l make better samble (missed ",") > > On 17 янв, 18:45, KMax wrote: > > > Please find test code below > > If i remove format = lambda x: from defi

[web2py] Filtering record sets

2010-01-17 Thread Miguel Lopes
I'm wondering how to filter query results based on some sort of user access rights. Can this be accomplished with Auth? The basic use case is giving access to all records to all users, and then have certain users create records that will be only accessible to a limited number of users. Limited acc

[web2py] Activerecord for web2py - version 0.1

2010-01-17 Thread Jon Romero
I created a small lib which adds an abstraction over DAL and makes it feel like Rails' Activerecord. For example: user = User.find_by_name("Jon") It creates queries on the fly (you don't have to create a function 'find_by_name' - it creates it dynamically based on your table fields). I plan to ex

[web2py] Re: format = lambda ... give error

2010-01-17 Thread KMax
my fall, I'l make better samble (missed ",") On 17 янв, 18:45, KMax wrote: > Please find test code below > If i remove format = lambda x: from defining db.a, no error appears > > Error traceback > Traceback (most recent call last): >   File "gluon/restricted.py", line 171, in res

[web2py] format = lambda ... give error

2010-01-17 Thread KMax
Please find test code below If i remove format = lambda x: from defining db.a, no error appears Error traceback Traceback (most recent call last): File "gluon/restricted.py", line 171, in restricted File "C:/!Work/web2py/applications/test/models/db.py", line 9 format = '%(a

Re: [web2py] Re: Determine the return type

2010-01-17 Thread Thadeus Burgess
Awesome, thats one annoying bug fixed. -Thadeus On Sun, Jan 17, 2010 at 2:45 AM, mdipierro wrote: > isinstance(data,dict) > > On Jan 16, 9:59 pm, Thadeus Burgess wrote: >> What is the best way to determine if your controller is returning a >> dict for a view to be rendered or straight conte

[web2py] Re: from the book: programming g. app engine

2010-01-17 Thread mdipierro
I apologize. I am very sleepy and/or had too much margaritas. I did not read your post correctly and replied too soon. This is great. Thanks for letting us know. Massimo On Jan 16, 7:02 pm, Peterle wrote: > "Several major frameworks for Python work well with App Engine. > Django, Pylons, > web2

[web2py] jquery help

2010-01-17 Thread mdipierro
I would like to have all select/options automatically sorted client side. Tried this: jQuery(document).ready(function(){ jQuery("select").each(function(){ var i = jQuery(this).attr('selectedIndex'); jQuery(this).html(jQuery(this).children("option").sort(function (a,b) { return

[web2py] Re: Anybody going to PyCon?

2010-01-17 Thread mdipierro
Of course. I have not given up on them. ;-) On Jan 17, 1:12 am, mikech wrote: > Well, maybe next year.  Massimo, do try again. > > On Jan 16, 4:30 pm, John Heenan wrote: > > > On Jan 16, 5:33 pm, mdipierro wrote: > > > > Back to PyCon. Rejecting all web2py talks for 3 years in a row is not > >

[web2py] Re: Determine the return type

2010-01-17 Thread mdipierro
isinstance(data,dict) On Jan 16, 9:59 pm, Thadeus Burgess wrote: > What is the best way to determine if your controller is returning a > dict for a view to be rendered or straight content (like a file or csv > data or RPC result) ? > > -Thadeus -- You received this message because you are subscr

[web2py] Re: from the book: programming g. app engine

2010-01-17 Thread mdipierro
It is very different. They support app engine in the sense that you can run the framework there. But if you develop your app for the app- engine with Pylons (for example) you cannot run exactly the same app on (for example) Oracle. The database API is different (you use the GAE DB api on GAE and yo