Re: [web2py] how to change facebook oauth2 redirect_uri

2016-04-10 Thread killzane
I see all settings but I don't know what attribute I should change.
the *redirect_uri* args I mean is when log with facebook will goto 

https://www.facebook.com/dialog/oauth?
client_id=568390199919780&
scope=email,user_birthday&
*redirect_uri*=https://my_domain/[app]/default/user/login

because if the rediect_uri don't have the *FaceBookAccount()* instance it 
will show error and can't login success.

So I just use a "_blank" link to open my *fbLogin *page?

mcm於 2016年4月11日星期一 UTC+8上午3時48分18秒寫道:
>
> You should be able to change redirect url using the standard settings of 
> auth.
>
>
> http://www.web2py.com/books/default/chapter/29/09/access-control#Auth-Settings-and-messages
>
> You do not need ajax, just a window.open() or a  target="_blank"> or an iframe
>
>
>
> 2016-04-10 9:38 GMT+02:00 killzane >:
>
>> I followed the web2py book 
>> http://web2py.com/books/default/chapter/29/09/access-control#Other-login-methods-and-login-forms
>>  and 
>> put the example code in my model
>>
>> and I use this in my controllers named *default.py*
>> def fbLogin():
>> auth.settings.login_form=FaceBookAccount()
>> form = auth()
>>
>> return dict(form=form)
>>
>> When I visit this page, I can see facebook Oauth.
>> there are some problem I want to solve.
>> 1. why the *redirect_uri* set to [app]/default/user/login but not 
>> [app]/default/fbLogin?
>> may I set it manual?
>>
>> 2. facebook suggest me to show a window to show the Oauth page, but I'm 
>> not really know how to do it in web2py.
>> I should use ajax to do it? or some other way?
>>
>> -- 
>> 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+un...@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: delete on confirmation

2016-04-10 Thread 黄祥
please try
{{=SPAN(A(T('Delete'), _href = URL('delete', args = [id] ), _title = 
'Delete', 
 _onclick = "javascript:return confirm('Are you sure you want to 
process?')", 
 _class = 'to-delete') ) }}

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] delete on confirmation

2016-04-10 Thread rajjmatthur
I have a link where I delete the table entry. 



But I would like to have a confirmation like "are you sure you want to 
delete...?". I believe I need to use javascript. 

Any help from the group? How to get a confirmation window prior to delete?



-- 
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] Tracking user original referral URL

2016-04-10 Thread Richard Vézina
Hello Joe,

You can extract URL like this if you know where the use is coming from, I
use the below code in "" link to pass the URL in _next
variable so the view on which the user is redirected which content a form
will redirect the user on the _next var content...

URL(r=request, c="controller_name", f="function_name",
 vars=dict(_next=URL(


*request.controller,
request.function,
args=request.args,
vars=request.get_vars*)))

# Once the form pass, the user is redirected where he come from...
redirect(request.vars._next)

Though it may present some security issues as someone can tamper with the
url for instance and redirect the user over somewhere else (another site
for instance). If this is a concern you can have a look at web2py code to
learn how avoid that... Signing URL may be sufficient, but then it may
still have other security concern about doing that...

But I think that if you only want to track where the use is coming from in
your app these concern shouldn't stop using this...

So you can do :

session.http_referer_url = dict(controller=request.controller,
function=request.function, args=request.args, vars= request.get_vars)

You can also have a look here :

http://www.web2pyslices.com/slice/show/1618/basic-usage-statistics-log-what-your-users-do

For the data persistence side of your question...

Good luck

Richard

On Fri, Apr 8, 2016 at 6:19 AM, Joe  wrote:

> What is the best way to track HTTP_REFERER URL and store them in a
> session?
> Then, if the users submits the form I would like to save the HTTP_REFERER
> URL in the db.
>
> I would appreciate some guidance with this.
>
> Thanks very much.
>
> Cheers,
>
> Joe
>
> --
> 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: what are globals?

2016-04-10 Thread Anthony
It's just Python -- 
see http://www.diveintopython.net/html_processing/locals_and_globals.html. 
The built-in globals() function returns a dictionary of all the objects in 
the global environment.

Anthony

