[web2py] SQLFORM error - object has no attribute 'tablename'

2014-03-26 Thread David Simmons
Hi I have the following method: def add_event(): form = SQLFORM.grid(db.timeline, fields = ['tl_start'] ) return dict(form=form) my view has {{= form }} but I get the following error when trying to view the page: type 'exceptions.AttributeError' 'str'

[web2py] Re: SQLFORM error - object has no attribute 'tablename'

2014-03-26 Thread David Simmons
thanks Anthony - that worked. Do you know why SQLFORM fields takes a string whilst SQLFORM.grid takes the actual db.table.field? cheers Dave -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] SQLFORM to json

2014-03-17 Thread David Simmons
Hi I have a SQLFORM which I embed in my web page using LOAD. If I successfully save the data in the database I want to pass the saved data back as part response.js. The idea is that a user enters data via the SQLFORM, it is s saved to the db and the data returned to the client where I add it

[web2py] Re: Verbatim Tag

2014-03-16 Thread David Simmons
Hi Massimo I've spent some time thinking about my own suggestion and I now believe that changing the delimiter in either Web2py or Angular is actually a better idea than mine. I'm happy to either withdraw my proposal or submit if you think it should be discussed further. cheers Dave --

[web2py] Re: Verbatim Tag

2014-03-14 Thread David Simmons
LightDot The implementation I put together was only done last night and I have done limited testing. I did it as I feel Web2py and Angular make a fantastic combination and want to explore the two working together more. I'm really keen to understand from Massimo and other Web2py guru's if my

[web2py] Re: Verbatim Tag

2014-03-14 Thread David Simmons
Hi Massimo I appreciate you can change either Web2py or Angular delimiters but the small code change I have suggested allows you to have the best of both worlds. If you change one of the delimiters it means you need to be careful with anything that might rely on it. Is there any reason why we

[web2py] Re: Verbatim Tag

2014-03-14 Thread David Simmons
Hi Leonel I think you are correct in that it might make it a little more difficult to parse. My problem with having to change either of the delimiters for Angular or Web2py is that I have to remember to change them for everything. For example if I change the web2py delimiters I then have

[web2py] Verbatim Tag

2014-03-13 Thread David Simmons
Hi All I'm starting to look at Web2py and Angularjs. As many people have noted they clash with the use of the delimiter {{ and }}. I know I can change them in both Angular and Web2py but how difficult would it be to have a verbatim tag (command) so that I could write. {{= Verbatim}} {{ some

[web2py] Re: Verbatim Tag

2014-03-13 Thread David Simmons
Hi Leonel. I know you can change the web2py delimters but that means views that uses extends has to be modified. If you simply switch of the interpretation of {{ for a block of html then you could mix and match angularjs and web2py. cheers Dave -- Resources: - http://web2py.com -

[web2py] Re: Verbatim Tag

2014-03-13 Thread David Simmons
Hi All (again). I did some digging around with the web2py source code and came up with this. https://gist.github.com/shortly-portly/9538005 The usage is pretty straight forward. You can use normal Web2py tags {{ and }}. When you want to drop down into Angular, surround your stuff with {{

[web2py] Re: Making the DAL orders-of-magnitude faster...

2014-03-12 Thread David Simmons
Hi All I've just come across this thread and wondered if the proposed change made it into a version of Web2py? cheers Dave -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

Re: [web2py] Re: Making the DAL orders-of-magnitude faster...

2014-03-12 Thread David Simmons
Thanks both. It is great to see the improvements in Web2py. cheers Dave -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message

[web2py] Pass reference name in json

2014-03-10 Thread David Simmons
Hi I have a database table with a reference field. I'm passing the contents back as JSON but the reference field gets passed as ref_id rather than the format name. Is there anyway to pass back the format name rather than just the id of the reference record. many thanks Dave -- Resources: -

[web2py] Question about Cache

2012-10-29 Thread David Simmons
Hi I understand the concept of cache but I don't understand the statement below. Would someone be willing to try and explain it to me in a different way (in the vain hope that I might actually understand it :-)) Note, time_expire is used to compare the current time with the time the

[web2py] Re: Question about Cache

2012-10-29 Thread David Simmons
Hi Niphlod thank you for your clear explanation. Do you know why cache.ram behave this way (as it is different to standard cache behaviour). many thanks Dave --

[web2py] Re: Question about Cache

2012-10-29 Thread David Simmons
Thanks Niphlod --

Re: [web2py] Re: Image Tutorial and linked_tables

2012-10-27 Thread David Simmons
Hi Jim did as you said and that worked fine. Now all I need to do is work out why my app is not showing the same behaviour. Having one that works will be a big help. many thanks for your help. Dave --

Re: [web2py] Re: Image Tutorial and linked_tables

2012-10-25 Thread David Simmons
Hi Jim/Leonel tried both of your suggestions but still no luck. thanks Dave --

[web2py] Re: Image Tutorial and linked_tables

2012-10-24 Thread David Simmons
On Wednesday, October 24, 2012 3:37:17 PM UTC+1, Jim S wrote: Are you logged in? On Tuesday, October 23, 2012 12:32:32 PM UTC-5, David Simmons wrote: Hi I am following the image tutorial described in the online web2py book. I have the following code: @auth.requires_membership

Re: [web2py] Re: Image Tutorial and linked_tables

2012-10-24 Thread David Simmons
Hi Jim my model is: db.define_table('image', Field('title', unique=True), Field('file', 'upload'), format = '%(title)s') db.define_table('comment', Field('image_id', 'reference image'), Field('author'), Field('email'), Field('body', 'text')) I'm really hoping I'm

[web2py] Image Tutorial and linked_tables

2012-10-23 Thread David Simmons
Hi I am following the image tutorial described in the online web2py book. I have the following code: @auth.requires_membership('manager') def manage(): grid = SQLFORM.smartgrid(db.image, linked_tables=['comment']) return locals() I have the following view: {{extend 'layout.html'}}

[web2py] Possible bug in SQLFORM for Web2py v2.0

2012-06-14 Thread David Simmons
Hi I downloaded the latest trunk version of Web2py 2.0 from Github. I have noticed that the keepvalues setting in SQLFORM defaults to True. This is different from the setting in FORM and equally different from SQLFORM in the 1.0 branch. Is this a deliberate change or a simple mistake?

[web2py] Re: Possible bug in SQLFORM for Web2py v2.0

2012-06-14 Thread David Simmons
Hi Me again :-) Is this the wrong place to ask this question, if so I apologies and ask that somebody please point me to the right place for this kind of thing. Many thanks Dave On Thursday, June 14, 2012 8:08:10 AM UTC+1, David Simmons wrote: Hi I downloaded the latest trunk version

[web2py] Re: Possible bug in SQLFORM for Web2py v2.0

2012-06-14 Thread David Simmons
On Thursday, 14 June 2012 12:11:05 UTC-5, David Simmons wrote: Hi Me again :-) Is this the wrong place to ask this question, if so I apologies and ask that somebody please point me to the right place for this kind of thing. Many thanks Dave On Thursday, June 14, 2012 8:08:10 AM UTC+1, David

[web2py] Web2py 2.0 and SQLFORM

2012-06-13 Thread David Simmons
Hi All I've downloaded Web2Py version 2.00.0 (2012-06-12) from Github today. I created a simple database table and form using SQLFORM. I then display the form using {{=form}}. I can enter data in the form, the form gets saved BUT the redisplayed form does not clear the data: Here is my