[web2py] a substitute for sqlite?

2010-03-24 Thread elffikk
Berkeley DB's new SQLite-compatible SQL API Oracle Berkeley DB 11g Release 2 introduces a new SQL API, based on SQLite, which is familiar to a large developer community and helps simplify application development. http://www.oracle.com/us/corporate/press/063695 A few things to note (from press

Re: [web2py] a substitute for sqlite?

2010-03-24 Thread Douglas Soares de Andrade
elffikk escreveu: Berkeley DB's new SQLite-compatible SQL API Oracle Berkeley DB 11g Release 2 introduces a new SQL API, based on SQLite, which is familiar to a large developer community and helps simplify application development. http://www.oracle.com/us/corporate/press/063695 A few things to

[web2py] Re: zengarden anybody?

2010-03-24 Thread mdmcginn
CSS is great, much better than table-based web design, and csszengarden deserves a lot of credit for demonstrating that. But it is just a proof of concept. As you noted, their basic HTML is full of empty divs into which designers can insert fancy images, so it's not a good base for templates. On

[web2py] Re: a substitute for sqlite?

2010-03-24 Thread mdipierro
I agree with Douglas. On Mar 24, 3:47 am, Douglas Soares de Andrade dsandr...@gmail.com wrote: elffikk escreveu: Berkeley DB's new SQLite-compatible SQL API Oracle Berkeley DB 11g Release 2 introduces a new SQL API, based on SQLite, which is familiar to a large developer community and

[web2py] Ajax and Auth API