On Sunday, April 10, 2016 at 9:30:48 PM UTC-4, Alex Glaros wrote:
>
> I see globals used in the welcome app.  Are they something that 
> programmers can make good use of and what are they best suited for?
>
> {{if 'message' in globals():}}
> {{=message}}
> {{=T('How did you get here?')}}
> {{elif 'content' in globals():}}
> {{=content}}
> {{else:}}
> {{=BEAUTIFY(response._vars)}}
> {{pass}}
>
> thanks
>
> Alex Glaros
>

-- 
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] what are globals?

2016-04-10 Thread Alex Glaros
I see globals used in the welcome app.  Are they something that programmers 
can make good use of and what are they best suited for?

{{if 'message' in globals():}}
{{=message}}
{{=T('How did you get here?')}}
{{elif 'content' in globals():}}
{{=content}}
{{else:}}
{{=BEAUTIFY(response._vars)}}
{{pass}}

thanks

Alex Glaros

-- 
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] how to change facebook oauth2 redirect_uri

2016-04-10 Thread Michele Comitini
You should be able to change redirect url using the standard settings of
auth.

http://www.web2py.com/books/default/chapter/29/09/access-control#Auth-Settings-and-messages

You do not need ajax, just a window.open() or a  or an iframe



2016-04-10 9:38 GMT+02:00 killzane :

> I followed the web2py book
> http://web2py.com/books/default/chapter/29/09/access-control#Other-login-methods-and-login-forms
>  and
> put the example code in my model
>
> and I use this in my controllers named *default.py*
> def fbLogin():
> auth.settings.login_form=FaceBookAccount()
> form = auth()
>
> return dict(form=form)
>
> When I visit this page, I can see facebook Oauth.
> there are some problem I want to solve.
> 1. why the *redirect_uri* set to [app]/default/user/login but not
> [app]/default/fbLogin?
> may I set it manual?
>
> 2. facebook suggest me to show a window to show the Oauth page, but I'm
> not really know how to do it in web2py.
> I should use ajax to do it? or some other way?
>
> --
> 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: to tinyMCE or to do something else ?

2016-04-10 Thread Pierre
I am concerned  with keeping my app light and simple. As for tinyMCE i've 
got serious doubts: tinyMCE-bigPROBLEMS   :)

-- 
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 many days does it take you to learn django if you know web2py (and only web2py)?

2016-04-10 Thread rajjmatthur
On that note, is it possible to use web2py template language in Django? 
Does anyone know.

On Wednesday, March 16, 2016 at 10:18:59 AM UTC-4, rajjm...@gmail.com wrote:
>
> If you are not comfortable with django ORM you can also use SQLalchemy . 
> Use that in web2py first to verify your model. And then you can copy and 
> replace in django. Here is a way to replace the django ORM with SQLAlchemy. 
>
> http://lethain.com/replacing-django-s-orm-with-sqlalchemy/
>
> You will be in luck when they have a way to use pydal in django. But for 
> now, this may be another option to bridge the gap between two. 
>
>
>
> On Wednesday, March 16, 2016 at 8:15:55 AM UTC-4, Bernard Letourmy wrote:
>>
>> Hello,
>> Took me around 2 months working on a new project from scratch to feel 
>> nearly as comfortable with django as I was in web2py (after having enjoyed 
>> web2py for 2+ years)
>> Although prepare to feel quite lot of pain along the way such
>> As when you keep repeating yourself with declaring and connecting 
>>  routes, controller (sorry view there) and templates till you find your own 
>> way to auto generate the relations
>> Prepare to cry about batteries missing, such as:
>> - default user system with authentication views included, simple default 
>> REST api support etc,
>> -nice and automatically configured appadmin with dal query, g not only 
>> basic CRUD)
>> - a scheduler
>> - having to always find from where  the hell  you need to import that 
>> class  you use every day...
>> - having to find it in a manual splitted in chapters without a nice table 
>> of content and good index  system  that force you to use Google even when 
>> you know it's in the manual.
>>
>> You''ll also miss the power and clean syntax of pydal. You will see when 
>> you will try to do your first join with django orm...
>> But ok once accustomed to the silly __ _id field__gte=x notations using 
>> keywords argument instead of the clean field object and standard Python 
>> Operators of pydal 
>> You will enjoy quite  powerful object oriented interface on your models.
>> With automatic reverse relation generations, very nice way to extend the 
>> default model classes.
>> Basically a lot of choices at all stages either inside the framework for 
>> different ways to do the same thing or out there when it comes to find a 
>> plugin (an app in django) that provides the missing feature.
>> These being both advantages and inconvenience, explaining that it will 
>> take certainly longer to be fully up and running with django than with 
>> web2py
>>
>> Forgot one thing that's really nice with django:
>> the migration system. It's less 'automatic' then web2py's one but more 
>> powerful and reliable in my opinion as it allows forward and backwards 
>> migration and stores its meta data in the DB instead of the filesystem 
>> itself allowing you to easily switch DB backend and migrate them from the 
>> same Dev env for ex.
>> And one thing less nice
>> The core dev community is quite opiniated/ and stuck on the by design 
>> limitations...
>> With the view/template system that force you to learn a new language with 
>> expression being very restricted subset of Python
>> And force to develop yourself most of the basic filter needed.
>> Then quite a lot of won't fix issues or request for feature some 
>> repeatidely asked for 10years
>>
>> But I do quite like django also :)
>>
>> Bon courage for your learning
>> Bernard 
>>
>>

