[web2py] Re: auth_user.id == kenneth

2011-07-14 Thread Massimo Di Pierro
fields expect the type they have. references and integers expect integers, double expects integer or float or double, date expects a date, etc. Anyway because this is a current issue there is a shortcut: user = db.auth_user(request.args(0)) or redirect(URL('error')) and even if request.args(0) i

[web2py] Re: shell tool used for videos

2011-07-14 Thread Massimo Di Pierro
It is not open source yet. I am still working on it. But it is very close to playpiano for ipython and use osx "say" command for text to speach On Jul 14, 3:07 pm, Manu wrote: > Hi Massimo; >   I was interested to know what is the tool you are using to script > your presentation ( open web page;

[web2py] Re: We just hit 3000 members!

2011-07-14 Thread Massimo Di Pierro
Congratulations everybody for hitting 3000. Our 3000s member wins a copy of the PDF book. Please claim it. Massimo On Jul 14, 3:34 pm, Anthony wrote: > Does member #3000 get a prize? > >

[web2py] Message to the creator of Tenthrow regarding Paypal

2011-07-14 Thread Andrew Evans
Hello I am having troubles integrating your code into even a simple example. I was hoping you could help me by creating a working example of your code called something like paypal_test and packing it into a web2py file so I can then work on it in my own code. As well as telling me how you generat

[web2py] Re: Can't get linkto working in SQLFORM

2011-07-14 Thread tcab
I've been working through the book and have encountered exactly the same problem. The query has a spurious 'list_records' in front of it. book is http://www.web2py.com/book/default/chapter/07?search=URL web2py version is the latest 1.97.1 running under windows 7 -Andy On Jul 12, 10:08 pm, jc wr

[web2py] Re: Can't get linkto working in SQLFORM

2011-07-14 Thread tcab
I get this too - a spurious "list_records." prepended to the query. Latest web2py 1.97.1 -Andy On Jul 12, 10:08 pm, jc wrote: > Hi, > Trying to use linkto, so following example in web2py > book > first, > to try to under

[web2py] Re: compute fields on update

2011-07-14 Thread niknok
I just tested this on v1.97.1 , and confirm that from the shell the record doesn't appear to be updated even after a db.commit(). However, using appadmin to check the database, the records were actually are updated. But if do it like this: for i in db(db.item.id>0).select(): i.quantity, i.unit_pri

[web2py] Re: compute fields on update

2011-07-14 Thread guruyaya
As for what you said, pbreit - this is acctually a copy paste of the book. The version installed is 1.97.1 As for your your 2nd suggestion >>> db.item.total_price.compute = lambda r: float(r['unit_price']) * >>> float(r['quantity']) >>> r = db.item.insert(unit_price=1.99, quantity=3) >>> r.total_

[web2py] Re: compute fields on update

2011-07-14 Thread guruyaya
>>> db.commit() >>> db(db.item.id == 1).select()[0].total_price '9.95' >>> db(db.item.id == 1).select()[0] at 0x17f1758>, 'unit_price': 3.0, 'id': 1, 'delete_record': at 0x17f17d0>, 'quantity': 5}> On Jul 15, 12:54 am, niknok wrote: > You're checking it from the shell. Do a db.commit() before

Re: [web2py] Re: New Plugin: plugin_ckeditor

2011-07-14 Thread Tito Garrido
How to install it? Regards, Tito On Sat, Jul 9, 2011 at 3:35 PM, cjrh wrote: > Very nice. I'm thinking how this is going to be immediately useful in a > blog context for non-technical authors. -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:_

[web2py] Re: slides of the San Francisco talk

2011-07-14 Thread weheh
Great slides. On Jul 14, 2:33 pm, Massimo Di Pierro wrote: > http://www.scribd.com/doc/60038745/web2py-talk

[web2py] Re: auth_user.id == kenneth

2011-07-14 Thread niknok
As far as I know only with ID, which is always auto-magically created for you. On Jul 15, 6:54 am, Kenneth Lundström wrote: > Thanks, > > logic error noted, in this case it woun t be a problem. Can t think of a > fix without changing the idea behind this. > > I find it interesting that some field

[web2py] Re: auth_user.id == kenneth

2011-07-14 Thread niknok
In that case, this should work as well: query = db.auth_user.id == request.args[0]).select() if request.args[0].isdigit() else db.auth_user.username == request.args[0] user_id = db(query).select()[0].id or 0 On Jul 15, 6:54 am, Kenneth Lundström wrote: > Thanks, > > logic error noted, in this

Re: [web2py] Re: auth_user.id == kenneth

