[web2py] Could you write the code for RESTFUL api used in the web2py app controller and in the phonegap view?

2016-03-27 Thread Rgb Aston
Please don't send me the link of the documentation. I seriously tried it 
but it's not working. Please write the codes finally as I have given up 
struggling with it.

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How did you implement chat system in your app? How's my idea?

2016-03-27 Thread pbreit
Chat can be hard. You might check out sockets:
https://github.com/web2py/web2py/blob/master/gluon/contrib/websocket_messaging.py

And:
https://groups.google.com/forum/#!topic/web2py/RFVnoCLyyjs
https://groups.google.com/forum/#!topic/web2py/ABaQw0TYUsc

Web2py is my "go to" framework but if you are at all comfortable in other 
frameworks, you might try googling because there are lots of examples out 
there.

For example, Angular-Meteor:
http://www.angular-meteor.com/tutorials/whatsapp/

Django:
https://blog.heroku.com/archives/2016/3/17/in_deep_with_django_channels_the_future_of_real_time_apps_in_django

Rails:
https://medium.com/@dhh/rails-5-action-cable-demo-8bba4ccfc55e



On Sunday, March 27, 2016 at 8:37:02 PM UTC-7, Rgb Aston wrote:
>
> So I have created a db table with name 'messages' and fields= message, 
> sender, receiver,date_time where sender is auth.user_id by default and 
> unchangeable. date_time represents when the message was sent out.
> So when one user opens his message view he can see all his messages 
> (designed such a way that each sender's message is displayed separately and 
> sorted according to datetime.) But the problem is the page is still and to 
> get the updated thread of messages he will have to reload the page. How to 
> do it in such a way that he doesn't have to reload it always and the chat 
> system works like facebook and other sites.

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] mouse scrolling problem on web2py pages with (ubuntu 14.04) firefox 44.0.2

2016-03-27 Thread Hrobjartur Thorsteinsson
Thank u for confirming the issue. I should be able to identify the culprit u 
using browser debugger. Will post back if I find the css or js line.

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] [Newbie] Generally accepted method for a Select statement

2016-03-27 Thread Anthony
Your choice. If you want all records and all fields, the first is probably more 
common, but either way is fine.

Anthony

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] How did you implement chat system in your app? How's my idea?

2016-03-27 Thread Rgb Aston
So I have created a db table with name 'messages' and fields= message, sender, 
receiver,date_time where sender is auth.user_id by default and unchangeable. 
date_time represents when the message was sent out.
So when one user opens his message view he can see all his messages (designed 
such a way that each sender's message is displayed separately and sorted 
according to datetime.) But the problem is the page is still and to get the 
updated thread of messages he will have to reload the page. How to do it in 
such a way that he doesn't have to reload it always and the chat system works 
like facebook and other sites.

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] mouse scrolling problem on web2py pages with (ubuntu 14.04) firefox 44.0.2

2016-03-27 Thread Anthony
I think it's a problem with the new stupid.css - same problem in Firefox on 
Windows.

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: row.as_json confussion

