On Tue, Jul 14, 2009 at 6:27 PM, JohnMc <maruadventu...@gmail.com> wrote:
> > Alright, been staring at this problem off an on all day. I receive the > following traceback on a ticket. > > Traceback (most recent call last): > File "/home/rootuser/New/gluon/restricted.py", line 107, in > restricted > File "/home/rootuser/Helix/applications/Helix/controllers/ > assets.py", line 311, in <module> this inconsistency in paths is confusing me... what's this about? You have applications somewhere else than web2py? Do you have a link back to your web2py applications directory? > > File "/home/rootuser/New/gluon/globals.py", line 97, in <lambda> > File "/home/rootuser/Helix/applications/Helix/controllers/ > assets.py", line 291, in bond_auto > > callable = data['callable'],fstcpndt = data['fstcpndt'],company = > data['company'] ) > > File "/home/rootuser/New/gluon/sql.py", line 1445, in insert > File "/home/rootuser/New/gluon/sql.py", line 1421, in _insert > SyntaxError: invalid field name > > Here is the entire insert > Suggest you do this incrementally, exploring manually thru the shell is a good option, e.g. python web2py.py -S my_app -M and then try small things until you figure out what's up (ipython would be useful for this); Alternative is to step through with WingIDE and inspect the values of what you are trying to assign from / to to get to your "aha!", but either way will get you there. > > # update the database with a new entry for the asset > assets.bonds.insert > (symbl=lsymbl,basis=False,basisprce=0.0,basisqty=0.0,action='hold',qrydate > = stamp, > price = data['price'],coupon = data['coupon'],maturitydate = data > ['maturitydate'],ytm = data['ytm'], > curyld = data['curyld'],fitchrat = data['fitchrat'],curpayfreq = data > ['curpayfreq'],btype = data['btype'], > callable = data['callable'],fstcpndt = data['fstcpndt'],company = data > ['company'] ) So - I'm seeing this, and assuming you must have somewhere something like: assets = SQLDB( your_db_connection_string ) ... assets.define_table( 'bonds', Field('price'), Field('coupon'), Field('maturitydate'), # of course these fields have more in them; perhaps this is a datetime filed) Field('curyid'), ..... # etc.) How are we doing so far? > > > --------------------------------------------------------------------------------------------------------- > > What I am doing is pulling data off a webpage, and placing the > findings in a python dictionary which is returned back to bond_auto(). > bond_auto() does the actual insert above. I have checked that there > are the appropriate number of fields are being handled, the contents > are the right type, spelling of all the field names, even a truncate. > I still keep getting that 'invalid field name'. > > Any suggestions? > > JohnMc > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" 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 -~----------~----~----~----~------~----~------~--~---