-- 
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] No module named images

2016-04-10 Thread Alex Glaros
am migrating to newest db.py, css, js, bootstrap3 by choosing "New simple 
application" from admin panel and adding pieces of my app to new version 
one at a time

where did "images" go? The following error is raised:

 No module named imagesVersion
web2py™ Version 2.14.3-stable+timestamp.2016.03.26.23.02.02
Python Python 2.7.9: C:\alex\alt_web2py_3\web2py\web2py.exe (prefix: )
Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.

Traceback (most recent call last):
  File "C:\alex\alt_web2py_3\web2py\gluon\restricted.py", line 227, in 
restricted
exec ccode in environment
  File "C:/alex/alt_web2py_3/web2py/applications/test/models/db.py" 
, line 113, in 

from images import RESIZE
  File "C:\alex\alt_web2py_3\web2py\gluon\custom_import.py", line 95, in 
custom_importer
return base_importer(pname, globals, locals, fromlist, level)
ImportError: No module named images



thanks

Alex Glaros

-- 
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: to tinyMCE or to do something else ?

2016-04-10 Thread Leonel Câmara
Take a look at Tim's plugin for ckedito4
https://github.com/timrichardson/web2py_ckeditor4

You can integrate tinyMCE much the same way.

-- 
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] to tinyMCE or to do something else ?

2016-04-10 Thread Pierre
Hi,

acording to the book 
:http://www.web2py.com/books/default/chapter/29/03/overview?search=tinyMCE
it should be possible to plug-in tinyMCE
I have been trying to do so following steps described in the doc but 
nothing works. the tinyMCE buttons don't do anything and whatever I input I 
always end up with a page body equal to : 


Philosopher Leon Chestov claims we should all believe in miracles. I 
personnally do and if   **isn't one what is it ?

Has anyone succeeded in using tinyMCE in Web2py to create/edit html pages ?

-- 
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: define custom style by class using SQLFORM

2016-04-10 Thread 'Annet' via web2py-users
Hi,

I am not sure I understand your question correctly

How do I change the style of a form using SQLFORM?
>

In appconfig.ini you can set:

; form styling
[forms]
formstyle = bootstrap3_stacked
separator =

and then in the db.py file:

## choose a style for forms
response.formstyle = myconf.take('forms.formstyle')  # or 
'bootstrap3_stacked' or 'bootstrap2' or other
response.form_label_separator = myconf.take('forms.separator')


And you can style individual fields:

form.element('input[name=firstName]').update(_class='form-control', 
_placeholder='First name')

I hope this helps you solve the issue.

Kind regards,

Annet

-- 
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 to change facebook oauth2 redirect_uri

2016-04-10 Thread killzane
I followed the web2py book 
http://web2py.com/books/default/chapter/29/09/access-control#Other-login-methods-and-login-forms
 and 
put the example code in my model

and I use this in my controllers named *default.py*
def fbLogin():
auth.settings.login_form=FaceBookAccount()
form = auth()

return dict(form=form)

When I visit this page, I can see facebook Oauth.
there are some problem I want to solve.
1. why the *redirect_uri* set to [app]/default/user/login but not 
[app]/default/fbLogin?
may I set it manual?

2. facebook suggest me to show a window to show the Oauth page, but I'm not 
really know how to do it in web2py.
I should use ajax to do it? or some other way?

-- 
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.