[web2py:20157] SQLFORM - inserting value for a field that isn't shown?

2009-04-21 Thread web2py <&lt;>> technicalbloke.com
Hi All, I have table with a field that I don't want to show to the user however, I do want to set it to a value I receive in a (well vetted) get request. To this end I am calling SQLFORM with the list of fields I want rendered and deliberately missing that one out. I have tried storing the value

[web2py:19734] Re: '%LIKE%' syntax.

2009-04-14 Thread web2py <&lt;>> technicalbloke.com
Cool, thanks :-) On Apr 10, 6:13 pm, mdipierro wrote: > db(db.name.like('%alex%)).select() > > On Apr 10, 4:04 pm, "web2py <<>> technicalbloke.com" > > wrote: > > I can't seem to find a clear example of using 'like' in database &

[web2py:19565] '%LIKE%' syntax.

2009-04-10 Thread web2py <&lt;>> technicalbloke.com
I can't seem to find a clear example of using 'like' in database selects. I'd like to do something like... SELECT * FROM `customers` WHERE customer.name LIKE "%alex%" LIMIT 10; ...but without resorting to executing the query directly via db.executesql(). The manual says... "You can build a que

[web2py:19223] Re: Database borked??

2009-04-05 Thread web2py <&lt;>> technicalbloke.com
t; migration even if there was data in there that is not of type > 'datetime'. You need to clean up that column. > > In your model do this > > db(db.youtable.id>0).update(thedatetimefield=None) > > run appadmin once than remove the above line. > > Massimo >

[web2py:19206] Re: Database borked??

2009-04-05 Thread web2py <&lt;>> technicalbloke.com
uon/sql.py", line 2170, in xml return sqlhtml.SQLTABLE(self).xml() File "/rahrahrah/web2py/gluon/sqlhtml.py", line 605, in __init__ for (rc, record) in enumerate(sqlrows): File "/rahrahrah/web2py/gluon/sql.py", line 2127, in __iter__ yield self[i] File

[web2py:19203] Database borked??

2009-04-05 Thread web2py <&lt;>> technicalbloke.com
Hi, Somehow (don't ask me how!) I've managed to bork my database :-/ Appadmin let's me see all my tables except one, when I click on it's name it spews the message below. I don't care about the data inside, I'd just like to have my database rebuilt from the model so what's the best way to do that

[web2py:19202] Re: SQLFORM vs 3rd normal form...

2009-04-05 Thread web2py <&lt;>> technicalbloke.com
Hi Steve, Erm, I'm not sure, I'm manually updating each field after verification so I guess you can update whatever you like there, I'm pretty new to this though so apologies if I'm missing your point! One of the issues that arises when trying to do this, as Massimo correctly predicted above, is

[web2py:19112] Re: SQLFORM vs 3rd normal form...

2009-04-04 Thread web2py <&lt;>> technicalbloke.com
Race condition, whoops! Thanks for that Massimo, I knew that should be in there somewhere! :-) On Apr 4, 3:23 pm, "web2py <<>> technicalbloke.com" wrote: > OK, so I just cobbled this together and it seems to work though I'm > sure not in all cases... > >

[web2py:19110] Re: SQLFORM vs 3rd normal form...

2009-04-04 Thread web2py <&lt;>> technicalbloke.com
", DBINPUT(db.EMAIL_ADDRESSES.email_address), DBINPUT(db.EMAIL_ADDRESSES.the_default), "(set as default)" ), TR( "", INPUT(_type='submit',_value='SUBMIT') ) ) ) Is there an easier/better way I can do this? If not, comments and

[web2py:19102] Re: SQLFORM vs 3rd normal form...

2009-04-04 Thread web2py <&lt;>> technicalbloke.com
ering on BTW, I'm very excited by web2py - I've wanted to ditch PHP for Python for years and I'm hoping this is the framework that will allow me to do that! :) Roger. On Apr 4, 12:39 pm, "web2py <<>> technicalbloke.com" wrote: > Or is there a way to create s

[web2py:19097] Re: SQLFORM vs 3rd normal form...

2009-04-04 Thread web2py <&lt;>> technicalbloke.com
Or is there a way to create something akin to an old fashioned 'database view' in the model, get SQLFORM to render that and then in the controller validate the fields and insert/update the fields manually? Roger. On Apr 4, 12:23 pm, "web2py <<>> technicalbloke.com

[web2py:19095] Re: SQLFORM vs 3rd normal form...

2009-04-04 Thread web2py <&lt;>> technicalbloke.com
I see that it's non-trivial but maybe 1,3 and 4 could be negated by using the following syntax (2 I'm not so sure about)... COMPOUNDFORM( db.TABLE1,db.TABLE2, db.TABLE3, fields= [ db.TABLE1.name, db.TABLE2.email, db.TABLE3.phone ], relations [ db.TABLE1.id==db.TABLE2.contact_id, db.TABLE1.id==db