2016-03-27 Thread Anthony
On Sunday, March 27, 2016 at 10:31:37 PM UTC-4, Alfonso Serra wrote:
>
> Sorted out with:
> rows = db(db.mytable).select(*[db.mytable[f] for f in 
> db.mytable.fields[0:5])
>

Yes, .select() takes field objects, not just field names. Iterating over 
the table object itself yields its field objects, so slightly more simply, 
you could do:

[f for f in db.mytable][0:5]

Anthony

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: row.as_json confussion

2016-03-27 Thread Alfonso Serra
Sorted out with:
rows = db(db.mytable).select(*[db.mytable[f] for f in 
db.mytable.fields[0:5])

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: DHTMLX javascript library

2016-03-27 Thread Henk huisman
Hi me again,

It appears that the Timeline functionality that I was looking for is only 
included in the DHTMLX Pro Commercial Version which costs 490$. 

I have been looking into a lot of products  for functionality to present 
resources with a scheduler/ timeline.
So far I have only found commercial products that offer this kind of 
interface.

Anybody suggestions where to look?

Henk

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: I get an error whenever I try to send an email from within web2py that doesn't seem related to the

2016-03-27 Thread Valdeck Rowe
Thanks, that helped. The message variable was causing the issue. I used 
attachment when I was trying to track down the payload variable.

On Saturday, March 26, 2016 at 4:10:14 PM UTC-5, Anthony wrote:
>
> What is the value of "message", and why are you passing an empty list as 
> the "attachment" argument (maybe try removing that)?
>
> Anthony
>
> On Saturday, March 26, 2016 at 4:08:05 PM UTC-4, Valdeck Rowe wrote:
>>
>> The thing is that the error doesn't seem to have anything to do with the 
>> the code I wrote. 
>>
>> Here is the traceback:
>> Version
>> web2py™ Version 2.13.4-stable+timestamp.2015.12.26.04.59.39Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>>
>> Traceback (most recent call last):
>>   File "/home/vgr2/web2py/gluon/restricted.py", line 227, in restricted
>> exec ccode in environment
>>   File "/home/vgr2/web2py/applications/quiz_app/controllers/default.py" 
>> , 
>> line 642, in 
>>   File "/home/vgr2/web2py/gluon/globals.py", line 412, in 
>> self._caller = lambda f: f()
>>   File "/home/vgr2/web2py/applications/quiz_app/controllers/default.py" 
>> , 
>> line 522, in thankyou
>> if mail.send([candidate.email], subject, message, []):
>>   File "/home/vgr2/web2py/gluon/tools.py", line 745, in send
>> payload = payload_in
>> UnboundLocalError: local variable 'payload_in' referenced before assignment
>>
>> This is very confusing to me, been at this for  a while now.
>>
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: DHTMLX javascript library

2016-03-27 Thread Henk huisman
The view looks now as follows:



{{extend 'layout.html'}}
Example of scheduler













   





scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.init('scheduler_here', new Date(),"month");
scheduler.load("{{=URL('rentals_load')}}","json"); 
myDataProcessor = new dataProcessor('{{=URL("rentals_process")}}/');
myDataProcessor.init(scheduler);
myDataProcessor.setTransactionMode("POST");
myDataProcessor.attachEvent("onAfterUpdate", function(id, action, tid, 
response){
 alert('id='+ id + ' action= ' + action + ' tid=' + tid + ' response=' 
+  JSON.stringify(response));
})


The controllers are as follows:

def rentals_load():
rows={}
query=db.rentals.id>0
rows=db(query).select(db.rentals.id, db.rentals.startdate.with_alias(
'start_date'),db.rentals.enddate.with_alias('end_date'), db.rentals.
reservationcode.with_alias('text'))
return response.json(rows)


def rentals_process():
return response.json(request.vars)





If I change somethin in the scheduler I get an alert message what has been 
changed plus all the values and parameters. See image




Thank you Leonel for putting me on this track again. Going further to write 
te controller functions...

Some notes: the {{extend 'layout.html'}} has to come after the links to the 
scheduler javascript. Don't know why. This way it works.

Be aware of the slash after the URL in myDataProcessor = new 
dataProcessor('{{=URL("rentals_process")}}/'); without you get an error 
message.

Henk

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: sidebar

2016-03-27 Thread 黄祥
pls try in your view :
{{right_sidebar_enabled = True}}

{{block right_sidebar}}
{{include 'default/right_sidebar.html'}}
{{end}}

{{extend 'layout.html'}}

best regards,
stifan

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] sidebar

2016-03-27 Thread Jerry Liu
Hello,

Is there a way I can customize my sidebar at one place and use it on all 
views?

Now I have my sidebar customized and displayed on index.html, but how can I 
let all other my views include the same sidebar?

Any help?

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: In the dropdown here how to remove Profile?

2016-03-27 Thread 黄祥
in models :
auth.settings.actions_disabled = ['profile']

custom_auth_table = db[auth.settings.table_user_name]

custom_auth_table.first_name.readable = False
custom_auth_table.last_name.readable = False

custom_auth_table.first_name.writable = False
custom_auth_table.last_name. writable = False

best regards,
stifan

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Possible Bug: Custom form rendering of auth.profile not working.

2016-03-27 Thread Stuart Rolinson
Thank you Anthony.  Once the process() is removed it works correctly.

On Sunday, March 27, 2016 at 9:43:22 AM UTC-7, Stuart Rolinson wrote:
>
> I think I may have found a bug when rendering custom auth forms using 
> SQLFORM.
> When the auth profile form is rendered using form.custom.begin - 
> form.custom.end  the hidden fields are rendered incorrectly causing the 
> form not submit correctly.
>
> The following code works correctly:
>
> *Model*
>
> db.define_table('address',
> Field('user_ref', 'reference auth_user'),
> Field('address_line', type='string', length=128))
>
> *Controller*
>
> def test():
> form1 = auth.profile()
> row=db(db.address.user_ref==auth.user_id).select().first()
> form2 = SQLFORM(db.address, record=row)
>
> if form1.process().accepted:
> response.flash='form 1 saved'
> if form2.process().accepted:
> response.flash='form 2 saved'
>
> return dict(form1=form1, form2=form2)
>
> *View*
> {{extend 'layout.html'}}
> My Test Form
>
> {{=form1}}
> 
> {{=form2}}
>
>
>
> Now modify the view to a custom form and form1 will no longer submit:
>
> *View*
> {{extend 'layout.html'}}
> My Test Form
>
> 
> {{=form1.custom.begin}}
> 
> 
> First Name
> 
> 
> {{=form1.custom.widget.first_name}}
> 
> 
>
> 
> 
> Last Name
> 
> 
> {{=form1.custom.widget.last_name}}
> 
> 
>
> 
> 
> E-mail Address
> 
> 
> {{=form1.custom.widget.email}}
> 
> 
>
> 
> 
> {{=form1.custom.submit}}
> 
> 
> {{=form1.custom.end}}
> 
>
>
> 
>
> 
> {{=form2.custom.begin}}
> 
> 
> User_ref
> 
> 
> {{=form2.custom.widget.user_ref}}
> 
> 
>
> 
> 
> Address
> 
> 
> {{=form2.custom.widget.address_line}}
> 
> 
>
> 
> 
> {{=form2.custom.submit}}
> 
> 
> {{=form2.custom.end}}
> 
>
>
> If you look at the source of this form, there are two hidden sections at 
> the end of the auth form with different _formkey values instead of one. 
>  This form will not submit and process, but form form 2 works perfectly.  
>
>  name="_formkey" type="hidden" value="7d82bb1c-bbab-4dcc-a2a6-8bcec41b4090" 
> />
>
>  name="_formkey" type="hidden" value="aa31556e-d366-4b3a-aa81-434c1eabdbc5" 
> />
>
> You can modify the custom auth form to use {{=form1.hidden_fields()}} and 
> manually close the form with  and this will provide a work around. 
>  Just wanted to make you aware of this if you weren't already. 
> 
>
> Kind regards,
> Stuart
>
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] row.as_json confussion