2010-03-24 Thread Yannick
Hello mate, This can be an easy question but I don't know how to used the Web2py Ajax (u,s,t) function to call build-in Web2py Authentication API. It's there any example ?... There is a cool example using JDiv: def register(): return auth.register(onaccept=lambda form: jDiv.flash('try

[web2py] Re: Survey: Functionality of the Drop Boxes widget

2010-03-24 Thread Iceberg
On Mar23, 2:29pm, weheh richard_gor...@verizon.net wrote: Thadeus, it's 6 of one, half-dozen of the other to me. I use both. So in theory, it doesn't really matter which is the default. Therefore, I prefer that the default remain whatever it currently is so that I don't have to change any of

[web2py] Re: how to import a python library (not single file) from modules

2010-03-24 Thread Jon Romero
This doesn't seem to work when you are running on AppEngine! It works perfectly outside but when I am running it using dev_appserver, it doesn't work. Is this a bug? On Mar 18, 4:54 pm, mdipierro mdipie...@cs.depaul.edu wrote: You should put them in web2py/site-packages On Mar 18, 9:35 am,

[web2py] A doubt with SQLFORM

2010-03-24 Thread Abhishek Mishra
Hi guys, I am trying to learn/try out web2py from scratch. I'm making a simple poll application right now. So, to add a poll, I'm trying to use automatically generated SQLFORMs as in - pollform=SQLFORM(db.poll, fields=['question'], labels={'question':'Poll Question'}) I was looking for a way

[web2py] Re: Ajax and Auth API

2010-03-24 Thread mdipierro
You should make your own action and use {{=LOAD(..)}} On Mar 24, 9:32 am, Yannick ytchatch...@gmail.com wrote: Hello mate, This can be an easy question but I don't know how to used the Web2py Ajax (u,s,t) function to call build-in Web2py Authentication API. It's there any example ?... There

[web2py] Re: Survey: Functionality of the Drop Boxes widget

2010-03-24 Thread mdipierro
It is not that simple. zero='' was introduced about one year ago because of popular demand at the time and very few people spoke against it. If you change it now you revert to the behavior you had one year ago but most recent applications will change behavior. This consultation should have a

[web2py] Re: how to import a python library (not single file) from modules

2010-03-24 Thread mdipierro
You have to add the folder to sys.path in gaehandler.py It may be considered a bug so I fixed it. On Mar 24, 6:32 am, Jon Romero darks...@gmail.com wrote: This doesn't seem to work when you are running on AppEngine! It works perfectly outside but when I am running it using dev_appserver, it

[web2py] Re: A doubt with SQLFORM

2010-03-24 Thread mdipierro
You do not specify the field labels at the level for the form form=SQLFORM(...,labels=...) # WRONG You specify them at the level of the fields db.table.field.label='...' form=SQLFORM(db.table) Massimo On Mar 24, 9:28 am, Abhishek Mishra ideam...@gmail.com wrote: Hi guys, I am trying to

[web2py] new SQLFORM

2010-03-24 Thread mdipierro
There is a new SQLFORM in trunk. It works as the one before and it is backward compatible but it allows form=SQLFORM(...,formstyle='table3cols') # the default but also... form=SQLFORM(...,formstyle='table2cols') form=SQLFORM(...,formstyle='divs') form=SQLFORM(...,formstyle='ul') I do not think

[web2py] Re: new SQLFORM

2010-03-24 Thread mdipierro
also check the various CSS DIV, LI, TR, TD naming conventions since once stable it cannot be changed. On Mar 24, 10:28 am, mdipierro mdipie...@cs.depaul.edu wrote: There is a new SQLFORM in trunk. It works as the one before and it is backward compatible but it allows

[web2py] how's going to make a plugin?

2010-03-24 Thread mdipierro
http://nivo.dev7studios.com/ -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit

[web2py] Re: Ajax and Auth API

2010-03-24 Thread Yannick
Sorry I really don't understand... I have to code my own Auth function like register(), login() etc... it that what you meant ? Yes I know I have to create my own action but I wanted to re-use the Auth Api function by calling them inside my action... So basically what you are saying is that i

[web2py] Re: A doubt with SQLFORM

2010-03-24 Thread mdipierro
My answer was wrong. Your question was correct and I apologize. I checked the code again. I tried: SQLFORM(db.auth_user,fields=['first_name'],labels={'first_name':'Your Name'}).xml() 'form action= enctype=multipart/form-data method=posttabletr id=auth_user_first_name__rowtd class=w2p_fllabel

[web2py] Re: Ajax and Auth API

2010-03-24 Thread mdipierro
show us your action and explan how you want it to behave in details, and I can post an example. On Mar 24, 11:06 am, Yannick ytchatch...@gmail.com wrote: Sorry I really don't understand... I have to code my own Auth function like register(), login() etc... it that what you meant ? Yes I know

[web2py] Re: A doubt with SQLFORM

2010-03-24 Thread Abhishek Mishra
Oh thats a nicer thing to do... So right into db.py I could write say db.poll.question.label = 'Question here' Could I ? :) On Mar 24, 8:26 pm, mdipierro mdipie...@cs.depaul.edu wrote: You do not specify the field labels at the level for the form form=SQLFORM(...,labels=...) # WRONG You

[web2py] Re: A doubt with SQLFORM

2010-03-24 Thread mdipierro
yes On Mar 24, 11:07 am, Abhishek Mishra ideam...@gmail.com wrote: Oh thats a nicer thing to do... So right into db.py I could write say db.poll.question.label = 'Question here' Could I ? :) On Mar 24, 8:26 pm, mdipierro mdipie...@cs.depaul.edu wrote: You do not specify the field

[web2py] Re: A doubt with SQLFORM

2010-03-24 Thread Abhishek Mishra
Okay, I will follow that way from now on. I have one more doubt, How do I pre-fill values in an autogenerated SQLFORM? I tried looking for it but couldn't find a way. So, currently in the poll app I made - page 1. user adds a new poll page 2. once validated, it takes user to a page where he can

[web2py] Re: A doubt with SQLFORM

2010-03-24 Thread mdipierro
I wote a plugin for this last month and I posted on this list but I lost it. If somebody can find it please re-post it. Massimo On Mar 24, 11:14 am, Abhishek Mishra ideam...@gmail.com wrote: Okay, I will follow that way from now on. I have one more doubt, How do I pre-fill values in an

[web2py] Re: A doubt with SQLFORM

