[web2py] Is there anyway to register a user manually just like login_bare? I am using it in the mobile app.

2012-09-13 Thread Kenny


login_bare is so useful for accessing the database manually in mobile 
application, is there anyway to let the users to register the website via 
mobile application?

ex) register_bare(id,password) -> Save it in the database -> user is registered.

I wasn't able to find how I should make this registration step for mobile app + 
web2py.

Thank you



-- 





[web2py] Is it possible to remove row from rows result created from DB?

2012-09-17 Thread Kenny
Basically, I get the place data with longitude and latitude, calculate it 
if it's more than 3000 miles, remove that row from Rows. 
I am sure that this is wrong. If I can remove the row from fetch rows, how 
can I add extra columns to the rows for distance between two points?
P.S the result has to be Jsoned.

Here's the code

def tester():
items = db(db.dine_promotion.place_id==db.place.id).select()

latitude =float(23.790457)
longitude =float(-47.602542)
for row in items:
if row.place.latitude:
a=float(row.place.latitude)
b=float(row.place.longitude)
dist="%.2f" % calc_distance(latitude,longitude,a,b)
if  dist > 3000:
items.remove(row)
return dict(restaurants = items)

-- 





[web2py] Re: How can I receive oauth/access tokens with the Oauth library in Web2py?

2013-03-26 Thread Kenny
I was able to manage this issue. Tweepy was the one I used and used 
redirect to get tokens from callback. I guess it's better to leave 
login_form function as is. :) Have a nice day!

On Tuesday, March 26, 2013 8:51:09 AM UTC-5, Kenny wrote:
>
> Yesterday, I wanted to get the tokens from Facebook and Twitter for users 
> and using the Web2py normal login system at same time. I only wanted to use 
> their APIs not for implementing oauth login into my website.
> I was able to get tokens from Facebook API by using Facebook JavaScript 
> SDK. I chose this route since I don't know how to separate the Web2py given 
> library(login_form) for getting only tokens instead of creating auth users 
> and signing in. 
> If I can separate the login_form, how should I do it? Or is there any 
> other way around?
>
> Thank you!
>

-- 

--- 
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/groups/opt_out.




[web2py] Time picker is not showing up on Appadmin page.

2012-03-12 Thread Kenny
Date and datetime pickers are working fine except time picker

Field('start_time', 'time',notnull=True), is what I put.

It doesn't give me any js calendar popup.

Any help? thank you.


[web2py] Is there any way to calculate distance between two points(lat and long) inside of sqlite?

2012-03-14 Thread Kenny
I just started programming in web2py from php.

I know how to do it on Mysql and GAE(geohash or I forgot but there's
another one)

But it seems that SQLite doesn't support acos and asin. Is it true?

Is there any other way around to calculate inside of Sqlite query?

What would be the best way to do this? Should I just calculate
distance after fetching the db?

I tried to search it on Google but no luck.


[web2py] How do I group the list by value and make it table in HTML?

