[web2py] Re: Modifying web2py JS files -- best practices?

2015-08-05 Thread Massimo Di Pierro
Why do you need to change web2py.js? I have nothing against. I just would like to understand if there is something we can do to make it more general. On Thursday, 6 August 2015 00:41:12 UTC-5, Joe Barnhart wrote: > > It seems more and more clear I'm going to be making changes to the > included w

Re: [web2py] Re: When will we have a "proper" forum ?

2015-08-05 Thread Massimo Di Pierro
I very much agree with this. How do you propose we do it? On Wednesday, 5 August 2015 17:37:19 UTC-5, Limedrop wrote: > > I hesitate to comment on this as it's one of those topics were there's not > "one obvious way to do it" (obviously I'm not Dutch). Essentially, I think > google groups does a

[web2py] Re: postgresql json getitem function implementation

2015-08-05 Thread Massimo Di Pierro
Let's bring this up on web2py developers. I will support it. Can you submit a patch to pydal? On Wednesday, 5 August 2015 17:15:54 UTC-5, Manuele wrote: > > Hi! > I have a table with a json field and I woul like to perform something > like: > > db(db.mytable.id>0).select(db.mytable.myjsonfield

[web2py] Modifying web2py JS files -- best practices?

2015-08-05 Thread Joe Barnhart
It seems more and more clear I'm going to be making changes to the included web2py.js file. I'm worried about keeping current when new versions of web2py come out if I've mucked a lot with this javascript file. So what does everyone else do? How do we customize the platform and still keep cur

[web2py] Re: Module is behaving different in web2py

2015-08-05 Thread David
Running it from the web2py shell by importing the pymssql is returning no results. I am not getting an error I just get: In [10] : rows = cursor.execute("SELECT * FROM PERSON WHERE PERSON.LAST_NAME = 'Palmer'") In [11] : print len(rows) Traceback (most recent call last): File "/home/www-data

Re: [web2py] Re: When will we have a "proper" forum ?

2015-08-05 Thread Limedrop
I hesitate to comment on this as it's one of those topics were there's not "one obvious way to do it" (obviously I'm not Dutch). Essentially, I think google groups does an okay job and the benefits of any change are likely to be outweighed by the heavy cost of that change. Having said that, I'v

[web2py] postgresql json getitem function implementation

2015-08-05 Thread Manuele Pesenti
Hi! I have a table with a json field and I woul like to perform something like: db(db.mytable.id>0).select(db.mytable.myjsonfield.getitem('myfield').with_alias("myfield")) the only way I thought is the patch in attachment that works just fine but I don't like to use a patched version of the frame

[web2py] Re: Bug on DAL OracleAdapter

2015-08-05 Thread Massimo Di Pierro
In trunk! :-) On Wednesday, 5 August 2015 13:31:01 UTC-5, Boris Aramis Aguilar Rodríguez wrote: > > Steps to reproduce: > > db.define_table('atable', Field('longtext', 'text'))#this makes longtext > to be a clob in oracle database > for i in range(1, 100): > db.atable.insert(longtext=str(i)) >

[web2py] Re: Oracle CLOB/text insert adapter issues

2015-08-05 Thread Massimo Di Pierro
This great. It is a good solution for now and can be used as example of similar solutions for other adapters. On Wednesday, 5 August 2015 12:17:49 UTC-5, Boris Aramis Aguilar Rodríguez wrote: > > Hi :) > > I've just managed to fix my issue by adding/modifying a couple of methods > of the *pydal

[web2py] Re: Module is behaving different in web2py

2015-08-05 Thread Anthony
Can you go into a web2py shell and do some basic things, like import pymssql, establish a connection, and issue a basic SQL command? Also, shouldn't you close the connection (i.e., call DestroyConnection) *before* returning from the function? Anthony On Wednesday, August 5, 2015 at 4:55:14 PM

Re: [web2py] To display random questions one by one

2015-08-05 Thread Fabiano Almeida
Hi Sai, Can you try this: import random ## first option to select question s = number of lines of your table i = random.randint(0,s) ## second option to select question - best: no broke if delete any record on table s = db(db.ins_ques.id > 0).select(db.ins_ques.id) i = random.sample(s,1) ## h

[web2py] Re: Module is behaving different in web2py

2015-08-05 Thread David
I like that idea about the __init__ function and will implement that Thanks!!! I don't get any errors. I am just getting None returned in both the controller and shell even when hard codeing a SamAccountName that works within the Python shell. On Wednesday, August 5, 2015 at 4:48:03 PM UTC

[web2py] Re: Module is behaving different in web2py

2015-08-05 Thread Anthony
How are you using this in web2py (i.e., where/how does get_GetEmployeeID get called)? Do you get any errors? When you run the web2py shell, how are you starting it, and are you using the same Python interpreter as when you use the basic Python shell? Also, is the only difference between your tw

[web2py] Re: Module is behaving different in web2py

2015-08-05 Thread David
Here is the first part of the module I was reffering to: import pymssql class HR_DB(): def __init__(self): self.conn = pymssql.connect(DB Connection Info Removed) def Execute(self, statement,*args): cursor = self.conn.cursor() cursor.execute(statement, args)