2010-03-24 Thread Abhishek Mishra
Alright I'll try looking for it, Thanks On Mar 24, 9:21 pm, mdipierro mdipie...@cs.depaul.edu wrote: I wote a plugin for this last month and I posted on this list but I lost it. If somebody can find it please re-post it. Massimo snip -- You received this message because you are subscribed

[web2py] Preferred way to update values?

2010-03-24 Thread Abhishek Mishra
I found this to be a little out of conventional way... Initially my app - http://hello-poll.appspot.com used to update tables in this way - method #1 db(db.choice.id==request.vars.cid).update(votes = db.choice.votes + 1) ^ This worked well on local web2py and appengine instance. However on

[web2py] Re: Ajax and Auth API

2010-03-24 Thread Yannick
Ok here is a view form to change user password: ### script $(#pwdChangeForm).submit(function(){ url={{=URL(r=requet, f=changePwd)}}; ids = ['currentpwd', 'pwd1', 'pwd2']; ajax(url, ids, 'confirmationMsg'); # This is the Ajax method that

[web2py] File containing all imports needed for autocomplete functionality

2010-03-24 Thread Renato-ES-Brazil
Hi guys, How about create a file containing all imports needed for autocomplete (intellisense) to work in the editors like Eclipse and Netbeans? :-) It would be nice to keep it in a separate file and updated in repository for anyone to use and import when you want to use an editor with this

[web2py] Re: A doubt with SQLFORM

2010-03-24 Thread Renato-ES-Brazil
Massimo, Are the obsolete codes generating warnings in any log? Where can I see them? Thanks... On 24 mar, 13:28, Abhishek Mishra ideam...@gmail.com wrote: Alright I'll try looking for it, Thanks On Mar 24, 9:21 pm, mdipierro mdipie...@cs.depaul.edu wrote: I wote a plugin for this last

[web2py] Re: A doubt with SQLFORM

2010-03-24 Thread mdipierro
no since they still work and will continue to support them. On Mar 24, 12:53 pm, Renato-ES-Brazil renatoa...@gmail.com wrote: Massimo, Are the obsolete codes generating warnings in any log? Where can I see them? Thanks... On 24 mar, 13:28, Abhishek Mishra ideam...@gmail.com wrote:

[web2py] Re: Ajax and Auth API

2010-03-24 Thread mdipierro
### script $(#pwdChangeForm).submit(function(){ url={{=URL(r=requet, f=changePwd)}}; ids = ['currentpwd', 'pwd1', 'pwd2']; ajax(url, ids, 'confirmationMsg'); # This is the Ajax method that is coming with Web2py return false; });

[web2py] upload and LOAD

