[web2py] Is the following code thread safe?

2016-04-17 Thread Emmanuel Dsouza
#get the path to the currunt file.Assuming python code and C code to be #executed are in same Folder base=os.path.dirname(os.path.dirname(__file__)) path=os.path.join(base,"python") #we have to get drive: base=base.split(':') base=base[0]; I am trying to write a code to c

[web2py] Re: sequential requests

2016-04-17 Thread kenny c
was nignx faster than running on Apache as default setting? -- 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 because you are sub

[web2py] Re: sequential requests

2016-04-17 Thread kenny c
interesting. How did you run the test on Apache and share us how you did tweak apache setting to boost the performance? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Repor

[web2py] Re: RESTful json:api

2016-04-17 Thread Anthony
It looks like you're returning a Rows object, which of course is just going to provide the fields of each record. If you need a custom schema, you will have to generate that yourself. You can loop through the Rows and convert each record to the structure required. You can then pass that to gene

[web2py] [REST] can't get auth.signature fields

2016-04-17 Thread Mamisoa Andriantafika
Hi, Using the REST service, a GET doesn't show the fields from auth_signature. Is there a way to make them visible from the REST api? Mike -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2

[web2py] RESTful json:api

2016-04-17 Thread Raphael Lechner
Hi, I'm trying to build an application with ember.js as frontend and web2py as backend. Ember requires a valid json:api (http://jsonapi.org/) interface. I tried to use the generic json view but the output is different. Example output from generic json view: {"data": [{ "name": "100", "fi

[web2py] Re: what does this syntax mean?

2016-04-17 Thread villas
The args and vars contain information which can be processed in your controller function. Typically args contain essential info required for the function, and vars contain arbitrary variables which are passed in addition. In this URL: /emailer/default/caller/1?var1=kk&var2=joe the number 1 w

Re: [web2py] Re: How to find the entry in a table with the highest ID

2016-04-17 Thread villas
It is for unpacking argument lists. See this link for more info: https://docs.python.org/2/tutorial/controlflow.html#unpacking-argument-lists On Sunday, 17 April 2016 15:17:25 UTC+1, Kenneth wrote: > > Hi Richard, > > Quick question on your reply, how do you use ** as prefix of form.vars? > I'v

[web2py] Re: what does this syntax mean?

2016-04-17 Thread Emmanuel Dsouza
yeah i put the bracket wrongly. so whats the difference between the args and the vars and when do we use each of them? On Sunday, April 17, 2016 at 9:32:20 PM UTC+5:30, villas wrote: > > I do not see how this line is valid... > > URL('default','caller',args=row.id), [kk, joe]) > > The brackets do

[web2py] Re: what does this syntax mean?

2016-04-17 Thread villas
I do not see how this line is valid... URL('default','caller',args=row.id), [kk, joe]) The brackets do not match? Vars are normally expressed as a dict. Something like this in your template might make more sense. {{ myvars = {'var1':'kk', 'var2':'joe'} }} {{=A('Call Us', _href= URL('default

[web2py] what does this syntax mean?

2016-04-17 Thread Emmanuel Dsouza
< a href="{{=URL('default','caller',args=row.id), [kk, joe])}}">Call us what is difference between performance of row.id and kk, joe. what is the exact difference between request.args and request.vars as here? when do we use each of that? they look interchangeable to me. -- Resources: - http:/

[web2py] Re: Empty strings stored as null in database

2016-04-17 Thread kenny c
thank you Leonel and Niphlod! -- 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 because you are subscribed to the Google Groups "

[web2py] Re: How should I handle this?

2016-04-17 Thread kenny c
great tip! i have a question on passing form variables through ajax, can i pass form.vars if i want to pass all variables including 'q' inbox? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/

Re: [web2py] Re: How to find the entry in a table with the highest ID

2016-04-17 Thread Kenneth
Hi Richard, Quick question on your reply, how do you use ** as prefix of form.vars? I've seen it in the book but never knew what it was for. Ken On Saturday, April 16, 2016 at 12:09:39 PM UTC-4, Richard wrote: > > Hello Jack, > > You mean you want to pass the id of the inserted record to anothe

[web2py] Re: What is the difference between request.args and request.vars in web2py?

2016-04-17 Thread Leonel Câmara
request.args are all the URL path components after your function's name. request.vars are all the parameters in the request example http://127.0.0.1:8000/welcome/default/index/1?message=hey args will have = ["1"] vars will have {'message': 'hey'} It's in the book http://www.web2py.com/books/defa

[web2py] What is the difference between request.args and request.vars in web2py?

2016-04-17 Thread Steve Joe
example? -- 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 because you are subscribed to the Google Groups "web2py-users" group.

[web2py] Re: How should I handle this?

2016-04-17 Thread Steve Joe
if auth.user_id <1: redirect(URL('default','index'), client_side=True) Why this isn't working? On Sunday, April 17, 2016 at 3:37:31 PM UTC+5:30, Leonel Câmara wrote: > > add client_side=True to the redirect calls > > redirect("http://google.com";, client_side=True) > -- Resources: - http

[web2py] Re: alternate for limit by and order by

2016-04-17 Thread Leonel Câmara
Can you explain what you're trying to do and why you need to concatenate Rows instead of say using a query that gets all the results you want in one go. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.goog

[web2py] Re: alternate for limit by and order by

2016-04-17 Thread rahul2499
we can do sort through this ,thanks for that .but we can't limit the no of projects to be displayed for the pagination On Sunday, 17 April 2016 15:38:53 UTC+5:30, Leonel Câmara wrote: > > You can use the Rows sort method. > > > http://www.web2py.com/books/default/chapter/29/06/the-database-abstr

[web2py] Re: alternate for limit by and order by

2016-04-17 Thread Leonel Câmara
You can use the Rows sort method. http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#find--exclude--sort -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/iss

[web2py] alternate for limit by and order by

2016-04-17 Thread rahul2499
I have concatenated two Rows objects in controller by Row1 | Row2.Now i am not able to order them in required sorted way and i am able to achieve pagination also.can anyone suggest something regarding this -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://githu

[web2py] Re: How should I handle this?

2016-04-17 Thread Leonel Câmara
add client_side=True to the redirect calls redirect("http://google.com";, client_side=True) -- 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

[web2py] Re: Can we write a func such that a variable will have value 1 for a mint and again value 0?

2016-04-17 Thread Leonel Câmara
I don't understand the question. Can you be more clear? What are you trying to do? -- 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 mess

[web2py] Can we write a func such that a variable will have value 1 for a mint and again value 0?

2016-04-17 Thread Steve Joe
what's the syntax? -- 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 because you are subscribed to the Google Groups "web2py-user

[web2py] Re: Scheduler not finding module

2016-04-17 Thread peter
I am in the wilds of France with very little access to Internet. Will continue in one week. Great support as ever Niphlod. Thanks Peter -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/i

[web2py] How should I handle this?

2016-04-17 Thread Steve Joe
def data(): if auth.user_id==0: redirect("http://google.com";) rows=0 if request.vars.q: db.chats.insert(shouter=auth.user and auth.user.first_name, msg=request.vars.q) size=len(db(db.chats.id>0).select()) lower=size-8 if size-8<=0: l