[web2py:35387] gluon.storage.Storage.copy()

2009-11-14 Thread
Here is a patch for gluon.storage.Storage object. I added a "copy()" method so that when copying an storage object you can get another storage object instead of a dict. Note that this is a simple shadow copy. Hope it helps. -- Luyun Xie 谢路云 http://magefromhell.blogspot.com/ (http://blog.hellmage

[web2py:35386] Re: Something wrong with MySQL. (possible bug?)

2009-11-14 Thread mdipierro
can you show us sql.log? Can you also show us the model? there seem to be a 'SUBSTRING' in CREATE TABLE and I have no clue how it go in there. web2py does not write it. There are things that work in sqlite even if they should not. On Nov 14, 9:59 am, Benigno wrote: > Hi, > >     I have just

[web2py:35385] plugin_query (help!)

2009-11-14 Thread mdipierro
I am building this plugin: https://www.web2py.com/plugins/plugin_query It is only 50% done and it is not yet functional, but the page is actually generated from an internal representation of the query and works for relatively complex queries. The colors are ugly but they can be customized and wi

[web2py:35384] Re: Something wrong with MySQL. (possible bug?)

2009-11-14 Thread Benigno
I have just updated and I am running now on: Version 1.72.3 (2009-11-10 09:17:13) I am still having the same error if I try to connect MySQL. On Nov 15, 12:21 am, Thadeus Burgess wrote: > What version of web2py are you running? A few recent revisions had a bug in > sql.py, it is fixed in trunk

[web2py:35383] Know SQLAlchemy already and want to learn w2p? We translated all the examples in the sqlalchemy tutorial.

2009-11-14 Thread mdipierro
http://www.reddit.com/r/Python/comments/a4hvk/know_sqlalchemy_already_and_want_to_learn_w2p_we/ Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2p

[web2py:35382] Re: alterego inconsistency, mssql

2009-11-14 Thread mdipierro
oops. fixed that page. MSSQL is supported. There are a lot of old pages lying around. Thanks On Nov 15, 12:54 am, Thadeus Burgess wrote: > http://mdp.cti.depaul.edu/AlterEgo/default/show/44 > > not yet but its listed as supported :) > > -Thadeus --~--~-~--~~~---~--~--

[web2py:35381] alterego inconsistency, mssql

2009-11-14 Thread Thadeus Burgess
http://mdp.cti.depaul.edu/AlterEgo/default/show/44 not yet but its listed as supported :) -Thadeus --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@go

[web2py:35380] Replace html with {{=CODE(src, language=lang)}} for syntax highlighting

2009-11-14 Thread Thadeus Burgess
I have a html content (for a blog) and would like to parse the content for tags, and of course replace the content with web2py syntax highlighting using CODE helper. Has anybody done this yet? -Thadeus --~--~-~--~~~---~--~~ You received this message because you a

[web2py:35379] Re: crazy crazy idea

2009-11-14 Thread Robin B
Massimo, This sounds like the Python ski trip that you have been looking for: http://www.coactivate.org/projects/snow-sprint-2010/project-home Robin On Nov 14, 6:44 pm, weheh wrote: > If you've never skiied in the US, then I recommend Utah. The snow is > the best. And access from the airport

[web2py:35378] Re: plugin_tagging

2009-11-14 Thread mdipierro
On Nov 14, 11:16 pm, Thadeus Burgess wrote: > We will let it slide this time since your such a programming beast, but > don't let it happen again! :) LOL > The controllers won't need this, just the functions declared in the model. > > As it stands right now, do plug-ins get executed after db.

[web2py:35377] Re: record id for SQLFORM

2009-11-14 Thread Thadeus Burgess
my bad... form.vars.id :) -Thadeus On Sat, Nov 14, 2009 at 11:57 PM, Thadeus Burgess wrote: > Is there a way to get the id of the record that gets inserted by > SQLFORM.accepts. > > Doing db(db.table.id > 0).select().last() does not seem efficient. > > Could SQLFORM be altered to return t

[web2py:35376] record id for SQLFORM

2009-11-14 Thread Thadeus Burgess
Is there a way to get the id of the record that gets inserted by SQLFORM.accepts. Doing db(db.table.id > 0).select().last() does not seem efficient. Could SQLFORM be altered to return the integer on success? It will not break backwards compatibility since >1 is True. -Thadeus --~--~-~--

[web2py:35375] Re: ajax standard forms