2010-03-24 Thread Jose
Hello, why this not work? Model: tb_prueba = db.define_table('prueba', Field('nombre'), Field('archivo','upload') ) Controller (default): def subirdoc(): return dict() def form_doc(): return crud.create(tb_prueba) View (default/subirdoc.html): h2Form 1/h2 {{=LOAD('default',

[web2py] Re: A doubt with SQLFORM

2010-03-24 Thread Renato-ES-Brazil
Ok. Right, but and the others functionalities deprecated? Are they registered as warning in log? On 24 mar, 15:01, mdipierro mdipie...@cs.depaul.edu wrote: no since they still work and will continue to support them. On Mar 24, 12:53 pm, Renato-ES-Brazil renatoa...@gmail.com wrote:

[web2py] register action redirects to profile view

2010-03-24 Thread salbefe
Hello, I do not know why but on the default login form that I have on my application, If I click on the register link web2py redirects to the profile view. The default/user controller is the same as the welcome application and the default/user.html view the same. That happens only on my app. The

[web2py] Re: register action redirects to profile view

2010-03-24 Thread salbefe
... And the register link, links correctly to /init/dafult/user/ register -- 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] Re: book chapters

2010-03-24 Thread Magnitus
We can make modifications to the book, ala wiki? On Mar 24, 1:37 am, mdipierro mdipie...@cs.depaul.edu wrote: If you make a major contribution to the book (like a new section), you should sign it with your name. This is because if I incorporate the chapter in a future printed version, I will

[web2py] Re: register action redirects to profile view

2010-03-24 Thread salbefe
SOLVED. Something was happened with firefox Sorry -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com.

Re: [web2py] web2py production deployment on vps.net (VIDEO)

2010-03-24 Thread Albert Abril
Purchased one month for testing. I'll give my impressions, at the moments, great. On Wed, Mar 24, 2010 at 1:51 AM, Álvaro Justen [Turicas] alvarojus...@gmail.com wrote: On Tue, Mar 23, 2010 at 12:49, mdipierro mdipie...@cs.depaul.edu wrote: The video: http://vimeo.com/10377947

[web2py] Re: Issues with the documentation

2010-03-24 Thread Magnitus
Web/Pdf Ambiguity: In section 4.12, a one-liner mention is made of the Accept-Language field, but it might not be sufficient for someone who is inexperienced with the HTTP protocol to grasp (that it is something the user usually sets in his browser for example). Perhaps a brief introduction to

[web2py] Re: upload and LOAD

2010-03-24 Thread mdipierro
It is a logical problem. The server action has not way to determine which of the three LOAD blocks is doing the submit. This can be solved but I suggest look for a better design that trying to create three identical forms. On Mar 24, 1:15 pm, Jose jjac...@gmail.com wrote: Hello, why this not

[web2py] Re: A doubt with SQLFORM

2010-03-24 Thread mdipierro
No. They are not officially deprecated. It is just that there is a better way to do it. We will not stop supporting them. There is no reason for any warning. On Mar 24, 1:30 pm, Renato-ES-Brazil renatoa...@gmail.com wrote: Ok. Right, but and the others functionalities deprecated? Are they

Re: [web2py] web2py production deployment on vps.net (VIDEO)

2010-03-24 Thread Albert Abril
I don't know if it's my fault, but the 'web2py ubuntu setup' script failed on a basic installation of ubuntu 9.10 at the vps.net ( http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh ) * Restarting web server apache2 * We failed to correctly shutdown apache, so we're now killing

[web2py] Re: upload and LOAD

2010-03-24 Thread Jose
On 24 mar, 19:47, mdipierro mdipie...@cs.depaul.edu wrote: It is a logical  problem. The server action has not way to determine which of the three LOAD blocks is doing the submit. This can be solved but I suggest look for a better design that trying to create three identical forms. ok, I

[web2py] Re: book chapters

2010-03-24 Thread mdipierro
yes. You can attach wiki pages to existing page. You can also edit actual book bages but you need to privately email me to get access. On Mar 24, 1:52 pm, Magnitus eric_vallee2...@yahoo.ca wrote: We can make modifications to the book, ala wiki? On Mar 24, 1:37 am, mdipierro

[web2py] Re: upload and LOAD

2010-03-24 Thread mdipierro
That is a bug. The problem is that it is not technically a web2py bug but a limitation of jquery.submit. I think there is a jquery plugin to extend the jquery.submit functionality to multipart forms. If you find it and try it, let us know. On Mar 24, 3:06 pm, Jose jjac...@gmail.com wrote: On 24

[web2py] Re: how's going to make a plugin?

2010-03-24 Thread Mengu
how or who? On 24 Mart, 17:42, mdipierro mdipie...@cs.depaul.edu wrote: http://nivo.dev7studios.com/ -- 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,

[web2py] Re: upload and LOAD

2010-03-24 Thread Jose
On 24 mar, 20:17, mdipierro mdipie...@cs.depaul.edu wrote: That is a bug. The problem is that it is not technically a web2py bug but a limitation of jquery.submit. I think there is a jquery plugin to extend the jquery.submit functionality to multipart forms. If you find it and try it, let us

[web2py] Re: how's going to make a plugin?

2010-03-24 Thread mdipierro
who! not how. Ouch. On Mar 24, 3:32 pm, Mengu whalb...@gmail.com wrote: how or who? On 24 Mart, 17:42, mdipierro mdipie...@cs.depaul.edu wrote: http://nivo.dev7studios.com/ -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this

[web2py] Re: A doubt with SQLFORM

2010-03-24 Thread Renato-ES-Brazil
I was talking about it: http://groups.google.com/group/web2py/browse_thread/thread/55749765353781f5/05298cdbca78f0db On 24 mar, 16:48, mdipierro mdipie...@cs.depaul.edu wrote: No. They are not officially deprecated. It is just that there is a better way to do it. We will not stop supporting

[web2py] Re: A doubt with SQLFORM

2010-03-24 Thread mdipierro
Sorry I misunderstood. Right now there is not deprecation warning on anything I can remember. On Mar 24, 4:39 pm, Renato-ES-Brazil renatoa...@gmail.com wrote: I was talking about it:http://groups.google.com/group/web2py/browse_thread/thread/5574976535... On 24 mar, 16:48, mdipierro

[web2py] default web2py not working with GAE ?

2010-03-24 Thread dme69
Hello all, I just tried to create a new gae project (on os x) by creating a new application with existing source : with fresh web2py folder. When I try to run with the googleappenginelauncher this new application it goes to welcome/default/index but it's not working : it's creating a ticket

[web2py] mixing widgets and validators

2010-03-24 Thread Jonathan Lundell
I find myself a little confused on this issue. How do I get a Field to display as a text field, but validate like IS_IN_SET? (I've got a set that's too big for a drop-down.) And how does IS_IN_SET cause a field to become a drop-down box? By virtue of having an options method? -- You received

[web2py] Re: how's going to make a plugin?

2010-03-24 Thread Joschua
massimo can you answer me at Bug in DocTests http://groups.google.com/group/web2py/browse_thread/thread/b21bea489c684acc/020a01e5990198a3?hl=de -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to

Re: [web2py] web2py production deployment on vps.net (VIDEO)

2010-03-24 Thread Albert Abril
Worked correctly with a 8.04 LTS clean and basic installation. Should I open a new thread about testing the script? On Wed, Mar 24, 2010 at 8:49 PM, Albert Abril albert.ab...@gmail.comwrote: I don't know if it's my fault, but the 'web2py ubuntu setup' script failed on a basic installation of

[web2py] useful new jqueryui features

2010-03-24 Thread Richard
JQuery UI has some nice new features: Autocomplete: http://jqueryui.com/demos/autocomplete/ Fancy buttons / radios / checkboxes: http://jqueryui.com/demos/button/#toolbar And you can load if from Google's CDN: http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js

Re: [web2py] web2py production deployment on vps.net (VIDEO)

2010-03-24 Thread Álvaro Justen [Turicas]
On Wed, Mar 24, 2010 at 16:49, Albert Abril albert.ab...@gmail.com wrote: I don't know if it's my fault, but the 'web2py ubuntu setup' script failed on a basic installation of ubuntu 9.10 at the vps.net ( http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh )  * Restarting web

[web2py] Re: Preferred way to update values?

2010-03-24 Thread Richard
try something like this: record = db(db.choice.id == request.vars.cid).select().first() record.update_record(votes=record.votes + 1) On Mar 25, 4:10 am, Abhishek Mishra ideam...@gmail.com wrote: I found this to be a little out of conventional way... Initially my app

[web2py] Re: File containing all imports needed for autocomplete functionality

2010-03-24 Thread Richard
I got autocomplete working with Komodo by creating a plugin that preprended something like that to all Python files: http://community.activestate.com/forum/implicit-python-code-completion On Mar 25, 4:31 am, Renato-ES-Brazil renatoa...@gmail.com wrote: Hi guys, How about create a file

[web2py] Re: File containing all imports needed for autocomplete functionality

2010-03-24 Thread Richard
also there was a related thread earlier: http://groups.google.com/group/web2py/browse_thread/thread/f179e5a1894e5693#92e8a9dfa51b71ab On Mar 25, 11:04 am, Richard richar...@gmail.com wrote: I got autocomplete working with Komodo by creating a plugin that preprended something like that to all

[web2py] Re: list of web hosting providers that work for web2py

2010-03-24 Thread Richard
On Mar 23, 10:40 am, mr.freeze nat...@freezable.com wrote: Hostgator works but it's not as easy as it could be. I'll try to put together a slice soon. Looking forward to it. I have a client who already uses Hostgator and they won't want to move elsewhere just for my framework. On Mar 23,

[web2py] Re: list of web hosting providers that work for web2py

2010-03-24 Thread Richard
serveraxis.com sounds interesting. My webfaction subscription runs out soon and I am considering moving elsewhere because it is a bit slow and I want root access. Do you use a single web2py installation for those 10 apps? On Mar 23, 4:06 pm, Julio ju...@techfuel.net wrote: Hey Richard, I

[web2py] Re: default web2py not working with GAE ?

2010-03-24 Thread mdipierro
You MUST use python 2.5 Massimo On Mar 24, 5:20 pm, dme69 dmeg...@gmail.com wrote: Hello all, I just tried to create a new gae project (on os x) by creating a new application with existing source : with fresh web2py folder. When I try to run with the googleappenginelauncher this new

[web2py] Re: mixing widgets and validators

2010-03-24 Thread mdipierro
requires=[IS_IN_SET(...)] On Mar 24, 5:27 pm, Jonathan Lundell jlund...@pobox.com wrote: I find myself a little confused on this issue. How do I get a Field to display as a text field, but validate like IS_IN_SET? (I've got a set that's too big for a drop-down.) And how does IS_IN_SET

[web2py] Re: Bug in DocTests?

2010-03-24 Thread mdipierro
Yes. But I need you to register first and tell me your login email. Email me personally about this. On 21 Mrz., 11:31, Joschua cit_corperat...@gmx.net wrote: oh, btw. can you make me an editor at the web2py-book and how can i contribute to the source? On 21 Mrz., 17:30, Joschua

[web2py] Re: new SQLFORM

2010-03-24 Thread Jose
maybe this is causing problems when the parameter deletable=True Error: File /usr/home/jose/w2p/gluon/sqlhtml.py, line 748, in __init__ col3.get(self.FIELDKEY_DELETE_RECORD, '')) TypeError: append() takes exactly one argument (3 given someone could review Jose -- You received this message

[web2py] wiki features/bugs

2010-03-24 Thread Richard
I tried using the wiki and have some feedback: How do I create a new page? The front page suggests going to Pages section and clicking on the create new page link, but this link does not exist. How do I edit a page? When I try editing I get The page isn't redirecting properly. By default

[web2py] Re: list of web hosting providers that work for web2py

2010-03-24 Thread mr.freeze
I just canceled my account. There is no way to get python 2.5 installed and there are issues with hashlib on version 2.4 with CRYPT so it was a bust for me. Too bad, their servers are fast. I'm going to skip making a slice but here's how I got it working: 1) Get them to install pysqlite,

[web2py] Re: Ajax and Auth API

2010-03-24 Thread Yannick
Sorry but I have a lot of syntax error in the action: auth.change_password(onaccept=lambda form: response.headers['web2py- component-command']=document.location='%s'%next)) I don't seems to see why... Please let me know if you see it... Thanks, On Mar 24, 2:00 pm, mdipierro