2011-07-14 Thread Kenneth Lundström
Thanks, logic error noted, in this case it woun´t be a problem. Can´t think of a fix without changing the idea behind this. I find it interesting that some fields expect a specific type. Is ID the only one? user = db(db.auth_user.id == request.args[0] if request.args[0].isdigit() else 0).se

[web2py] Re: auth_user.id == kenneth

2011-07-14 Thread niknok
request.args always contain strings. str(request.args(0)) is extraneous There's a logic hole here: What if my username is "1" but my record's id is 22. This code will return the record db.auth_user[1] when it's supposed to return db.auth_user[22] Anyway, ou get "invalid literal for int() with bas

[web2py] Re: web2py with jquery mobile?

2011-07-14 Thread Anthony
http://web2py.com/plugins/plugin_jqmobile/about

[web2py] Re: compute fields on update

2011-07-14 Thread niknok
You're checking it from the shell. Do a db.commit() before checking for total_price. On Jul 15, 3:37 am, guruyaya wrote: > This is run on a web2py shell: > > >>> db.define_table('item', > > ...         Field('unit_price','double'), > ...         Field('quantity','integer'), > ...         Field('t

[web2py] web2py with jquery mobile?

2011-07-14 Thread António Ramos
hello, is there sample video showing how to use web2py and jquery mobile ? maybe a an appliance to download from web2py. thank you Antonio

[web2py] auth_user.id == kenneth

