[web2py] Re: Web2py security questions

2015-03-27 Thread 黄祥
i think you can check it on the book about web2py security ref : http://web2py.com/books/default/chapter/29/01/introduction#Security best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.goog

[web2py] Re: LinkedIn API Please help for the love of god.

2015-03-27 Thread DeanK
@Derek - Did you get auth0 integrated with web2py? On Monday, March 2, 2015 at 2:33:59 PM UTC-5, Derek wrote: > > It would help if you describe what you are doing, some code behind how you > are doing it, and what errors you are having. > > That said, I've had much success with Auth0. > https:

Re: [web2py] Weird behavior with restful api

2015-03-27 Thread Saifuddin Rangwala
Haven't done any configuration for sessions, it should be using the default configuration. Thanks, -Saif. On Fri, Mar 27, 2015 at 11:46 PM, Dave S wrote: > > > On Friday, March 27, 2015 at 10:18:37 AM UTC-7, Saifuddin Rangwala wrote: >> >> If I disable cookie manager with java HttpUrlConnection

Re: [web2py] Django models into web2py

2015-03-27 Thread Ron Chatterjee
Yes, I tried the code and it gave me the same error as well. So the problem is with the djangomodelfactory. I see. -- 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 Iss

Re: [web2py] Django models into web2py

2015-03-27 Thread Phyo Arkar
attached is the fixed django.py . On Sat, Mar 28, 2015 at 8:08 AM, Phyo Arkar wrote: > The example is very old and too many changes neede. > Even after the deprecated fixes , DjangoModelFactory not working anymore > > it have this error: > > Traceback (most recent call last): > File "/home/v3s

Re: [web2py] Django models into web2py

2015-03-27 Thread Phyo Arkar
The example is very old and too many changes neede. Even after the deprecated fixes , DjangoModelFactory not working anymore it have this error: Traceback (most recent call last): File "/home/v3ss/workspace/web2py/gluon/restricted.py", line 224, in restricted exec ccode in environment Fil

[web2py] Re: Web2py security questions

2015-03-27 Thread Ron Chatterjee
hunter, anti-framing, attack,dummy, pointers, clickjacking, prevent, prompting, populated...I thought this is a web develop forum. lol. you are in the wrong group buddy. On Friday, March 27, 2015 at 7:12:02 PM UTC-4, Scott Hunter wrote: > > 1. Does web2py employ, allow or support any anti-fram

[web2py] Web2py security questions

2015-03-27 Thread Scott Hunter
1. Does web2py employ, allow or support any anti-framing measures, to prevent "an attack that can trick the user into clicking on the link by framing the original page and showing a layer on top of it with dummy buttons". If so, any pointers to either documentation describing how these are pre

Re: [web2py] cost of importing into models vs define functions

2015-03-27 Thread Niphlod
uhmyou lost me at "move some function declared kind of globally into models if importing there functions in models global kind" let's just stick to basics: models are executed at every request. Modules are imported at the first occasion and never again. On

[web2py] Django models into web2py

2015-03-27 Thread Ron Chatterjee
This is an old web2py blog. http://www.web2py.com/AlterEgo/default/show/189 Did anyone went through the steps and was able to generate the tables? I tried but it failed. It didn't work. Is it only valid for polls example only or any django models can be used in web2py this way? Not sure. I kn

[web2py] Re: returning data to web page div

2015-03-27 Thread Garry Smith
Screen shot as requested, still player and css to do. On Friday, 27 March 2015 19:14:51 UTC, JorgeH wrote: > > Cool Garry > > Could you attach a screenshot? > > On Friday, March 27, 2015 at 2:12:

Re: [web2py] Re: pyquery, pyjs and web2py

2015-03-27 Thread Phyo Arkar
you can just put them as string in variable and in view call it back. On Sat, Mar 28, 2015 at 2:49 AM, Phyo Arkar wrote: > You will interest in PythonJS , implementation of python in JS which > is alot faster than python . > > https://github.com/PythonJS/PythonJS > > It support a lot of python fe

Re: [web2py] Re: pyquery, pyjs and web2py

2015-03-27 Thread Ron Chatterjee
Nice!:-) On Friday, March 27, 2015 at 4:20:38 PM UTC-4, Phyo Arkar wrote: > > You will interest in PythonJS , implementation of python in JS which > is alot faster than python . > > https://github.com/PythonJS/PythonJS > > It support a lot of python features and compile spython to JS. > > On T

Re: [web2py] Re: pyquery, pyjs and web2py

2015-03-27 Thread Phyo Arkar
You will interest in PythonJS , implementation of python in JS which is alot faster than python . https://github.com/PythonJS/PythonJS It support a lot of python features and compile spython to JS. On Thu, Mar 26, 2015 at 6:08 AM, Ron Chatterjee wrote: > I wasn't looking for a way to create pyt