2016-03-27 Thread Alfonso Serra
On an interactive console running:

rows = db(mytable).select()
rows[0].as_json()

I get the expected result, an unicode string containing the row 
representation with the right values.

On a controller or view i get a complete different thing:

The result is a dictionary with a single ['_extra'] key holding another 
dictionary as value with the row representation and incorrect values.

Values are wrong since a field declared as "list" are properly formatted as 
a list in the interactive console case, but on the controller case, i get 
the db value instead of its representation.

The questions are:
Whats the "_extra" key for?
How can i get the same result as the interactive console on a controller or 
view?

Thanks

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Possible Bug: Custom form rendering of auth.profile not working.

2016-03-27 Thread Anthony
You cannot call .process() on an Auth form, as the Auth method already does 
that.

Anthony

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Possible Bug: Custom form rendering of auth.profile not working.

2016-03-27 Thread Stuart Rolinson
I think I may have found a bug when rendering custom auth forms using 
SQLFORM.
When the auth profile form is rendered using form.custom.begin - 
form.custom.end  the hidden fields are rendered incorrectly causing the 
form not submit correctly.

The following code works correctly:

*Model*

db.define_table('address',
Field('user_ref', 'reference auth_user'),
Field('address_line', type='string', length=128))

*Controller*

def test():
form1 = auth.profile()
row=db(db.address.user_ref==auth.user_id).select().first()
form2 = SQLFORM(db.address, record=row)

