Re: [web2py] Re: How to use requires with list:reference

2014-06-12 Thread Anthony
> Are you saying you want the user to enter a last name for the child and >> then have the drop-down dynamically updated with the list of parents with >> the entered last name? If so, obviously that cannot be done at the time the >> form is generated on the server because you don't know what n

[web2py] Re: Web2py grid shows key from IS_IN_SET({key: value}) model

2014-06-12 Thread Anthony
On Wednesday, June 11, 2014 3:48:15 PM UTC-4, 黄祥 wrote: > > Hi, Anthony, is it possible to combine the represent for change the color > depend on the value with the represent for is_in_set translate above? > e.g. > Sure, instead of SPAN(status, ...) do SPAN(mydict[status], ...). Anthony -- Res

[web2py] {{=XML(data)}} for javascript variable issue

2014-06-12 Thread LoveWeb2py
Hello, I'm trying to pass a variable which has json data into infovis for a visualization It's interesting because when I type {{=XML(data)}} in the view I can see the correct json data is being passed, but when I edit the .js file and try to include the variable there nothing happens (it says

[web2py] Re: {{=XML(data)}} for javascript variable issue

2014-06-12 Thread LoveWeb2py
Just an update this is where I'm trying to place the variable: var json = '{{=XML(data_returned_from_controller)}}'; On Thursday, June 12, 2014 10:11:58 AM UTC-4, LoveWeb2py wrote: > > Hello, > > I'm trying to pass a variable which has json data into infovis for a > visualization > > It's interes

[web2py] Re: {{=XML(data)}} for javascript variable issue

2014-06-12 Thread Leonel Câmara
.js files are static files so they don't go trough the view templating process. See the welcome application web2py_ajax.html file for an example of how to setup variables for javascript. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

[web2py] modal form - is this a good approach?

2014-06-12 Thread Vincent
Hi, wanted to ask the community if the approach I am taking is sound. If so this may be of use to others. If not, please tell me the way to do this correctly. My objective is to have form submission in a modal way (using bootstrap modal). Here is the approach I am taking, reduced to the simples

[web2py] Re: {{=XML(data)}} for javascript variable issue

2014-06-12 Thread LoveWeb2py
so would it be better if I just paste the code into the view? Would it make it easier? On Thursday, June 12, 2014 12:53:10 PM UTC-4, Leonel Câmara wrote: > > .js files are static files so they don't go trough the view templating > process. See the welcome application web2py_ajax.html file for an

[web2py] Re: scheduler worker assignment and disable behavior

2014-06-12 Thread DeanK
Thanks for the detailed response! Lot's to cover so here we go..haha mysql is the uttermost/personal top 1 dislike/non-standard behaving backend > out there, but we'll manage ^_^ Interesting. What do you like more? and if by "node" you mean a completely different server, you have 7*5 =

[web2py] Re: Developer wanted!

2014-06-12 Thread samuel bonill
$8k ?? El martes, 10 de junio de 2014 16:06:50 UTC-5, Yanni Shainsky escribió: > > I am looking for a paid developer for project that goes from > concept-to-completion. > > 1. Database driven > > 2. Functionality similar to yelp, craiglist, angieslist > > 3. We will have at least 5 different use

[web2py] Re: Web2py grid shows key from IS_IN_SET({key: value}) model

2014-06-12 Thread 黄祥
it works, thank you so much, anthony e.g. product_status = {'On Sale': T('On Sale'), 'Hold': T('Hold'), 'Sold': T('Sold')} table.status.represent = lambda status, field: SPAN(product_status[status], _class = 'text-success' if status == 'Sold' else 'text-warning' if status == 'Hold' else 'text-e

[web2py] Re: {{=XML(data)}} for javascript variable issue

2014-06-12 Thread Andrew W
Yes. Add a

[web2py] lambda cannot contain assignment

2014-06-12 Thread Fabiano Almeida
Hi, In a table I need to change the field value (name: cadastro, type: datetime) to request.now depending on the value assigned to another field (name: status) of the same record. I thought of using the _before_update callbcak for this purpose: db.solicitacao._before_update.append(lambda f: f.ca

[web2py] Re: lambda cannot contain assignment

2014-06-12 Thread Anthony
First, note that you are not limited to using a lambda -- you can use any function/callable. So, if you need to do an assignment, write a separate function. In this case, though, you can instead use the .update method: db.solicitacao._before_update.append(lambda qset, f: f.update(cadastro=r

[web2py] Re: scheduler worker assignment and disable behavior

2014-06-12 Thread Niphlod
On Thursday, June 12, 2014 7:37:26 PM UTC+2, DeanK wrote: > > Thanks for the detailed response! Lot's to cover so here we go..haha > > > mysql is the uttermost/personal top 1 dislike/non-standard behaving >> backend out there, but we'll manage ^_^ > > > Interesting. What do you like more? >

[web2py] Re: {{=XML(data)}} for javascript variable issue

2014-06-12 Thread LoveWeb2py
So I currently have it like this: function init(){ var json = '{{=XML(json_data_from_controller)}}'; but I'm still getting undefined On Thursday, June 12, 2014 2:42:31 PM UTC-4, Andrew W wrote: > > Yes. Add a

[web2py] Re: {{=XML(data)}} for javascript variable issue

2014-06-12 Thread LoveWeb2py
if I type {{=XML(json_data_from_controller)}} outside of the var I can see the json data. Also, if I copy and paste the json data right into the variable that also works. On Thursday, June 12, 2014 5:26:21 PM UTC-4, LoveWeb2py wrote: > > So I currently have it like this: > > function init(){ >

[web2py] Re: {{=XML(data)}} for javascript variable issue

2014-06-12 Thread LoveWeb2py
Sigh it was the apostrophes around the XML statement. Sorry about that guys I didn't realize I didn't need the ' enclosures... On Thursday, June 12, 2014 10:11:58 AM UTC-4, LoveWeb2py wrote: > > Hello, > > I'm trying to pass a variable which has json data into infovis for a > visualization

[web2py] SQLFORM.grid search - boolean precedence? - nested queries?

2014-06-12 Thread Vincent
How would one go about doing the equivalent of A and (B or C) in the grid or smartgrid search? Tried reading the source but got lost. Given db.person.firstname db.person.lastname this fails as an invalid query: person.firstname = "John" and (person.lastname = "Smith" or person.lastname = "Wil

[web2py] Re: SQLFORM.grid search - boolean precedence? - nested queries?

2014-06-12 Thread Derek
You have your queries all wrong. Can you share your code? You should use the python bitwise operators not the words. Also, why are you using assignment when you should be testing for equality? On Thursday, June 12, 2014 2:35:25 PM UTC-7, Vincent wrote: > > How would one go about doing the equiva

[web2py] Re: Is there a web2py plugin which lays out divs in a neat grid?

2014-06-12 Thread Spokes
Thanks, Derek. I'd like to not animate at all, and I've adjusted freewall's settings accordingly, to no avail. The animation effect only happens under particular circumstances (i.e. when the page is updated with an ajax call, rather than refreshed or loaded through a link), which makes me suspec

Re: [web2py] Re: SQLFORM.grid search - boolean precedence? - nested queries?

2014-06-12 Thread Vincent Chevrier
I guess I wasn't clear enough, my example queries are not python code, they are text that would be entered in the search box in the default search widget generated by SQLFORM.grid. I know how to do it in python code, but I am looking for an answer regarding if this is possible from the search box