:-) Sometimes there's nothing like just going through that yourself.
I know all the structures exposed aren't completely transparent, don't immediately seem to correlate to the written code, the expression. On Sat, Oct 3, 2009 at 1:14 PM, znafets <znaf...@googlemail.com> wrote: > > Okay, never mind, I just removed the big piece of wood from my > forehead. I see clearer now.. > > thanks a lot for your patience, sorry for being a doofus > > ciao > Stefan > > On Oct 3, 5:46 pm, znafets <znaf...@googlemail.com> wrote: > > Getting crazed about not being able to retrieve the values from the > > database. > > > > query= db.user.name==uname > > records=db(query).select() > > > > I get at least something that looks somehow that I am getting closer. > > Looking in WingIDE on what I get, records comes with a __dict__ which > > contains _db and colnames which is a tupel that contains the > > fieldnames (user.id, user.name, etc) > > > > How can I access the values ? > > Something like records.colnames.user.name doesn't work and throws > > "Rows object has no attribute user" > > > > best regards > > Stefan > > > > On 2 Okt., 21:11, Yarko Tymciurak <yark...@gmail.com> wrote: > > > > > wing will run with whatever python you have setup (you can run one > project > > > w/ 2.5, another w/ 2.6); > > > web2py will run fine w/ 2.6, as long as you are on at least 2.6.2 (I'm > have > > > run web2py with both 2.5 and 2.6.2 on Windows, and on Ubuntu and > Fedora). > > > > > On Fri, Oct 2, 2009 at 2:06 PM, znafets <znaf...@googlemail.com> > wrote: > > > > > > Actually I have WingIDE personal v.3.2 but it runs with python2.6 and > > > > definetely not with python2.5, tried it. While web2py needs python2.5 > > > > as I understand this is mandatory. I'll try it out with iPython. > > > > > > thanks again. > > > > > > Stefan > > > > > > On 2 Okt., 20:50, Yarko Tymciurak <yark...@gmail.com> wrote: > > > > > On Fri, Oct 2, 2009 at 1:35 PM, znafets <znaf...@googlemail.com> > wrote: > > > > > > > > Thanks for the hint, vars seems definetly the better choice. > > > > > > But the db part drives me to desperation: > > > > > > doing in controller: > > > > > > > > uname=request.vars.uname > > > > > > query=db(db.user.name==uname) > > > > > > > should be: > > > > > > > query = db.user.name==uname > > > > > > > you really need to download / install ipython first ( > > > >http://ipython.scipy.org), and get used to trying your expressions in > a > > > > > shell to see what they return: > > > > > > > python web2py.py -S myapp -M > > > > > > > >>> uname="Mytest" > > > > > >>> query= db.user.name==uname > > > > > > > etc. > > > > > > > The problems you are having are basic programing things (not even > so much > > > > > python), so you might want to get something like wingIDE (there is > a 30 > > > > day > > > > > trial that is given out in 10-day chunks, so prepare and use like > the > > > > > dickens for 10 days at a stretch, single step a LOT and observe > local > > > > > variables and their values as you go - then digest what you've > learned) > > > > -www.wingware.com > > > > > > > > records=db(query).select() > > > > > > > > the select statement already throws up an exception (key error > key > > > > > > (gluon)) or so > > > > > > > > seems I won't discover my secret love to database programming > > > > > > anymore :) > > > > > > > > ciao > > > > > > Stefan > > > > > > > > On 2 Okt., 19:48, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > > > > > Mind that URLs are validate on input and if uname contains > spaces > > > > > > > things will not work because spaces will be replace by _. I > suggest: > > > > > > > > > <td>{{=A(uname, _href=URL(r=request, f='edit_user',vars=dict > > > > > > > (uname=uname)))}}</td> > > > > > > > > > and in edit_user > > > > > > > > > rows=db(db.....==request.vars.uname).select() > > > > > > > > > On Oct 2, 12:42 pm, znafets <znaf...@googlemail.com> wrote: > > > > > > > > > > Nah, don't worry, I'll figure that out somehow. Can't ask > that much > > > > of > > > > > > > > you. > > > > > > > > > > Thank you very much for the offer though. I am a web2py > rookie > > > > (just > > > > > > > > started), never used django or alike. > > > > > > > > > > So thanks again > > > > > > > > > > ciao > > > > > > > > Stefan > > > > > > > > > > On 2 Okt., 19:22, Yarko Tymciurak <yark...@gmail.com> wrote: > > > > > > > > > > > If no one else can help you, I'll put together an example > for you > > > > > > tonight > > > > > > > > > (tied up this afternoon) > > > > > > > > > > > On Fri, Oct 2, 2009 at 12:07 PM, znafets < > znaf...@googlemail.com > > > > > > > > wrote: > > > > > > > > > > > > > not sure why you think it doesn't work; it should > work > > > > just > > > > > > fine: > > > > > > > > > > > > > x = request.args[0] > > > > > > > > > > > y = request.args[1] > > > > > > > > > > > > well, as soon as I try something like args=[uname, uloc] > in the > > > > > > view > > > > > > > > > > it comes up with "Invalid request". > > > > > > > > > > args=[uname] works just fine and can be retrieved via > > > > > > request.args[0] > > > > > > > > > > > > working on linux (ubuntu karmic), python 2.5, web2py > 1.67x > > > > > > > > > > > > > > row=db(db.user.uname==request.args[0]).select() > > > > > > > > > > > > can you give me a hand on this ? Trying to take the value > which > > > > > > comes > > > > > > > > > > back from the view (username) and can be retrieved form > > > > > > request.args > > > > > > > > > > [0] and get the according record with all the it's fields > to > > > > > > iterate > > > > > > > > > > through it. > > > > > > > > > > If it's not asked too much. > > > > > > > > > > > > best regards > > > > > > > > > > Stefan > > > --~--~---------~--~----~------------~-------~--~----~ 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.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---