2009-11-14 Thread Wes James
I'm trying to figure out how to use ajax for these kind of things, but I'm not sure how to grab the form since i'm just making the function call and usually that is rendered with an {{include}} or {{=form}} but i'm not sure how that would work in this situation since the page is already rendered (

[web2py:35374] ajax standard forms

2009-11-14 Thread Wes James
I'm trying to do something like this: {{=SCRIPT('$(document).ready(function() { $("input:visible:enabled:first").focus(); ajax("/app/default/user/register",[],"register");});')}} Is there a way to do this? The register div is hidden until activated. Then it should show the register screen th

[web2py:35373] Re: plugin_tagging

2009-11-14 Thread Thadeus Burgess
We will let it slide this time since your such a programming beast, but don't let it happen again! :) The controllers won't need this, just the functions declared in the model. As it stands right now, do plug-ins get executed after db.py? It would be nice for plug-ins to just define standard dat

[web2py:35372] Re: plugin_tagging

2009-11-14 Thread mdipierro
Actually it should be def plugin_tagging_tag I agree. I was sloppy. On Nov 14, 10:25 pm, Thadeus Burgess wrote: > How would we keep plug-ins from polluting the global name space? > > All functions for a plug-in should start with the plug-in name. > > So instead of def tag(): it should be d

[web2py:35370] Re: plugin_tagging

2009-11-14 Thread Thadeus Burgess
How would we keep plug-ins from polluting the global name space? All functions for a plug-in should start with the plug-in name. So instead of def tag(): it should be def plugin_tag(): -Thadeus On Sat, Nov 14, 2009 at 2:29 AM, dbb wrote: > > Got it right, thank you Massimo. > > On Nov 13,

[web2py:35369] Re: django's spaceless analog?

2009-11-14 Thread Thadeus Burgess
web2py middle-ware anyone? -Thadeus On Sat, Nov 14, 2009 at 10:18 PM, akonsu wrote: > > do you know if apache can be made to do it? doing this from every > controller is not elegant. > > On Nov 14, 11:04 pm, mdipierro wrote: > > yes. sorry for the typo. > > > > On Nov 14, 9:55 pm, akonsu w

[web2py:35368] Re: django's spaceless analog?

2009-11-14 Thread akonsu
do you know if apache can be made to do it? doing this from every controller is not elegant. On Nov 14, 11:04 pm, mdipierro wrote: > yes. sorry for the typo. > > On Nov 14, 9:55 pm, akonsu wrote: > > > thanks. > > > did you mean > > > def index(): > >     return re.compile('\s+').sub(' ', respo

[web2py:35367] Re: django's spaceless analog?

2009-11-14 Thread mdipierro
yes. sorry for the typo. On Nov 14, 9:55 pm, akonsu wrote: > thanks. > > did you mean > > def index(): >     return re.compile('\s+').sub(' ', response.render(**dict > (message='test'))) > > ? > > On Nov 14, 7:40 pm, mdipierro wrote: > > > I am not quite sure what that plugin does. > > > you ca

[web2py:35366] Re: How to do a complex migration?

2009-11-14 Thread mdipierro
You are changing a "text" column (Field) into an "ineteger" column. My changing the type web2py assumes you want to keep the data and yet it cannot convert "text" to "integert". You have to do the migration in two steps: 1) remove the column (comment it and run appadmin) 2) add the column again wi

[web2py:35365] Re: django's spaceless analog?