2011-07-14 Thread Kenneth Lundström
Hello, why can´t I do this: user = db(db.auth_user.id == 'kenneth').select() I know that this should result in len(user) = 0 but I´m sending sometimes a text and sometimes a number and I´m trying to do this: user = db(db.auth_user.id == str(request.args[0])).select() if len(use

Re: [web2py] We just hit 3000 members!

2011-07-14 Thread Anthony
Sorry, didn't mean to be English-centric, though I assume there's a lot of overlap among the different groups: 3000: https://groups.google.com/group/web2py/about?hl=en&noredirect=true 81: https://groups.google.com/group/web2py-developers/about?hl=en&noredirect=true 243: https://groups.google.c

Re: [web2py] We just hit 3000 members!

2011-07-14 Thread Bruno Rocha
3243 http://awesomescreenshot.com/08agmmiad On Thu, Jul 14, 2011 at 5:34 PM, Anthony wrote: > Does member #3000 get a prize? > > > > > > -- -- Bruno Rocha [ About me: http://zerp.ly/rochacbrun

[web2py] We just hit 3000 members!

2011-07-14 Thread Anthony
Does member #3000 get a prize?

[web2py] Re: Off topic: are Google Groups wires crossed?

2011-07-14 Thread Anthony
There's no problem when viewing the web2py user group. The problem is that many of our threads are also getting posted to other spam groups (as LightDot pointed out, probably because the email addresses of those spam groups are registered as members of our group, so any posts to our group get f

[web2py] Re: Off topic: are Google Groups wires crossed?

2011-07-14 Thread pbreit
I access the Group via the web and via the new interface and don't see any problems: https://groups.google.com/d/?fromgroups

[web2py] Re: compute fields on update

2011-07-14 Thread pbreit
That definitely looks like it should work according to the book. What do you get when you do it exactly like the book? >>> db.define_table('item', Field ('unit_price','double'), Field

[web2py] shell tool used for videos

2011-07-14 Thread Manu
Hi Massimo; I was interested to know what is the tool you are using to script your presentation ( open web page; text2voice ...) Thx

[web2py] Re: slides of the San Francisco talk

2011-07-14 Thread pbreit
Massimo's talk was well-received and I was happy to meet him in person for the first time.

Re: [web2py] Re: embedding html into python strings and getting them to render correctly

2011-07-14 Thread stephen_leaning
ok thanks v much for swift reply to all who replied, in particular to Ross who proposed a solution and it works good night from  luxembourg + --

Re: [web2py] slides of the San Francisco talk

2011-07-14 Thread Martín Mulone
STOLEN!! jaja. It's a must read massimo, put in the main page. 2011/7/14 Bruno Rocha > On Thu, Jul 14, 2011 at 3:33 PM, Massimo Di Pierro < > mdipie...@cs.depaul.edu> wrote: > >> http://www.scribd.com/doc/60038745/web2py-talk >> > > I also gave a Talk about web2py on TheDevelopersConference 2011

[web2py] compute fields on update

2011-07-14 Thread guruyaya
This is run on a web2py shell: >>> db.define_table('item', ... Field('unit_price','double'), ... Field('quantity','integer'), ... Field('total_price', ... compute=lambda r: r['unit_price']*r['quantity'])) . . . >>> r = db.item.insert(unit_price=1.99, quantity=5

[web2py] Re: embedding html into python strings and getting them to render correctly

2011-07-14 Thread Anthony
The XML object is documented here: http://web2py.com/book/default/chapter/05#XML. Just pass the string to XML() directly. In the example you found, variations[x].content was specific to that particular example (i.e., variations[x].content represented the string to be displayed). Note, XML(...

[web2py] Re: slides of the San Francisco talk

2011-07-14 Thread Stefaan Himpe
http://www.scribd.com/doc/60038745/web2py-talk The slides are stunningly informative and beautiful.

Re: [web2py] slides of the San Francisco talk

2011-07-14 Thread Bruno Rocha
I almost forgot... Congrats, very nice slides! I will copy some slides to use with my students and maybe in PyConBrasil

Re: [web2py] slides of the San Francisco talk

2011-07-14 Thread Bruno Rocha
On Thu, Jul 14, 2011 at 3:33 PM, Massimo Di Pierro wrote: > http://www.scribd.com/doc/60038745/web2py-talk > I also gave a Talk about web2py on TheDevelopersConference 2011 ( http://www.thedevelopersconference.com.br/tdc/2011/saopaulo/trilha-python#programacao ) Coincidentally my Slides have som

[web2py] Re: embedding html into python strings and getting them to render correctly

2011-07-14 Thread Ross Peoples
Not sure where the variations variable is coming from, but putting pre-formatted HTML into a view is simple. In your controller, you have to include the html as an item in the dict() that is returned. Here is an example controller: def test(): html = 'Hello World' return dict(html=html)

[web2py] slides of the San Francisco talk

2011-07-14 Thread Massimo Di Pierro
http://www.scribd.com/doc/60038745/web2py-talk

[web2py] embedding html into python strings and getting them to render correctly

2011-07-14 Thread steveL
In my web2py database I am storing strings with embedded html in. When I try to render these records in my views the html is not rendered (ie I get the string I put into the database with all the embeded html). On investigating this problem there was a similar problem some 2/3 years ago and the so

[web2py] date internationalization in view (solved)

2011-07-14 Thread andrej burja
it works, thank you but it is hardcoded this is better TD(row.date.strftime(str(T('%Y-%m-%d'))) andrej

[web2py] Re: Off topic: are Google Groups wires crossed?

2011-07-14 Thread Massimo Di Pierro
Is there anybody on this list who works for google and can advice on which action to take? Massimo On Jul 13, 5:11 pm, Anthony wrote: > Yes, I pointed this out a couple months ago. It appears that entire web2py > threads are completely reposted within other groups > (e.g.,https://groups.google.

[web2py] Recurly with web2py

2011-07-14 Thread Carl
just a flag in the ground I've taken the python library from recurly.com (for their credit-card payment system) and it works just fine locally, on dev_appserver and on GAE. recurly.py (<300 lines) makes use of import base64, import types, import re, import urllib, import urllib2. nice to have so

[web2py] hack doc: web2py's handling of incoming URLs

2011-07-14 Thread Jonathan Lundell
I don't think that this is actually documented anywhere, so here's a crack at it. Not authoritative. This doesn't document the routes.py-based rewriting, just the "normal" handling of incoming URLs. main.wsgibase: web2py expects its incoming URL to be in environ['PATH_INFO'] and environ['QUER

Re: [web2py] Re: URL() args encoding

2011-07-14 Thread Anthony
On Thursday, July 14, 2011 10:32:49 AM UTC-4, Jonathan Lundell wrote: > > On Jul 14, 2011, at 5:17 AM, Anthony wrote: > > I cannot reproduce this problem. For me, 'laa%20poo' is converted to 'laa > poo' (i.e., the '%20' is properly converted to a space, not an underscore). > What version of web

Re: [web2py] Re: URL() args encoding

2011-07-14 Thread Jonathan Lundell
On Jul 14, 2011, at 5:17 AM, Anthony wrote: > I cannot reproduce this problem. For me, 'laa%20poo' is converted to 'laa > poo' (i.e., the '%20' is properly converted to a space, not an underscore). > What version of web2py are you using? Are you using the built-in Rocket > server? Are you (Anth

[web2py] Good jQuery UI Library

2011-07-14 Thread stargate
I loved using the following library http://flowplayer.org/tools/index.html because it was light-weight but I think the developer is MIA. What is a good jQuery library that will work with web2py and is light weight. I am not impressed with jquery UI I think its to bloated.

Re: [web2py] date internationalization in view

2011-07-14 Thread Bruno Rocha
TD(row.date.strftime('%y-%m-%d')) http://zerp.ly/rochacbruno Em 14/07/2011 09:23, "andrej burja" escreveu: > in model i have > T.force('sl-si') > > and > db.course.date.requires = IS_DATE(T('%Y-%m-%d')) > > in language fiel i have > %Y-%m-%d > %d %m %y > > in SQLFORM (od crud) and also the calend

[web2py] Re: multiselect with part of a table

2011-07-14 Thread Anthony
The default validator for a list:reference field is IS_IN_DB(db,'.id',multiple=True). Instead of db, you can pass a DAL Set to that validator to filter the returned list -- something like: db.audienceInstances.instances.requires=IS_IN_DB(db(db.instance.type==current_profile.type),'instance.id',

[web2py] Re: Database connection to Google Datastor in appengine

2011-07-14 Thread stargate
Thanks for the info I will try that. On Jul 14, 8:09 am, Anthony wrote: > On Thursday, July 14, 2011 7:48:40 AM UTC-4, stargate wrote: > > > I am having trouble finding the connection string example to connect > > to a Google Datastor database. > > Seehttp://code.google.com/p/web2py/source/browse

[web2py] Re: multiselect with part of a table

2011-07-14 Thread Nicolas Palumbo
any alternatives? On Wed, Jul 13, 2011 at 3:39 PM, Nicolas Palumbo wrote: > I have currently this multiselect generated by list:references: > > db.py: > > db.define_table('instance',Field('app',db.application),Field('server',db.server),Field('type','string'),format=lambda > r: '%s %s' %(db.applic

[web2py] Re: how to get user name before login is completed

2011-07-14 Thread Anthony
On Thursday, July 14, 2011 1:03:24 AM UTC-4, weheh wrote: > > How would one get auth.messages.logged_in to be something like > "Welcome Massimo"upon login? auth.user_id is None at the time the > auth.messages.logged_in is evaluated. There may be a better way, but maybe something like this:

[web2py] date internationalization in view

2011-07-14 Thread andrej burja
in model i have T.force('sl-si') and db.course.date.requires = IS_DATE(T('%Y-%m-%d')) in language fiel i have %Y-%m-%d %d %m %y in SQLFORM (od crud) and also the calendar widget it si ok but how can i display date in right format in view where i have for row in TD(row.date) andrej

[web2py] Re: URL() args encoding

2011-07-14 Thread Anthony
I cannot reproduce this problem. For me, 'laa%20poo' is converted to 'laa poo' (i.e., the '%20' is properly converted to a space, not an underscore). What version of web2py are you using? Are you using the built-in Rocket server? Anthony On Thursday, July 14, 2011 6:27:09 AM UTC-4, (m) wrote:

[web2py] Re: Database connection to Google Datastor in appengine

2011-07-14 Thread Anthony
On Thursday, July 14, 2011 7:48:40 AM UTC-4, stargate wrote: > > I am having trouble finding the connection string example to connect > to a Google Datastor database. See http://code.google.com/p/web2py/source/browse/applications/welcome/models/db.py#8. According to the book, you can just u

[web2py] Database connection to Google Datastor in appengine

2011-07-14 Thread stargate
I am having trouble finding the connection string example to connect to a Google Datastor database. Also what is the best method if you are working on your web2py application locally how would you connect to a Google Datastor database.

[web2py] Re: URL() args encoding

2011-07-14 Thread (m)
Awesome and thanx. I got that working and am able to generate URLs of the form I wanted. But I've now discovered that web2py seems to be doing some additional URL processing that I can't isolate. Assume a controller: def baz(): orb = request.args[0] return dict(orb=orb) With a view that

[web2py] Re: Off topic: are Google Groups wires crossed?

2011-07-14 Thread LightDot
Well, two possibilities come to mind: - a spam group's e-mail address is registered a member of web2py-users - a third party e-mail address is registered as a member of web2py-users and is then set up to redirect all e-mail to this spam group. Why is this done is beyond me... some way of harvest

Re: [web2py] Re: how to use contrib/login_methods/linkedin_account.py

2011-07-14 Thread Carl Roach
Using web2py's sample classes as a reference and a lot of code written by Ozgur Vatansever I have written code to OAuth into LinkedIn (built on gluon.contrib.login_methods.oauth10a_account) This enables access to a contact's name, job title, photo & company as well as details about their connectio