if form1.process().accepted:
response.flash='form 1 saved'
if form2.process().accepted:
response.flash='form 2 saved'

return dict(form1=form1, form2=form2)

*View*
{{extend 'layout.html'}}
My Test Form

{{=form1}}

{{=form2}}



Now modify the view to a custom form and form1 will no longer submit:

*View*
{{extend 'layout.html'}}
My Test Form


{{=form1.custom.begin}}


First Name


{{=form1.custom.widget.first_name}}





Last Name


{{=form1.custom.widget.last_name}}





E-mail Address


{{=form1.custom.widget.email}}





{{=form1.custom.submit}}


{{=form1.custom.end}}






{{=form2.custom.begin}}


User_ref


{{=form2.custom.widget.user_ref}}





Address


{{=form2.custom.widget.address_line}}





{{=form2.custom.submit}}


{{=form2.custom.end}}



If you look at the source of this form, there are two hidden sections at 
the end of the auth form with different _formkey values instead of one. 
 This form will not submit and process, but form form 2 works perfectly.  





You can modify the custom auth form to use {{=form1.hidden_fields()}} and 
manually close the form with  and this will provide a work around. 
 Just wanted to make you aware of this if you weren't already. 


Kind regards,
Stuart

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: In the dropdown here how to remove Profile?

2016-03-27 Thread Jacob Devin
also I want to remove the fields first_name and last_name. How do I do that?

On Sunday, March 27, 2016 at 9:57:27 PM UTC+5:30, Jacob Devin wrote:
>
>
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] In the dropdown here how to remove Profile?

2016-03-27 Thread Jacob Devin


-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Upload file using the LOAD (....., ajax = True)

2016-03-27 Thread Mike Constabel
Hello Massimo,