2009-11-14 Thread akonsu
thanks. did you mean def index(): return re.compile('\s+').sub(' ', response.render(**dict (message='test'))) ? On Nov 14, 7:40 pm, mdipierro wrote: > I am not quite sure what that plugin does. > > you can do: > > def index(): >     return re.compile('\s+').sub(' ',render.response > ('def

[web2py:35364] Re: How to do a complex migration?

2009-11-14 Thread Thadeus Burgess
You can check sql.log in the databases folder for the actual sql that has been executed to the database. That might help? It would be nice to have a migration system like in rails, to define your own migration steps. -Thadeus On Sat, Nov 14, 2009 at 7:08 PM, toomim wrote: > nd then let me s

[web2py:35363] How to do a complex migration?

2009-11-14 Thread toomim
I routinely run into migration problems. I suspect this happens when I change a column's datatype, or when I remove a table from db.py and then later make a new table with the same name as the old one. In these situations, the migrations get messed up and I get stacktraces in sql.py with errors l

[web2py:35362] Re: crazy crazy idea

2009-11-14 Thread weheh
If you've never skiied in the US, then I recommend Utah. The snow is the best. And access from the airport to the best resorts is only about 45 minutes (assuming there isn't an avalanche blocking the road). Depending on how good you are, Alta or Snowbird are my top choices for ski-in ski-out plus

[web2py:35361] Re: django's spaceless analog?

2009-11-14 Thread mdipierro
I am not quite sure what that plugin does. you can do: def index(): return re.compile('\s+').sub(' ',render.response ('default.index.html',**dict())) It will mess up text in On Nov 14, 2:05 pm, akonsu wrote: > hello, is there a way to remove whitespaces from generated xhtml > outpu

[web2py:35360] Re: new in trunk, for fun

2009-11-14 Thread mdipierro
I need to change that. It is unnecessarily big. The dictionary maps words into words with a probability to generate text that seems to make sense but does not. It can be trained to mimic an existing piece of text. On Nov 14, 2:06 pm, "mr.freeze" wrote: > I decoded it. Appears to just be the gia

[web2py:35359] Re: decimal type in web2py

2009-11-14 Thread mdipierro
good idea. I will add that. On Nov 14, 9:35 am, Jonathan Lundell wrote: > On Nov 13, 2009, at 9:43 PM, mdipierro wrote: > > > > > > > Fascinating. As an experiment I replaced str with repr and it usually > > works with float.  Float is better then integer because allows > > migrations from one d

[web2py:35358] Re: Something wrong with MySQL. (possible bug?)

2009-11-14 Thread Thadeus Burgess
What version of web2py are you running? A few recent revisions had a bug in sql.py, it is fixed in trunk. -Thadeus On Sat, Nov 14, 2009 at 4:31 PM, Benigno wrote: > > Actually, no I didnt. (I didnt know it was necessary). > > I have done so now, and still get the same error though. > > > On

[web2py:35357] Re: Something wrong with MySQL. (possible bug?)

2009-11-14 Thread Benigno
Actually, no I didnt. (I didnt know it was necessary). I have done so now, and still get the same error though. On Nov 14, 7:02 pm, Thadeus Burgess wrote: > Did you delete your .table files and sql.log file before the switch? > > -Thadeus > > On Sat, Nov 14, 2009 at 9:59 AM, Benigno wrote: >

[web2py:35356] Web2py - Launchpad - be good to have default branch

2009-11-14 Thread Tim McNamara
Hi Massimo, I thought I would share a link that will make it much easier for people to develop web2py from Launchpad. https://code.edge.launchpad.net/web2py/trunk/+linkbranch/ This will enable you to set a default branch for the web2py project. Then users will only need to type bzr branch lp:web

[web2py:35355] Re: new in trunk, for fun

2009-11-14 Thread mr.freeze
My pleasure. Thanks for the heads up! On Nov 14, 2:35 pm, Thadeus Burgess wrote: > Thanks for decoding it Freeze! > > -Thadeus > > On Sat, Nov 14, 2009 at 2:06 PM, mr.freeze wrote: > > > I decoded it. Appears to just be the giant dictionary of random words > > that populate uses. Starts and fi

[web2py:35354] Re: new in trunk, for fun

2009-11-14 Thread Thadeus Burgess
Thanks for decoding it Freeze! -Thadeus On Sat, Nov 14, 2009 at 2:06 PM, mr.freeze wrote: > > I decoded it. Appears to just be the giant dictionary of random words > that populate uses. Starts and finishes like this: > > {'shoebill': {'a': 1, '187': 1}, 'trout-like': {'parr': 1}, 'fig.': > {

[web2py:35353] Re: new in trunk, for fun

2009-11-14 Thread mr.freeze
I decoded it. Appears to just be the giant dictionary of random words that populate uses. Starts and finishes like this: {'shoebill': {'a': 1, '187': 1}, 'trout-like': {'parr': 1}, 'fig.': {'19': 1},..

[web2py:35352] django's spaceless analog?

2009-11-14 Thread akonsu
hello, is there a way to remove whitespaces from generated xhtml output in a manner similar to django's spaceless tag? thanks konstantin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to

[web2py:35351] Re: new in trunk, for fun

2009-11-14 Thread villas
On Nov 14, 7:27 pm, Thadeus Burgess wrote: > By the way I wouldn't run that code. > Not sure exactly what that code in IUP evals too, but I WOULD NOT trust it. populate.py = 1.1 Mb !! Maybe Massimo can confirm it's safe :-) --~--~-~--~~~---~--~~ You received

[web2py:35350] Re: new in trunk, for fun

2009-11-14 Thread Thadeus Burgess
By the way I wouldn't run that code. I just read an article the other day about how hackers will embed code within base64 code, and it ends up extracting an entire programming environment that gives the hacker full access.. Not sure exactly what that code in IUP evals too, but I WOULD NOT tru

[web2py:35349] Re: new in trunk, for fun

2009-11-14 Thread Álvaro Justen [Turicas]
On Sat, Nov 14, 2009 at 16:32, villas wrote: > > Like Mr Freeze, I can't find "populate" on Google Code. > Maybe you forgot to add the file? > You can found the code at Launchpad (we need to centralize the development! We need BitBucket! ;-): http://bazaar.launchpad.net/~mdipierro/web2py/devel/a

[web2py:35348] Re: Editing Plugins

2009-11-14 Thread guruyaya
Hooray! Everything is working fine!!! On Nov 13, 11:57 pm, "mr.freeze" wrote: > No problemo.  Just reporting in case it helped. > > On Nov 13, 3:52 pm, mdipierro wrote: > > > fixed. sorry was working on trunk > > > On Nov 13, 3:12 pm, "mr.freeze" wrote: > > > > I get this on a new app running

[web2py:35347] Re: new in trunk, for fun

2009-11-14 Thread villas
Like Mr Freeze, I can't find "populate" on Google Code. Maybe you forgot to add the file? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.

[web2py:35346] Re: Incremental Development

2009-11-14 Thread Thadeus Burgess
Also, don't overwrite the files under databases/ folder, let the server version make its own. -Thadeus On Sat, Nov 14, 2009 at 11:52 AM, Iceberg wrote: > > On Nov15, 1:35am, Francisco wrote: > > Hi hello every one. > > > > I'm building a simple application that consists of three modules but

[web2py:35345] Re: Something wrong with MySQL. (possible bug?)

2009-11-14 Thread Thadeus Burgess
Did you delete your .table files and sql.log file before the switch? -Thadeus On Sat, Nov 14, 2009 at 9:59 AM, Benigno wrote: > > Hi, > >I have just installed a working application (working on sqlLite) > and now need to move it to MySQL, I have created a DB, and user with > access rights

[web2py:35344] Re: Incremental Development

2009-11-14 Thread Iceberg
On Nov15, 1:35am, Francisco wrote: > Hi hello every one. > > I'm building a simple application that consists of three modules but > they share some db tables. I have finish the first module and is right > now being tested. But I still need to finish the other two modules. > When I have finished t

[web2py:35343] Incremental Development

2009-11-14 Thread Francisco
Hi hello every one. I'm building a simple application that consists of three modules but they share some db tables. I have finish the first module and is right now being tested. But I still need to finish the other two modules. When I have finished the second one I would like to "upgrade" the ("h

[web2py:35342] Re: CRUD

2009-11-14 Thread mr.freeze
I think you need to pass the table name to fields: fields=['table.id','table.aaa','table.bbb'...] On Nov 14, 8:05 am, leone wrote: > On crud.select function, id link is disabled if you specify field > names: fields=['id','aaa','bbb'...] > Is it correct? > > On 14 Nov, 11:56, "mr.freeze" wrote:

[web2py:35341] Something wrong with MySQL. (possible bug?)

2009-11-14 Thread Benigno
Hi, I have just installed a working application (working on sqlLite) and now need to move it to MySQL, I have created a DB, and user with access rights (on localhost), and changed db.py db definition to 'mysql://username:passw...@localhost/dbname' I am getting the following error when I

[web2py:35340] Re: decimal type in web2py

2009-11-14 Thread Jonathan Lundell
On Nov 13, 2009, at 9:43 PM, mdipierro wrote: > > Fascinating. As an experiment I replaced str with repr and it usually > works with float. Float is better then integer because allows > migrations from one decimal type to float and vice versa and allows > for expressions involving different fie

[web2py:35339] Re: CRUD

2009-11-14 Thread leone
On crud.select function, id link is disabled if you specify field names: fields=['id','aaa','bbb'...] Is it correct? On 14 Nov, 11:56, "mr.freeze" wrote: > You need to set your crud settings before calling the crud functions: > > def add(): >     crud.settings.keepvalues = True >     crud.messag

[web2py:35338] Re: CRUD

2009-11-14 Thread leone
no effect...neither session.flash='' or message = '' On 14 Nov, 12:52, Iceberg wrote: > Use session.flash instead. > > On Nov14, 7:06pm, leone wrote: > > > > > Ooops... > > It runs but .update_next interferes with message in response.flash and > > redirect *before* the drop_down message

[web2py:35337] Re: a slice from the maestro himself: ubuntu deployment script

2009-11-14 Thread Alex Fanjul
Nice Massimo, so the problem was the port, I didnt realize... thanks El 13/11/09 21:04, mdipierro escribió: > What the script does is to start a web2py instance with admin from > localhost only and port 8123. So http://127.0.0.1:8123/admin will work > > The admin interface is not exposed via http

[web2py:35336] Re: decimal type in web2py

2009-11-14 Thread villas
> I am caching a flight tomorrow morning so I will probably be unable to > look at this again for 24hrs. Have a good trip! This feature can wait a few more days... FYI here is feedback from Firebird. The result was: ProgrammingError: (-842, 'isc_dsql_prepare: \n Dynamic SQL Error\n

[web2py:35335] Re: CRUD

2009-11-14 Thread Iceberg
Use session.flash instead. On Nov14, 7:06pm, leone wrote: > Ooops... > It runs but .update_next interferes with message in response.flash and > redirect *before* the drop_down message. > There is a way to redirect *after* notification of response.flash? > Thanks in advance. > > On 14 Nov, 11:56,

[web2py:35334] Re: new in trunk, for fun

2009-11-14 Thread mr.freeze
On subversion that is. On Nov 14, 5:03 am, "mr.freeze" wrote: > I don't see this in gluon.contrib. Did it get pulled? > > On Nov 12, 12:39 am, mdipierro wrote: > > > I do not know if this should be in web2py or not but it can be useful > > for testing and debugging. > > > from gluon.contrib.pop

[web2py:35333] Re: decimal type in web2py

2009-11-14 Thread yamandu
Maybe it´s a stupid statement, if it is forgive me, but here it goes: And if was there some kind of mask system, something similar to that in COBOL for example (yes, I know...but it was very practical) in the db model. Many db apps have this. In this case it could use regex or some something simpl

[web2py:35332] Re: CRUD

2009-11-14 Thread leone
Ooops... It runs but .update_next interferes with message in response.flash and redirect *before* the drop_down message. There is a way to redirect *after* notification of response.flash? Thanks in advance. On 14 Nov, 11:56, "mr.freeze" wrote: > You need to set your crud settings before calling

[web2py:35331] Re: new in trunk, for fun

2009-11-14 Thread mr.freeze
I don't see this in gluon.contrib. Did it get pulled? On Nov 12, 12:39 am, mdipierro wrote: > I do not know if this should be in web2py or not but it can be useful > for testing and debugging. > > from gluon.contrib.populate import populate > > db=DAL() > db.define_table('person', >            

[web2py:35330] Re: CRUD

2009-11-14 Thread leone
Thanks. There is no mention in manual. By On 14 Nov, 11:56, "mr.freeze" wrote: > You need to set your crud settings before calling the crud functions: > > def add(): >     crud.settings.keepvalues = True >     crud.messages.submit_button = 'Add' >     form = crud.create(db.things, >            

[web2py:35329] Re: CRUD

2009-11-14 Thread mr.freeze
You need to set your crud settings before calling the crud functions: def add(): crud.settings.keepvalues = True crud.messages.submit_button = 'Add' form = crud.create(db.things, message='Row added') return dict(form=form) def update(): crud.messages.s

[web2py:35328] CRUD

2009-11-14 Thread leone
I have no success to customize submit button in crud_create and crud_update. I can't redirect crud_update too. Where is my error? My code: def add(): form = crud.create(db.address, message='Row added') crud.settings.keepvalues = True crud.messages.submit_button

[web2py:35327] Re: plugin_tagging

2009-11-14 Thread dbb
Got it right, thank you Massimo. On Nov 13, 3:40 pm, dbb wrote: > I need some rest and look this plugin in a fresh mind. > > On Nov 13, 3:24 pm, dbb wrote: > > > > > Thank you Massimo, I was really confuse on which "view" you are > > talking, > > the view created by the plugin or the view in my