2012-03-18 Thread Kenny
I have
city_list = [('Huntsville', 'AL'), ('Decatur', 'AL'),
 ('Anchorage', 'NV'), ('Nome', 'AK'),('Selma', 'AL'),
 ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ')]

And I want to list it in HTML.

I don't know what would be the best solution for this.

so Html will display

AL
Decatur
Huntsville
Selma

AZ
Flagstaff
Tucson
Phoenix



I don't care about sorting. The solution I can think of is use two for
loops and one if loop to search and display. I don't think this is not
a good approach.


[web2py] Re: How do I group the list by value and make it table in HTML?

2012-03-18 Thread Kenny
I think I will just do it with this way..
I created two lists (one is for states,one is for city and state)

And I just compared them by for loops. sorry for newb question as I am
new to python.

On 3월18일, 오전12시21분, Kenny  wrote:
> I have
> city_list = [('Huntsville', 'AL'), ('Decatur', 'AL'),
>  ('Anchorage', 'NV'), ('Nome', 'AK'),('Selma', 'AL'),
>  ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ')]
>
> And I want to list it in HTML.
>
> I don't know what would be the best solution for this.
>
> so Html will display
>
> AL
> Decatur
> Huntsville
> Selma
>
> AZ
> Flagstaff
> Tucson
> Phoenix
>
> 
>
> I don't care about sorting. The solution I can think of is use two for
> loops and one if loop to search and display. I don't think this is not
> a good approach.


[web2py] How do I add inside of in HTML format?

2012-03-19 Thread Kenny
I looked up the documentary and example, I wasn't able to find one.
How can I convert this to Web2py format?

Wish List (3)

Thank you.


[web2py] I am trying to make pizza order page with web2py. What's the best way to store toppings info?

2012-03-26 Thread Kenny
I am just trying to make pizza order page with web2py.
I usually store quantity of pizza and id number in session.

But how can I store pizza topping info that user ordered in session?

I am not too familiar with python, so I don't know what would be the
best way to store it.

So session will have

{pizza_id, quantity}

and toppings under that pizza id.

Thank you.


[web2py] time field in DAL? when I retrieve it, it gives me as nontype instead of time type.

2012-03-29 Thread Kenny
I tried to compare by doing

{{=row.start_hour > request.now.time()}}

start_hour is defined as 'time'

error : 

TypeError: can't compare datetime.time to NoneType


How can I convert time field to be time type? so I can compare them. 


Also, one last question is how can I show times in different timezone? 
Do I need to use pypt?

thank you.



[web2py] just deployed web2py on flux flex. I have errors on database. How can I delete DBs and migrate them?

2012-04-03 Thread Kenny
I inserted databases on Fluexflex's MySql. However, I had an error while 
inserting them. 

The question is how can I delete SQL file in web2py application and insert 
dbs all over again?

I dropped all the tables in mysql server. However web2py application has 
sql file that I cannot have an access in Fluexflex.

So, I can't let DAL insert dbs automatically since DAL assumes that the 
tables are already created.

Any help would be appreciated.

Thank you.


[web2py] Is there anyone using Linode to host Web2py??

2012-04-05 Thread Kenny
I just registered for Linode to host web2py. after playing it for few 
hours, It doesnt seem too easy to deploy..

I followed
https://groups.google.com/forum/?fromgroups#!topic/web2py/kd_A86Qwz6w

by creating a script and run it. (init.deb.sh files are relocated)

I think everything's followed nicely but not working.

Is there anyone who can help me out by giving me instruction or info? 

Thank you.



[web2py] Re: Is there anyone using Linode to host Web2py??

2012-04-05 Thread Kenny
By the way, the setup I was looking at was wsgi+ nginx

On Thursday, April 5, 2012 9:14:07 PM UTC-7, Kenny wrote:
>
> I just registered for Linode to host web2py. after playing it for few 
> hours, It doesnt seem too easy to deploy..
>
> I followed
> https://groups.google.com/forum/?fromgroups#!topic/web2py/kd_A86Qwz6w
>
> by creating a script and run it. (init.deb.sh files are relocated)
>
> I think everything's followed nicely but not working.
>
> Is there anyone who can help me out by giving me instruction or info? 
>
> Thank you.
>
>

Re: [web2py] Is there anyone using Linode to host Web2py??

2012-04-05 Thread Kenny
i am following their tut right now. It caused "502 Bad Gateway"

any idea?


On Thursday, April 5, 2012 9:39:13 PM UTC-7, rochacbruno wrote:
>
> I use Linode and I just run web2py/scripts/nginx+uwsgi and t works like a 
> charm!
>
> On Fri, Apr 6, 2012 at 1:14 AM, Kenny  wrote:
>
>> I just registered for Linode to host web2py. after playing it for few 
>> hours, It doesnt seem too easy to deploy..
>>
>> I followed
>> https://groups.google.com/forum/?fromgroups#!topic/web2py/kd_A86Qwz6w
>>
>> by creating a script and run it. (init.deb.sh files are relocated)
>>
>> I think everything's followed nicely but not working.
>>
>> Is there anyone who can help me out by giving me instruction or info? 
>>
>> Thank you.
>>
>>
>
>
> -- 
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>
>

Re: [web2py] Is there anyone using Linode to host Web2py??

2012-04-05 Thread Kenny
Rocha! What just happened?!!! 
wow! I was looking at the codes falling down on the screen for few mins. I 
was like "What's this script doing? " and then.. boom! done and done. Thank 
you!
 
I have one more question. Did this script install PIL? It was too many 
lines. I wasn't able to catch up. haha
good night!

On Thursday, April 5, 2012 10:12:24 PM UTC-7, rochacbruno wrote:
>
> go to your shell, download web2py, unzip it and run the script
>
> ~/$  wget http://www.web2py.com/examples/static/web2py_src.zip
> ~/$ unzip web2py_src.zip
> ~/$ cd web2py/scripts
> ~/web2py/scripts$ chmod +x setup-web2py-nginx-uwsgi-ubuntu.sh
> ~/web2py/scripts $ ./setup-web2py-nginx-uwsgi-ubuntu.sh
>
> just follow the steps in script
>
> On Fri, Apr 6, 2012 at 2:06 AM, Kenny  wrote:
>
>> i am following their tut right now. It caused "502 Bad Gateway"
>>
>> any idea?
>>  
>>
>> On Thursday, April 5, 2012 9:39:13 PM UTC-7, rochacbruno wrote:
>>>
>>> I use Linode and I just run web2py/scripts/nginx+uwsgi and t works like 
>>> a charm!
>>>
>>> On Fri, Apr 6, 2012 at 1:14 AM, Kenny  wrote:
>>>
>>>> I just registered for Linode to host web2py. after playing it for few 
>>>> hours, It doesnt seem too easy to deploy..
>>>>
>>>> I followed
>>>> https://groups.google.com/**forum/?fromgroups#!topic/**
>>>> web2py/kd_A86Qwz6w<https://groups.google.com/forum/?fromgroups#%21topic/web2py/kd_A86Qwz6w>
>>>>
>>>> by creating a script and run it. (init.deb.sh files are relocated)
>>>>
>>>> I think everything's followed nicely but not working.
>>>>
>>>> Is there anyone who can help me out by giving me instruction or info? 
>>>>
>>>> Thank you.
>>>>
>>>>
>>>
>>>
>>> -- 
>>>
>>> Bruno Rocha
>>> [http://rochacbruno.com.br]
>>>
>>>
>
>
> -- 
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>
>

[web2py] this might be out of Web2py topic. I am trying to change the time on Ubuntu. It kept showing me UTC

2012-04-13 Thread Kenny
I am trying to change the time on Ubuntu. It kept showing me UTC time. I 
tried all the method.
ln -sf /usr/share/zoneinfo/UTC /etc/localtime

and

dpkg-reconfigure tzdata 

but no luck

I even changed rcS to UTC=no but no goal

Any Idea? I am using linode.

I am sorry for unrelated topic. but after googling to find some solutions, this 
group is where I am at now. ;) 




[web2py] Re: this might be out of Web2py topic. I am trying to change the time on Ubuntu. It kept showing me UTC

2012-04-13 Thread Kenny
ignore this post. My letc/localtime was corrupted. Just deleted and 
resymbolinked it.

On Friday, April 13, 2012 9:39:02 PM UTC-7, Kenny wrote:
>
> I am trying to change the time on Ubuntu. It kept showing me UTC time. I 
> tried all the method.
> ln -sf /usr/share/zoneinfo/UTC /etc/localtime
>
> and
>
> dpkg-reconfigure tzdata 
>
> but no luck
>
> I even changed rcS to UTC=no but no goal
>
> Any Idea? I am using linode.
>
> I am sorry for unrelated topic. but after googling to find some solutions, 
> this group is where I am at now. ;) 
>
>
>

[web2py] How can I combine Facebook login and regular login?

2012-04-26 Thread Kenny
So I think I successfully implemented Facebook login. However, I have a 
problem combining with regular login.

Because as the book stated, I did
auth.settings.actions_disabled=['register','change_password','request_reset_password','profile']

so I can't use regular register/login

How can I combine them together? Thank you.


Re: [web2py] Re: Uploadify what am I doing wrong

2012-11-17 Thread Kenny
Thank you for sharing. I am getting IOerror from this.  It seems to me that 
it's working on your server and not on mine. very weird.

On Wednesday, July 4, 2012 3:29:11 PM UTC-5, Relsi Hur wrote:
>
> here a very fast example.
>
> Em quarta-feira, 4 de julho de 2012 16h40min45s UTC-3, cheer10s escreveu:
>>
>> thank you for helping me
>>
>> I looked at some of the documentation and figured out some things but I 
>> get an IORERROafter uploading any ideas
>>
>> here is my modified controller and my uploadify script I am using 
>> uploadify version 3
>>
>> def myUpload():
>> form = SQLFORM(db.music)
>> if form.accepts(request.vars,session):
>> mySong=request.post_vars.Filedata
>> db.music.insert(song = db.music.song.store(mySong.file, 
>> mySong.filename))
>> response.flash = 'Your info has been submitted'
>> return dict(form=form)
>> elif form.errors:
>> response.flash = 'Please correct the highlighted fields'
>> return dict(form=form)
>> else:
>> return dict(form=form)
>>
>>
>> myUpload.html
>>
>> 
>>
>>
>> jQuery('document').ready(function() {
>> jQuery('#music_song').uploadify({
>> 'swf' : '{{=URL("static", "uploadify/uploadify.swf")}}',
>> 'script' : '{{=URL("default", "myUpload")}}',
>> 'cancelImg' : '{{=URL("static", 
>> "uploadify/uploadify-cancel.png")}}',
>> 'buttonText': 'Upload Song',
>> 'folder' : '/uploads/music',
>> 'auto'  : true,
>> 'multi' : false,
>> 'checkExisting' : false
>> });
>> });
>> 
>>
>> {{=form}}
>>
>>
>>
>>
>> On Wed, Jul 4, 2012 at 11:11 AM, Relsi Hur < > wrote:
>>
>>> here is working fine, but my script is a little different, see if 
>>> something helps:
>>>
>>> http://pastebin.com/tKLSC9Uw
>>>
>>> Em quarta-feira, 4 de julho de 2012 14h05min40s UTC-3, cheer10s escreveu:
>>>
 Hello I am trying to use uploadify in my web2py app but I am having a 
 bit of difficulty no errors occur it just doesn't work


 These are my controllers

 def index():
 return dict() 

 def myUpload():
 form = SQLFORM(db.music)
 if form.accepts(request.vars, session):
 response.flash = 'Your info has been submitted'
 return dict(form=form)
 elif form.errors:
 response.flash = 'Please correct the highlighted fields'
 return dict(form=form)
 else:
 return dict(form=form)


 my index view

 {{extend "template.html"}}
 

 {{=LOAD('default','myUpload',**ajax=False)}}

 

 myUpload view (its not a load file)

 
 $(document).ready(function() {
   $('#music_song').uploadify({
 "uploader"  : "{{=URL('static', 'uploadify/uploadify.swf')}}",
 "script": "{{=URL('default', 'index')}}",
 "cancelImg" : "{{=URL('static', 'uploadify/uploadify-cancel.**
 png')}}",
 "auto"  : true
   });
 });
 

 {{=form}}



 and this is in template.html 


 >>> type="text/css" rel="stylesheet" />

 {{include "web2py_ajax.html"}}

 <**/script>