[web2py] Re: new SQLFORM

2010-03-24 Thread Jose
I sent a patch to Massimo -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit

[web2py] Book typo: 9.2. Remote Procedure Calls

2010-03-24 Thread Rowdy
Greetings, There is a typo in the example for XMLRPC in section 9.2 of the (online) book. The example method: @service.xmlrpc def div(a,b): return a+b should be: @service.xmlrpc def div(a,b): return a/b Rowdy -- You received this message because you are subscribed to the Google

[web2py] Re: Ajax and Auth API

2010-03-24 Thread mdipierro
My bad auth.change_password(onaccept=lambda form: response.headers.update({'web2py- component-command']:document.location='%s'%next})) On Mar 24, 8:21 pm, Yannick ytchatch...@gmail.com wrote: Sorry but I have a lot of syntax error in the action: auth.change_password(onaccept=lambda form:

[web2py] Re: new SQLFORM

2010-03-24 Thread mdipierro
Thank you! On Mar 24, 8:21 pm, Jose jjac...@gmail.com wrote: I sent a patch to Massimo -- 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] prepend a string to a field

2010-03-24 Thread Russell
Hi there, I'm trying to prepend a string to a field. While, this works: db(db.person.id0).update(name = db.person.name + x) This does not: db(db.person.id0).update(name = x + db.person.name) Traceback (most recent call last): File string, line 1, in fragment TypeError: cannot concatenate