[web2py] Re: CSRF Forbidden 403 when POST from mobile device.

2015-08-05 Thread Jon M.
I'll make good use of your recommendations, will evaluate the session persistence variables, in order to distinguish the parameters between functions, and/or (will think and test) get rid of session or leave them for good, because of the upcoming views that will display in admin interface or so

[web2py] Bug on DAL OracleAdapter

2015-08-05 Thread Boris Aramis Aguilar Rodríguez
Steps to reproduce: db.define_table('atable', Field('longtext', 'text'))#this makes longtext to be a clob in oracle database for i in range(1, 100): db.atable.insert(longtext=str(i)) rows = db(db.atable.id>0).select() for r in rows: print r.longtext #this fails with the following exception

Re: [web2py] Re: When will we have a "proper" forum ?

2015-08-05 Thread Anthony
On Wednesday, August 5, 2015 at 2:08:57 PM UTC-4, Dave S wrote: > > > > On Wednesday, August 5, 2015 at 10:35:42 AM UTC-7, Richard wrote: >> >> I am not pretending that it is the way to go... But, I can much more >> easily recall something that I read because it search much better then >> googl

Re: [web2py] Google Groups is broken for web2py

2015-08-05 Thread Dave S
On Friday, July 24, 2015 at 1:54:01 PM UTC-7, Massimo Di Pierro wrote: > > Yes there was a google bug. It appear to have been resolved. > > One user has also reported messages disappearing with the message > > > Message from the moderator: > > > Your message has been rejected. > > > Only posts r

Re: [web2py] Re: When will we have a "proper" forum ?

2015-08-05 Thread Dave S
On Wednesday, August 5, 2015 at 10:35:42 AM UTC-7, Richard wrote: > > I am not pretending that it is the way to go... But, I can much more > easily recall something that I read because it search much better then > google can even when you search in the group with google groups... which > somet

[web2py] Re: Module is behaving different in web2py

2015-08-05 Thread Anthony
Hard to say without seeing any code or any details about how you have deployed and are testing the web2py code. On Wednesday, August 5, 2015 at 1:39:14 PM UTC-4, David wrote: > > Hello, > > I am porting some of old legacy web apps (very legacy) to web2py. I am > trying to connect to external dat

[web2py] Re: CSRF Forbidden 403 when POST from mobile device.

2015-08-05 Thread Anthony
Note, unless you are sending/receiving cookies, there is no real point to using the session, as it will not persist from request to request anyway (and you don't appear to be using it for that purpose). Instead, if you need some value to be set in one function and then accessed in another func

Re: [web2py] Re: CSRF Forbidden 403 when POST from mobile device.

2015-08-05 Thread José Ricardo Borba
Thanks for clarifying, Anthony. 2015-08-05 14:40 GMT-03:00 Anthony : > On Wednesday, August 5, 2015 at 11:46:15 AM UTC-4, José Borba wrote: >> >> Hi, Jon, >> >> Now its more clear to me what you really need. Maybe this slice from >> Bruno[1] can help you. I think that YES. ;-) >> >> [1] - http://

Re: [web2py] Re: CSRF Forbidden 403 when POST from mobile device.

2015-08-05 Thread Anthony
On Wednesday, August 5, 2015 at 11:46:15 AM UTC-4, José Borba wrote: > > Hi, Jon, > > Now its more clear to me what you really need. Maybe this slice from > Bruno[1] can help you. I think that YES. ;-) > > [1] - http://www.web2pyslices.com/slice/show/1533/restful-api-with-web2py > Note, this is d

Re: [web2py] Re: CSRF Forbidden 403 when POST from mobile device.

2015-08-05 Thread Anthony
On Wednesday, August 5, 2015 at 11:50:32 AM UTC-4, José Borba wrote: > > Additionally, this[1] part of web2py book can help you too. > > * > > *... By default, Auth protects logins against cross-site request forgeries > (CSRF). This is actually provided by web2py's

[web2py] Module is behaving different in web2py

2015-08-05 Thread David
Hello, I am porting some of old legacy web apps (very legacy) to web2py. I am trying to connect to external databases via module we have tested and used elsewhere but it does not seem to work at all in web2py. For example, if we try to use a function inside this module to find the employee id o

Re: [web2py] Re: When will we have a "proper" forum ?

2015-08-05 Thread Richard Vézina
I am not pretending that it is the way to go... But, I can much more easily recall something that I read because it search much better then google can even when you search in the group with google groups... which sometimes can't even find the exact post that I can in a snap with gmail... Richard

[web2py] Re: Oracle CLOB/text insert adapter issues

2015-08-05 Thread Boris Aramis Aguilar Rodríguez
Hi :) I've just managed to fix my issue by adding/modifying a couple of methods of the *pydal.adapters.oracle.OracleAdapter class*; everything seems to be working for me def _insert(self, table, fields): table_rname = table.sqlsafe if fields: keys = ','.join(f.sq

Re: [web2py] Re: When will we have a "proper" forum ?