[web2py] Re: fields strings to variable for fields=fields

2015-03-27 Thread LoveWeb2py
Hi JorgeH, I didn't want to use eval due to code injection, but here is what I ended up using and it worked. field_list = ['db.mytable.field1', 'db.mytable.field2'] fields = [getattr(db.mytable, i.split(".")[-1] for i in field_list] and in SQLFORM fields=fields Thanks everyone!1 On Friday

[web2py] Re: fields strings to variable for fields=fields

2015-03-27 Thread JorgeH
have you tried eval ?? fields = [eval ('db.mytable.field1') , eval ('db.mytable.field2') ] (just a suggestion. I didn't tried myself) On Friday, March 27, 2015 at 2:24:06 PM UTC-5, LoveWeb2py wrote: > > having trouble with the SQLFORM.smartgrid fields section > > Fields only takes > > fie

[web2py] fields strings to variable for fields=fields

2015-03-27 Thread LoveWeb2py
having trouble with the SQLFORM.smartgrid fields section Fields only takes fields = [db.mytable.field1, db.mytable.field2] I have a function that returns all the fields to be returned, but they're in strings format. fields = ['db.mytable.field1', 'db.mytable.field2'] #this returns an error w

[web2py] Re: returning data to web page div

2015-03-27 Thread JorgeH
Cool Garry Could you attach a screenshot? On Friday, March 27, 2015 at 2:12:29 PM UTC-5, Garry Smith wrote: > > Hi > At last I have got the divs working as I wnated. > > The idea was to have 6 columns on a web page, 3 on the top row and three > on the bottom. > > The top row add divs with artist

[web2py] Re: returning data to web page div

2015-03-27 Thread Garry Smith
Hi At last I have got the divs working as I wnated. The idea was to have 6 columns on a web page, 3 on the top row and three on the bottom. The top row add divs with artist albums and tracks as headings. The Bottom with divs with playlist, media abd player. The idea was to have Artist load in th

Re: [web2py] Weird behavior with restful api

2015-03-27 Thread Dave S
On Friday, March 27, 2015 at 10:18:37 AM UTC-7, Saifuddin Rangwala wrote: > > If I disable cookie manager with java HttpUrlConnection, it works! Not > sure what has DAL got to do with cookies? > Sessions, perhaps? How have you configured your sessions? /dps > > On Fri, Mar 27, 2015 at 10:0

Re: [web2py] Weird behavior with restful api

2015-03-27 Thread Saifuddin Rangwala
If I disable cookie manager with java HttpUrlConnection, it works! Not sure what has DAL got to do with cookies? On Fri, Mar 27, 2015 at 10:08 PM, Saifuddin Rangwala < saifuddin.rangw...@gmail.com> wrote: > Pasting the output from web2py console, clearing it is getting the appid > as parameter co

[web2py] cost of importing into models vs define functions

2015-03-27 Thread Richard
Hello, I am in the process to move some functions declared kind of globally into models to speed my app since I found it has some important performance penalty to have been too lazy to "modulized" these functions... I would know if importing these functions in models global kind again would lea

Re: [web2py] Weird behavior with restful api

2015-03-27 Thread Saifuddin Rangwala
Pasting the output from web2py console, clearing it is getting the appid as parameter correctly. <> application.id,application.appname 1,Test 1 application.id,application.appname 1 application.id,application.appname 1 <> On Fri, Mar 27, 2015 at 10:04 PM, Saifuddin Rangwala < saifuddin.rangw...@

[web2py] Weird behavior with restful api

2015-03-27 Thread Saifuddin Rangwala
I have following code in my controller that exposes a restful json api. I am trying to lookup the application by id which is passed as a parameter to this api. Now if I hit this api using curl twice, both the times I see the expected behavior (i.e. application row is fetched from db and a row

Re: [web2py] sqlform based on userid? How to let each user have their own SQLFORM?

2015-03-27 Thread Richard Vézina
you are welcome!! Richard On Fri, Mar 27, 2015 at 12:22 PM, LoveWeb2py wrote: > sigh... so I just realized that the if form.process().accepted actually > processes the form. No words to express my embarrassment right now lol.. > > Thank you for the help, Richard! > > On Friday, March 27, 2015

Re: [web2py] sqlform based on userid? How to let each user have their own SQLFORM?

2015-03-27 Thread LoveWeb2py
sigh... so I just realized that the if form.process().accepted actually processes the form. No words to express my embarrassment right now lol.. Thank you for the help, Richard! On Friday, March 27, 2015 at 12:10:12 PM UTC-4, Richard wrote: > > haha!! > > You need to read... > > http://web2py.c

Re: [web2py] sqlform based on userid? How to let each user have their own SQLFORM?

2015-03-27 Thread Richard Vézina
haha!! You need to read... http://web2py.com/books/default/chapter/29/07/forms-and-validators#FORM Then : http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM In particular form processing : http://web2py.com/books/default/chapter/29/07/forms-and-validators#The-process-m

Re: [web2py] sqlform based on userid? How to let each user have their own SQLFORM?

2015-03-27 Thread LoveWeb2py
Ahhh that makes great sense. Learn something new all the time. Thank you, Richard! right now here is my code: def unique_view(): prefs_id = db(db.unique_view_peruser.auth_user_id == auth.user_id). select(db.unique_view_peruser.id) if len(prefs_id) == 1: prefs_id = prefs_id.id

Re: [web2py] sqlform based on userid? How to let each user have their own SQLFORM?

2015-03-27 Thread Richard Vézina
You can pad that like this : prefs_id = db(db.unique_view_peruser.auth_user_id == auth.user_id).select( db.unique_view_peruser.id) if len(prefs_id) == 1: prefs_id = prefs_id.id else: prefs_id = None If you pass None as a record, SQLFORM is in creation mode, if you pass a record id it wil

Re: [web2py] sqlform based on userid? How to let each user have their own SQLFORM?

2015-03-27 Thread LoveWeb2py
This is perfect, Richard!! Thank you! I didn't realize how record worked. That is really an eye opener. If there is no record for the user I get an error, so I'll have to work on that, but this is exactly what I was looking for. Thank you! On Friday, March 27, 2015 at 10:38:51 AM UTC-4, Richard

Re: [web2py] sqlform based on userid? How to let each user have their own SQLFORM?

2015-03-27 Thread Richard Vézina
You don't give the record id to the SQLFORM(table, *record*) If you pass the record id of you stored app parameters you should be able to update the user prefs instead of creating new record prefs each time... Read SQLFORM doc in book chapter "Forms" 7 I think... In you case, you will have to re

Re: [web2py] sqlform based on userid? How to let each user have their own SQLFORM?

2015-03-27 Thread LoveWeb2py
Hi Richard, Thank you for responding. I'm basically letting a user create their own view for SQLFORM.grid, by choosing which fields to use by selecting them. db.unique_view_peruser is my table which allows each user to go and check the boxes of the fields they want to view. It's just booleans

Re: [web2py] sqlform based on userid? How to let each user have their own SQLFORM?

2015-03-27 Thread Richard Vézina
If you only want the user to see the data but not edit : readonly=True... Richard On Fri, Mar 27, 2015 at 9:59 AM, Richard Vézina wrote: > You mean a profile page with user only allow to update their profile ?? > > SQLFORM(db.auth_user, record=*auth.user_id*) > > It is not clear to understand y

Re: [web2py] sqlform based on userid? How to let each user have their own SQLFORM?

2015-03-27 Thread Richard Vézina
You mean a profile page with user only allow to update their profile ?? SQLFORM(db.auth_user, record=*auth.user_id*) It is not clear to understand your goal... Richard On Fri, Mar 27, 2015 at 9:32 AM, LoveWeb2py wrote: > Hello, > > I have a database with a few hundred users. How could I allow

[web2py] sqlform based on userid? How to let each user have their own SQLFORM?

2015-03-27 Thread LoveWeb2py
Hello, I have a database with a few hundred users. How could I allow them to each have their own SQLFORM without modifying auth.user here is what I have so far: #model db.define_table('unique_view_peruser',' Field('auth_user_id',' db.auth_user, default=auth.user_id, writable=False),

[web2py] Re: Printing stored cache

2015-03-27 Thread Robin Manoli
It's for testing what cache is there and what has been removed. If you can print a list of all stored queries, it's very easy to see when a cache has been stored and when it has been removed. Seems convenient if there are many queries over a period of time. Den fredag 27 mars 2015 kl. 12:20:56

[web2py] Re: Printing stored cache

2015-03-27 Thread Leonel Câmara
This isn't possible right now. Caches do a number of transformations on the key that are not necessarily reversible, there's also no public API in the cache to list the keys stored there. Why do you want to do this anyway? -- Resources: - http://web2py.com - http://web2py.com/book (Documen

[web2py] Printing stored cache

2015-03-27 Thread Robin Manoli
Hi! I'm wondering if it is possible to print what cache is there. I'm currently storing queries with cache.ram and .disk, and wonder if there is a way to list for example all .disk queries. The usage is like this, where query varies. *q1 = db(query1).select( cache=(cache.ram,cache_seconds), cac