[web2py] Re: prepend a string to a field

2010-03-24 Thread mr.freeze
Try this: db(db.person.id0).update(name = %s%s % (db.person.name,x)) On Mar 24, 9:52 pm, Russell russell.mcmur...@gmail.com wrote: Hi there, I'm trying to prepend a string to a field.  While, this works: db(db.person.id0).update(name = db.person.name + x) This does not:

[web2py] Re: prepend a string to a field

2010-03-24 Thread mr.freeze
Whoops, backwards: db(db.person.id0).update(name = %s%s % (x,db.person.name)) On Mar 24, 9:57 pm, mr.freeze nat...@freezable.com wrote: Try this: db(db.person.id0).update(name = %s%s % (db.person.name,x)) On Mar 24, 9:52 pm, Russell russell.mcmur...@gmail.com wrote: Hi there, I'm trying

[web2py] Re: prepend a string to a field

2010-03-24 Thread Russell
Thanks very much for the reply. Sorry to say that it doesn't work. Your answer gives this... UPDATE person SET name='xSUBSTR(person.name,1,(1 - 0))'; On Mar 25, 3:58 pm, mr.freeze nat...@freezable.com wrote: Whoops, backwards: db(db.person.id0).update(name = %s%s % (x,db.person.name)) On

Re: [web2py] Re: Survey: Functionality of the Drop Boxes widget