Am Sonntag, 27. März 2016 17:18:42 UTC+2 schrieb Massimo Di Pierro:
>
> Hello Mike,
>
> could you explain your patch to web2py-developers? it is quite extensive.
>
>  
 I think you misunderstood me (or I didn't explain it well).

This "patch" is only a summary of what I found in this thread to do uploads 
with ajax.

https://groups.google.com/d/msg/web2py/b83MdNrAijo/fBxeQJLDkfYJ
https://groups.google.com/d/msg/web2py/b83MdNrAijo/0p6jzDeuBAAJ
+ http://malsup.com/jquery/form/

It's only a test if this solution from Anthony/Bart etc. works in newest 
version. It doesn't work completely.

I only wanted to ask if there is a new / updated solution.

Or did I misunderstood you?

Regards,
Mike

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Djano channels

2016-03-27 Thread Massimo Di Pierro
The fact is webrtc is pure JS. It is from client to client. Wether you use 
Flask or Django or web2py or PHP or ASP to serve pages is irrelevant.

Massimo

On Sunday, 27 March 2016 10:05:06 UTC-5, Ron Chatterjee wrote:
>
> https://m.youtube.com/watch?v=uBV_KKGzNqQ
>
> Found that link that talks about it. But it uses flask. So for chatting 
> use channels n realtime streaming n audio use webrtc. Learn something new 
> everyday!  Thank you massimo. 
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py Job and Recruitment site

2016-03-27 Thread Massimo Di Pierro
Congratulations! well done.

On Saturday, 26 March 2016 07:56:11 UTC-5, Francisco Tomé Costa wrote:
>
> Hi, 
> At https://www.emprego.pt we've developed a job posting site, where 
> candidates can create their professional profile (like LinkedIn) 
> https://www.emprego.pt/apresentacao and companies have a complete 
> backoffice solution for managing recuitment 
> https://www.emprego.pt/recrutamento 
>
> The website has only been launched in Portugal and has already more than 
> 65000 members and 3400 companies. We also have a newsletter and 
> notification system that sends more than 200k emails per week. 
>
> We are now looking for partners interested in scaling the business into 
> others locations

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: beginners to Web2PY web framework? check this out - your first Web2PY db in 34 minutes 15 seconds

2016-03-27 Thread Massimo Di Pierro
Fantastic!

On Saturday, 26 March 2016 15:05:20 UTC-5, Literate Aspects wrote:
>
>
> https://www.udemy.com/web-engineering-with-python-and-web2py/learn/v4/t/lecture/3067796
>
> This is the actual course at Lecture # 9.  Start from the beginning and 
> enjoy.  This manner of instruction is very intuitive and is of the nature 
> of what I believe Web2PY embraces - simplicity and power.
>
> Hello, I found another awesome tutorial for beginners to
> supplement Massimo's 5 series videos as a preliminary first step
> the video for beginners.
>
> As a person moving from an old Delphi history to web frameworks and
> having discovered the incredible contribution of Massimo -
> realizing that the BARE BONES initial understanding seems
> difficult, but... along comes MIKA...
>
> Check it out!
>
> https://www.udemy.com/web-engineering-with-python-and-
> web2py/learn/v4/content
>
> Created by Mika Sjöman, For now, the course is free on Udemy since
> it is under development.  This course is about building web apps by
> learning web engineering and Python programming at the same time.
> We will be using a framework called Web2py which was created to
> make learning programming easy and enjoyable. But Web2py has also
> become a popular framework because it has turned out to be fast,
> scalable and that it allows for extreme developer productivity.
>
>
>
>
>
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Upload file using the LOAD (....., ajax = True)

2016-03-27 Thread Massimo Di Pierro
Hello Mike,

could you explain your patch to web2py-developers? it is quite extensive.

On Saturday, 26 March 2016 13:00:25 UTC-5, Mike Constabel wrote:
>
> Hello all and Anthony,
>
> Am Freitag, 20. November 2015 07:52:05 UTC+1 schrieb Bart:
>>
>> Hi Anthony,
>>
>> This solution you mention is, with some minor changes, still working in 
>> the current version. I've managed to get the change working in the 2.12.3 
>> version of web2py.js:
>> Change function trap_form to:
>>
>>
> I tried this with 2.14.2. The upload works, but the form is reloaded when 
> there is an error in the form. 
>
> Attached an my example, diff against the welcome app from 2.14.2.
>
> If I use the form default/test1 in my example without changes to web2py.js:
>
> On validation errors the error message is shown without reload the form. 
> The upload of course doesn't work.
>
> If I patch web2py.js, the upload work. But the form no more works as 
> expected on validation errors.
>
> Is there is a new solution for ajax uploads? Did I made an mistake? The 
> solutions I found are >5 years old.
>
> This one is the one which seems the most usable.
>
> Regards,
> Mike
>
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: model define_table select

2016-03-27 Thread Massimo Di Pierro
Correction. replace

IS_IN_DB(db_region(*db_region.post.state_id==db_region.county.state_id*)

with

IS_IN_DB(db_region(*db_region.county.state_id == **request.vars.state_id*)

On Sunday, 27 March 2016 10:16:13 UTC-5, Massimo Di Pierro wrote:
>
> replace
>
> IS_IN_DB(db_region(*db_region.post.state_id==db_region.county.state_id*)
>
> with
>
> IS_IN_DB(db_region(*db_region.post.state_id==request.vars.state_id*)
>
> On Saturday, 26 March 2016 12:24:52 UTC-5, lucas wrote:
>>
>> hello one and all,
>>
>> ok, under the DAL model, say i have a county and zip code table, like, as 
>> defined as:
>>
>> db_region.define_table('county',
>> Field('country_id', db_region.country, requires=IS_IN_DB(db_region, 
>> db_region.country.id, '%(country)s'), writable=False, readable=False),
>> Field('state_id', db_region.state, requires=IS_IN_DB(db_region, 
>> db_region.state.id, '%(state)s'), writable=False, readable=False),
>> Field('county', length=64, requires=NE, comment='county'),
>> ...
>>
>> and
>>
>> db_region.define_table('post',
>> Field('country_id', db_region.country, requires=IS_IN_DB(db_region, 
>> db_region.country.id, '%(country)s'), writable=False, readable=False),
>> Field('state_id', db_region.state, requires=IS_IN_DB(db_region, 
>> db_region.state.id, '%(state)s'), writable=False, readable=False),
>> Field('county_id', db_region.county, requires=IS_IN_DB(db_region(
>> *db_region.post.state_id==db_region.county.state_id*), 
>> db_region.county.id, '%(county)s'), comment='county'),
>> Field('city', length=64, requires=NE, comment='city'),
>> Field('post', length=11, requires=NE, comment='zip or postal code'),
>> ...
>>
>> see what i am trying to do in the bold?  i am trying to limit the 
>> counties listed in the subsequent SQLFORM select/options to only those 
>> counties that are in the state.
>>
>> when i try to compile i get an error, specifically an AttributeError.  
>> any suggestions?  thanx in advance, lucas
>>
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: model define_table select

2016-03-27 Thread Massimo Di Pierro
replace

IS_IN_DB(db_region(*db_region.post.state_id==db_region.county.state_id*)

with

IS_IN_DB(db_region(*db_region.post.state_id==request.vars.state_id*)

On Saturday, 26 March 2016 12:24:52 UTC-5, lucas wrote:
>
> hello one and all,
>
> ok, under the DAL model, say i have a county and zip code table, like, as 
> defined as:
>
> db_region.define_table('county',
> Field('country_id', db_region.country, requires=IS_IN_DB(db_region, 
> db_region.country.id, '%(country)s'), writable=False, readable=False),
> Field('state_id', db_region.state, requires=IS_IN_DB(db_region, 
> db_region.state.id, '%(state)s'), writable=False, readable=False),
> Field('county', length=64, requires=NE, comment='county'),
> ...
>
> and
>
> db_region.define_table('post',
> Field('country_id', db_region.country, requires=IS_IN_DB(db_region, 
> db_region.country.id, '%(country)s'), writable=False, readable=False),
> Field('state_id', db_region.state, requires=IS_IN_DB(db_region, 
> db_region.state.id, '%(state)s'), writable=False, readable=False),
> Field('county_id', db_region.county, requires=IS_IN_DB(db_region(
> *db_region.post.state_id==db_region.county.state_id*), db_region.county.id, 
> '%(county)s'), comment='county'),
> Field('city', length=64, requires=NE, comment='city'),
> Field('post', length=11, requires=NE, comment='zip or postal code'),
> ...
>
> see what i am trying to do in the bold?  i am trying to limit the counties 
> listed in the subsequent SQLFORM select/options to only those counties that 
> are in the state.
>
> when i try to compile i get an error, specifically an AttributeError.  any 
> suggestions?  thanx in advance, lucas
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] mouse scrolling problem on web2py pages with (ubuntu 14.04) firefox 44.0.2

2016-03-27 Thread Hrobjartur Thorsteinsson
Can anyone with firefox 44.0.2 (default with ubuntu 14.04) help verify a 
potential bug:

I get broken mouse wheel scrolling behavior on web2py with the default 
ubuntu 14.04 firefox v44.0.2.
The mouse wheel scrolling requires many full wheel rotations to clear a 
single line of text.
Those with ubuntu 14.04 would most easily confirm this problem with their 
firefox by visiting
the web2py documentation page here and try to scroll down with mouse wheel:

   http://web2py.com/init/default/documentation

This problem does not seem to appear with older firefox 38, and does not 
occur with Chrome.
I'm not clear if this is a real firefox bug or something that could be 
avoided in web2py javascript.  
In any case its unfortunate problem that may affect many ubuntu users 
mainly, and I would feel
better if we could avoid this issue.

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] web2py rest api endpoint gives invalid path output

2016-03-27 Thread Prakhar Agrawal
http://stackoverflow.com/questions/36235871/web2py-rest-api-endpoint-gives-invalid-path-output

Can someone please look at the question posted. I have been struggling hard 
to get this right. Also I have observed this to be far rare "invalid path".
Also can someone please direct me to where I can find some logs on this. 
This is not an error since web2py generates tickets on errors and clearly 
shows them!

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: beginners to Web2PY web framework? check this out - your first Web2PY db in 34 minutes 15 seconds

2016-03-27 Thread Eamonn
This is a really nice course and I hope it helps people gain an 
understanding of web dev and web2py.

One thing to note, this course is over 12 months old without an update and 
has *not *evolved further. 

Content is good, but there is no support!

On Saturday, 26 March 2016 20:05:20 UTC, Literate Aspects wrote:
>
>
> https://www.udemy.com/web-engineering-with-python-and-web2py/learn/v4/t/lecture/3067796
>
> This is the actual course at Lecture # 9.  Start from the beginning and 
> enjoy.  This manner of instruction is very intuitive and is of the nature 
> of what I believe Web2PY embraces - simplicity and power.
>
> Hello, I found another awesome tutorial for beginners to
> supplement Massimo's 5 series videos as a preliminary first step
> the video for beginners.
>
> As a person moving from an old Delphi history to web frameworks and
> having discovered the incredible contribution of Massimo -
> realizing that the BARE BONES initial understanding seems
> difficult, but... along comes MIKA...
>
> Check it out!
>
> https://www.udemy.com/web-engineering-with-python-and-
> web2py/learn/v4/content
>
> Created by Mika Sjöman, For now, the course is free on Udemy since
> it is under development.  This course is about building web apps by
> learning web engineering and Python programming at the same time.
> We will be using a framework called Web2py which was created to
> make learning programming easy and enjoyable. But Web2py has also
> become a popular framework because it has turned out to be fast,
> scalable and that it allows for extreme developer productivity.
>
>
>
>
>
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: What are the platforms for free web hosting of web2py apps?

2016-03-27 Thread Eamonn
Just to follow up on Mirek;s post, the url is 

https://www.alwaysdata.com

simple typo, seems like a good hosting solution.

On Sunday, 21 February 2016 06:38:46 UTC, Rgb Aston wrote:
>
> Which one's the best to go for?
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] [Newbie] Generally accepted method for a Select statement

2016-03-27 Thread Eamonn
Both of these return the same result, my question:

Are they both consider equally valid or is one better than the other?

The reason I ask is, the first is what I currently use, the second is from 
a tutorial dated 2008.

def showall():
x = db(db.twitch).select()
#x = db().select(db.twitch.ALL)
return locals()

I'm a web dev hobbyist, so the details may be lost on me.

Thanks!

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Djano channels

2016-03-27 Thread Ron Chatterjee
https://m.youtube.com/watch?v=uBV_KKGzNqQ

Found that link that talks about it. But it uses flask. So for chatting use 
channels n realtime streaming n audio use webrtc. Learn something new everyday! 
 Thank you massimo. 

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Djano channels

2016-03-27 Thread Ron Chatterjee
https://m.youtube.com/watch?v=uBV_KKGzNqQ

Found that link that talks about it. But it uses flask. So for chatting use 
channels n realtime streaming n audio use webrtc. Learn something new everyday! 
 Thank you massimo. 

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] web2py Job and Recruitment site

2016-03-27 Thread Ron Chatterjee
What database you guys are using? If you dont mind asking. Also the remax, 
century21...logos. do you read them automatically in the table as people create 
their account or you make them upload a picture?  

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: DHTMLX javascript library

2016-03-27 Thread Leonel Câmara
Note that I never used DHTMLX I'm just looking at their documentation, it 
appears you can use the same URL to save and load the results using 
something like this instead of scheduler.load

myDataProcessor = new 
dataProcessor("{{=URL('rentals.load')}}");myDataProcessor.setTransactionMode("REST");myDataProcessor.init(scheduler);


I would then simply make rentals print request.vars to see what I was 
getting and make whatever I needed serverside.

Check:
http://docs.dhtmlx.com/dataprocessor__initialization.html

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: DHTMLX javascript library

2016-03-27 Thread Henk huisman
You're right. 
I changed the return in the controller to 

*return response.json(rows)*

and now it works as expected.
Thanx.

Still... what to do with all that PHP the dataConnector is written in,  in 
order to get data back tot the server


Op zondag 27 maart 2016 07:56:15 UTC-4 schreef Leonel Câmara:
>
> Pretty sure that controller isn't returning json.
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] web2py Job and Recruitment site

2016-03-27 Thread António Ramos
+1 if web2py inside!! ( you forgot to tell)

2016-03-26 10:58 GMT+00:00 Francisco Tomé Costa :

> Hi,
> At https://www.emprego.pt we've developed a job posting site, where
> candidates can create their professional profile (like LinkedIn)
> https://www.emprego.pt/apresentacao and companies have a complete
> backoffice solution for managing recuitment
> https://www.emprego.pt/recrutamento
>
> The website has only been launched in Portugal and has already more than
> 65000 members and 3400 companies. We also have a newsletter and
> notification system that sends more than 200k emails per week.
>
> We are now looking for partners interested in scaling the business into
> others locations
>
> --
> 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.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: DHTMLX javascript library

2016-03-27 Thread Leonel Câmara
Pretty sure that controller isn't returning json.

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Why does the mailing not work perfectly? What's wrong in this implementation?

2016-03-27 Thread Jacob Devin
inside view I have:

 http://www.google.com/jsapi?key=
">

   if(google.loader.ClientLocation)
{
visitor_lat = google.loader.ClientLocation.latitude;
visitor_lon = google.loader.ClientLocation.longitude;
visitor_city = google.loader.ClientLocation.address.city;
visitor_region = google.loader.ClientLocation.address.region;
visitor_country = google.loader.ClientLocation.address.country;
visitor_countrycode = 
google.loader.ClientLocation.address.country_code;
   ajax('{{=URL('default', 'location')}}' + '?lat=' + visitor_lat + 
'&lon=' + visitor_lon + '&city=' + visitor_city + '®ion=' + 
visitor_region + '&country=' + visitor_country + '&countrycode=' + 
visitor_countrycode, [], ':eval');
}
  


controller function location is as:

def location():
lat=request.vars.lat
lon=request.vars.lon
city=request.vars.city
region=request.vars.region
country=request.vars.country
countrycode=request.vars.countrycode
device=str(request.user_agent)
start=device.find("HTTP_USER_AGENT") + 18
end=device.find("HTTP_CONNECTION") - 3
device=device[start:end]
date_time=request.utcnow+datetime.timedelta(0,19800)
date_time=str(date_time)

db.visitors.insert(latitude=lat,longitude=lon,city=city,region=region,country=country,countrycode=countrycode,device=device,date_time=date_time)
mail.send('mym...@gmail.com',
  'Someone just checked your ePortfolio',
  message='Hola Amigos Mr. 
Jacob!You 
have a new visitorFrom ip address: %sLatitude: %s and 
longitude: %sAddress:  %s, %s, %s, %s and device model: 
%s ' %(str(request.client), str(lat), str(lon), 
str(city), str(region), str(country), str(countrycode), device ))


I do get emails but a very few times!

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Why I don't get an email always? What's wrong in this implementation?

2016-03-27 Thread RRR Triple
inside view I have:

 http://www.google.com/jsapi?key=">

   if(google.loader.ClientLocation)
{
visitor_lat = google.loader.ClientLocation.latitude;
visitor_lon = google.loader.ClientLocation.longitude;
visitor_city = google.loader.ClientLocation.address.city;
visitor_region = google.loader.ClientLocation.address.region;
visitor_country = google.loader.ClientLocation.address.country;
visitor_countrycode = 
google.loader.ClientLocation.address.country_code;
   ajax('{{=URL('default', 'location')}}' + '?lat=' + visitor_lat + 
'&lon=' + visitor_lon + '&city=' + visitor_city + '®ion=' + 
visitor_region + '&country=' + visitor_country + '&countrycode=' + 
visitor_countrycode, [], ':eval');
}
  


controller function location is as:

def location():
lat=request.vars.lat
lon=request.vars.lon
city=request.vars.city
region=request.vars.region
country=request.vars.country
countrycode=request.vars.countrycode
device=str(request.user_agent)
start=device.find("HTTP_USER_AGENT") + 18
end=device.find("HTTP_CONNECTION") - 3
device=device[start:end]
date_time=request.utcnow+datetime.timedelta(0,19800)
date_time=str(date_time)

db.visitors.insert(latitude=lat,longitude=lon,city=city,region=region,country=country,countrycode=countrycode,device=device,date_time=date_time)
mail.send('raghib@iiits.in',
  'Someone just checked your ePortfolio',
  message='Hola Amigos Mr. 
Raghib!You 
have a new visitorFrom ip address: %sLatitude: %s and 
longitude: %sAddress:  %s, %s, %s, %s and device model: 
%s ' %(str(request.client), str(lat), str(lon), 
str(city), str(region), str(country), str(countrycode), device ))


I do get emails but a very few times!

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.