2015-08-05 Thread António Ramos
That is tooo archaic... I can have proposals in my email but a CRM is best suited right ? >From a noobie point of view, using a dedicated app he could easily see hot topics that he didn't new existed. and this is a big advantage for me. We can see the big picture ahead. i´m not limited to my limi

[web2py] Re: CSRF Forbidden 403 when POST from mobile device.

2015-08-05 Thread Jon M.
Wow, thanks! I can feel the love here at the forums! @José, I'll make the Bruno's approach at local PC in order to apply those good practices exposed without risk, failure isolation has my attention and I'm definitely in favor of isolation, so, will do, and catch up more with clients as stated.

[web2py] Re: CSRF Forbidden 403 when POST from mobile device.

2015-08-05 Thread Anthony
> @Anthony, the HTTPS protocol is not yet implemented, first we need the > transactions fully working, so HTTP protocol is used meanwhile. We're not > using web browsers, is the Android App that generates a POST with JSON > request, that is: > > "{entry_value=}" > > As if you were using cu

Re: [web2py] Re: CSRF Forbidden 403 when POST from mobile device.

2015-08-05 Thread José Ricardo Borba
Wow! The thing is become more clear post after post! In this case (IoT), I suggest that you, in the FIRST place, starts with a python client (like suggested in the Bruno slice before). And ONLY when things go right you turn to implement the Android (or whatever platform) way. This will isolate your

Re: [web2py] Re: CSRF Forbidden 403 when POST from mobile device.

2015-08-05 Thread Jon M.
That was fast, thanks! :D > > * > > *... By default, Auth protects logins against cross-site request forgeries > (CSRF). This is actually provided by web2py's standard CSRF protection > whenever forms are generated in a session. However, under some > circumstance

Re: [web2py] Re: CSRF Forbidden 403 when POST from mobile device.

2015-08-05 Thread Jon M.
Thanks José! :D I'm afraid it already does help me... :3 In the implementation of that slice, Leonel Cámara & Massimo came to suggest another way of having POST requests for the backend... So, a modification of it he suggested in: https://groups.google.com/d/msg/web2py/wfHtQ6P2Gmo/lrljWW1LBEIJ

Re: [web2py] Re: CSRF Forbidden 403 when POST from mobile device.

2015-08-05 Thread José Ricardo Borba
Additionally, this[1] part of web2py book can help you too. * *... By default, Auth protects logins against cross-site request forgeries (CSRF). This is actually provided by web2py's standard CSRF protection whenever forms are generated in a session. However, under

Re: [web2py] Re: CSRF Forbidden 403 when POST from mobile device.

2015-08-05 Thread José Ricardo Borba
Hi, Jon, Now its more clear to me what you really need. Maybe this slice from Bruno[1] can help you. I think that YES. ;-) [1] - http://www.web2pyslices.com/slice/show/1533/restful-api-with-web2py Best Regards, José Ricardo Borba 2015-08-05 12:39 GMT-03:00 Jon M. : > Hi José! Thanks for supo

Re: [web2py] Re: CSRF Forbidden 403 when POST from mobile device.

2015-08-05 Thread Jon M.
Hi José! Thanks for suporting too! C: I'm learning about this framework, and I have a glimpse of what the browser does in data exchange between web pages and backend stuff... But, in this application, I'm afraid we want to provide the right interface for the backend. So, no web forms, at least

Re: [web2py] Re: CSRF Forbidden 403 when POST from mobile device.

2015-08-05 Thread José Ricardo Borba
Jon, You MUST have to access the form before send your POST message, to access the CSRF token sended from web2py. This is a security solution that disallow other people to send undesired messages to your app. Best Regards, José Ricardo Borba 2015-08-05 10:37 GMT-03:00 Jon M. : > Thanks for the

Re: [web2py] Re: When will we have a "proper" forum ?

2015-08-05 Thread Richard Vézina
I like receive all email from the list in a dedicated mail box (gmail), I can then easily search in the question and answer... :) Richard On Wed, Aug 5, 2015 at 9:12 AM, JorgeH wrote: > I have been using this forum for years, and NEVER EVER have used email. > > I visit the web forum: > > https

[web2py] Re: CSRF Forbidden 403 when POST from mobile device.

2015-08-05 Thread Jon M.
Thanks for the support and figuring it out with the community! Providing answers in the right order: @Anthony, the HTTPS protocol is not yet implemented, first we need the transactions fully working, so HTTP protocol is used meanwhile. We're not using web browsers, is the Android App that gener

[web2py] Re: When will we have a "proper" forum ?

2015-08-05 Thread JorgeH
I have been using this forum for years, and NEVER EVER have used email. I visit the web forum: https://groups.google.com/forum/#!forum/web2py And in the settings I chosed not to get emails:

[web2py] Re: When will we have a "proper" forum ?

2015-08-05 Thread xmarx
> > > It does have tags: https://groups.google.com/forum/#!tags/web2py > > but unfortunatelyit doesn't using effectively. because i think. most messages send and replied vie e-mail. it would be nice to have the following features in 'new forum' or whatever. 1. transfer or copy all google group