2010-03-24 Thread Thadeus Burgess
I am not sure of the exact time frame that this was introduced (zero='', breaking backwards-compatibility) by it was only a matter of a couple of months ago, not a year. The exact date was 2010-01-03 of this change, at http://bazaar.launchpad.net/~mdipierro/web2py/devel/revision/1497 Should I

[web2py] For your knowledge

2010-03-24 Thread Thadeus Burgess
http://academicearth.org/courses/building-dynamic-websites -Thadeus -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to

[web2py] Re: prepend a string to a field

2010-03-24 Thread Russell
A bigger problem... On further testing, it looks like db(db.person.id0).update(name = db.person.name + x) does NOT work. The DAL seems to treat this as an integer addition and the field is updated to 0 (at least on sqlite). On Mar 25, 4:11 pm, Russell russell.mcmur...@gmail.com wrote: Thanks

[web2py] Re: prepend a string to a field

2010-03-24 Thread mr.freeze
This is ugly but should work: from gluon.sql import Expression db(db.person.id0).update(name = Expression('person.name || x')) I'm almost positive there is a better way. On Mar 24, 10:43 pm, Russell russell.mcmur...@gmail.com wrote: A bigger problem... On further testing, it looks like

Re: [web2py] Re: prepend a string to a field

2010-03-24 Thread Thadeus Burgess
hrm... for row in db(db.person.id 0).select(): row.update_record(name = row.name + x) This also will work, although not as efficient since the processing will be done in python and not the database. -Thadeus On Wed, Mar 24, 2010 at 11:10 PM, mr.freeze nat...@freezable.com wrote: This

[web2py] Re: prepend a string to a field

2010-03-24 Thread Russell
Thanks both of you for your replies. I've been trying to avoid doing it in python (lots of records) so I think I'll try mr.freeze's solution. On Mar 25, 5:18 pm, Thadeus Burgess thade...@thadeusb.com wrote: hrm... for row in db(db.person.id 0).select():    row.update_record(name = row.name