Re: [web2py] Logging http audit

2013-10-14 Thread Arnon Marcus
I don't see a bug here - things work, just no as ideal as it coulb be. I ended up using monkey-patching so I don't even need the thread-local globals - I use them in a dependancy-injection kind of way. So I am successfully bypassing the lack of support in 1.8.95. The issues massimo is raising seem

Re: [web2py] Logging http audit

2013-10-14 Thread Arnon Marcus
The other issue is with the body of requests/responses - how does one reliably accesses the content of the body, regardless of wether it happens to be implemented as an io-stream or a file-wrapper in any given http-session (request->response pair) - and regardless of that being a regular http-re

Re: [web2py] Logging http audit

2013-10-14 Thread Arnon Marcus
In both cases that can be implemented as a form of "rendering". The body can be tought of as being 'rendered-into', say, body.text (which would hold a simple string object) or something, that happens at the end of the current request-processing cycle. Similarly, user-name/info could be rendered

[web2py] Re: Issue with switching to mysql from sqlite in Pythonanywhere (table not created)

2013-10-14 Thread Ykä Marjanen
Thanks Niphlod, I've been happily using SQLite for testing and smaller projects, so switching to MySQL was a new thing (I'd like to use PostgreSQL in the future). I was expecting it to work by just switching the initialization line, as it was working fine with SQLite. But I learned new stuff, a

Re: [web2py] Logging http audit

2013-10-14 Thread Arnon Marcus
I ended-up embedding my code into web2py instead of injecting it - it's simpler this way (for me) - it looks like this: *In logging.conf:* [loggers] keys=root,rocket,markdown,web2py,rewrite,app,welcome,*logstash* [handlers] keys=consoleHandler,rotatingFileHandler,*logstash* ... *[logger_logst

[web2py] Re: Update sqlform.grid query from external click

2013-10-14 Thread Gael Princivalle
Hi Niphlod. Now I use request.vars instead of request.args and it works, I don't have anymore the flash "Not authorized" message. Here is the hp.load file: {{=grid}} {{=A('Test',callback=URL('hp.load', vars=dict(cat='a')))}} When I load only the hp.load file it works, but when I load it

Re: [web2py] T() lack at welcome application?

2013-10-14 Thread mcamel
Wow!, finally the four problems reported have four different reasons/behaviour!!! 1.- Share: yet explained 2.- user/impersonate: i wasn't able to solve it 3.- user/groups: the string "Group uniquely assigned to user %(id)s" seems to be "harcoded" when you create the application. I wasn't able

Re: [web2py] T() lack at welcome application?

2013-10-14 Thread mcamel
Hello, Just want to puntualize that problem 3, happens when you register a new user with Auth, not when you create a new application. Best regards. El lunes, 14 de octubre de 2013 12:09:28 UTC+2, mcamel escribió: > > Wow!, finally the four problems reported have four different > reasons/behav

Re: [web2py] Re: Load with ajax doesn't work since upgrade > 1.6

2013-10-14 Thread Niphlod
of course it doesn't. but it won't work even with pre-2.6.0 releases . you aren't including the template which holds the js to load the component! :D Il giorno lunedì 14 ottobre 2013 08:13:36 UTC+2, Michael Helbling ha scritto: > > > Dear Niphlod > > Attached is a minimal App. In w2p 2

[web2py] Re: Update sqlform.grid query from external click

2013-10-14 Thread Niphlod
I think you don't have a clear "bigger picture" of all the pieces involved. In order to update a component, you need to have it loaded somewhere you know inside the page. This mean that there will be a certain div with id "iwillreload" inside your page that will point to the page that generates t

[web2py] Re: thread._local' object has no ANY attribute

2013-10-14 Thread Matheus Cardoso
I was wondering about that, Massimo. The odd is that sometime before, I was running the same code in the same way. And I assumed that the HTTP request lives while selenium calls a controller with the Web2py running. I will try the command that you stated and to see the discussion that you said.

[web2py] Re: Update sqlform.grid query from external click

2013-10-14 Thread Gael Princivalle
Thanks a lot now I've got it, have a nice day. Il giorno lunedì 14 ottobre 2013 14:07:32 UTC+2, Niphlod ha scritto: > > I think you don't have a clear "bigger picture" of all the pieces involved. > In order to update a component, you need to have it loaded somewhere you > know inside the page. >

Re: [web2py] Re: Load with ajax doesn't work since upgrade > 1.6

2013-10-14 Thread Niphlod
You aren't using any view if you return raw HTML tags (as in return DIV('...')) Il giorno lunedì 14 ottobre 2013 14:38:02 UTC+2, Michael Helbling ha scritto: > > > > hmm, in the view test.html is the layout included, in the layout the > web2py_ajax.html and there are the js included.? :S > do y

[web2py] Embed PDF

2013-10-14 Thread Ari Lion BR Sp
Hi to all, I do generate PDFs at my my application, and do store it at a folder at my aapication, and I want to embed it as a preview at my View page. I was using tag in order to do so: http://www.mysite.com/local_where_i_saved_my_pdf/pdf_name.pdf

Re: [web2py] Re: Load with ajax doesn't work since upgrade > 1.6

2013-10-14 Thread Michael Helbling
Yes, but there was no need to load the js two times on the same page < 2.6. Even if there was an ajax call between the initially page load and the LOAD. if you import the web2py.app.test251.w2p into w2p 2.5.1, you will see, this behavior worked before the upgrade. And there are a lot of these

[web2py] Re: web2py!!!

2013-10-14 Thread Willoughby
You might also look at LighSwitch - it's pretty slick if you're forced to use a Microsoft product. Includes mobile to boot. Anything is better than PHP... http://msdn.microsoft.com/en-us/vstudio/gg604823 http://blogs.msdn.com/b/bethmassi/archive/2011/12/01/beginning-lightswitch-getting-started.

Re: [web2py] Re: Load with ajax doesn't work since upgrade > 1.6

2013-10-14 Thread Niphlod
wait a sec. before (< 2.6.0) the js to "trigger" the load was inlined, but web2py.js HAD to be available nonetheless to make that happen. What's changed is that now web2py.js takes also care of the "trigger". def test2() ret = DIV(XML("test2 ")) ret.append(LOAD(f='test3', ajax=True))

[web2py] web2py 2.7.4 is OUT

2013-10-14 Thread Massimo Di Pierro
there is no new changelog. It is mostly bug fixes. -- 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

[web2py] Re: Error on main site -- powered by -- returns a ticket...

2013-10-14 Thread Massimo Di Pierro
fixed. On Monday, 14 October 2013 01:11:05 UTC-5, jjs0sbw wrote: > > Internal errorTicket issued: > poweredby/208.38.200.112.2013-10-14.06-09-31.0e47e788-d8f0-45ad-9030-43d394841bdd

[web2py] Re: web2py 2.7.4 is OUT

2013-10-14 Thread Massimo Di Pierro
Mind that you may have to re-compile bytecode applications to work with 2.7.4. Is this an issue? we could make it backward compatible but is anybody here distribution bytecode compile apps without distributing web2py with it? On Monday, 14 October 2013 10:35:17 UTC-5, Massimo Di Pierro wrote: >

[web2py] Re: web2py 2.7.4 is OUT

2013-10-14 Thread 黄祥
wonthefull no compiled error again. tested on windows 7 and pythonanywhere. thanks and 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) --

[web2py] Download file from string not triggering

2013-10-14 Thread Kariloy Markief
Hello, I'm writing an app that at some point has a text string dynamically generated in a view via javascript. What I would like to do is download that text as a file. For that purpose my attempted approach has been...: - on the same js function that generates the string I call: ajax('download_

[web2py] Re: web2py!!!

2013-10-14 Thread Derek
I've tried those tutorials, as I was very interested in using Lightswitch. I could never figure out how to get that 'lightswitch' template to install into the new project wizard. This may be a time to step up to corporate IT and ask for approval. Show them the philosophy behind everything. On M

[web2py] Re: onselect ajax...

2013-10-14 Thread Derek
Yea, working with folders is pretty much nonexistant in web2py. you just have to 'rename' something to move it to a different folder. kinda weird but it works. On Saturday, October 12, 2013 2:28:23 AM UTC-7, Avi A wrote: > > Shame to say but Bingo! > It nicely works now :). > Thank you very muc

Re: [web2py] Re: Google Chrome and the editor

2013-10-14 Thread Dave S
On Sunday, October 13, 2013 4:49:14 AM UTC-7, mweissen wrote: > > ok - that works! > > > 2013/10/13 LightOfMooN > > >> Try to Ctrl+F5 >> >> :-) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/

Re: [web2py] Logging http audit

2013-10-14 Thread Ricardo Pedroso
On Mon, Oct 14, 2013 at 10:01 AM, Arnon Marcus wrote: > I ended-up embedding my code into web2py instead of injecting it - it's > simpler this way (for me) - it looks like this: > > *In gluon.contrib.logstash.py:* > > > def log(request, response, session, logger): > > user = '' > sessionD

[web2py] Re: GAE: Running test. issue with exec_environment()

2013-10-14 Thread Quint
Guys, What are the steps i need to take to be able to run tests while using GAE? Do you want me to to create an issue? On Sunday, October 13, 2013 3:14:46 PM UTC+2, Quint wrote: > > That indeed had something to do with it. > After i changed it to this: > > db = DAL('google:datastore') > sessio

[web2py] Re: How to use shell with GAE dev server

2013-10-14 Thread Quint
I created an issue: https://code.google.com/p/web2py/issues/detail?id=1722 On Sunday, October 13, 2013 6:36:36 PM UTC+2, Quint wrote: > > I have an update regarding this question. > > After i changed these lines, i'm getting a step further: > > if not request.env.web2py_runtime_gae: > ## if

[web2py] Re: web2py binary contest

2013-10-14 Thread Niphlod
bump (@moderators, this is just to keep it in the first posts in this week) > > -- 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

[web2py] Re: Download file from string not triggering

2013-10-14 Thread Niphlod
you can't get a "save as" dialog if the contents of the file are retrieved via ajax (browsers don't work like that). Open a new window pointing to the download url (it will soon close as there's no content to show, and the "save as" dialog will pop up). PS: you'd really want to use another syst

[web2py] web2py - one step deployment - now what? :)

2013-10-14 Thread lesssugar
Hi, I'm planning to bring my app "to life". So far, I have followed one-step-production deployment guides and used this script: http://web2py.googlecode.com/hg/scripts/setup-web2py-nginx-uwsgi-centos64.sh All the setup has been completed on my server, now I would like to upload my application

[web2py] Re: web2py - one step deployment - now what? :)

2013-10-14 Thread Anthony
One option is to upload it through the admin interface. On Monday, October 14, 2013 3:53:43 PM UTC-4, lesssugar wrote: > > Hi, > > I'm planning to bring my app "to life". So far, I have followed > one-step-production deployment guides and used this script: > > > http://web2py.googlecode.com/hg/sc

[web2py] How to map custom code to specific user roles to determine the auth_user field?

2013-10-14 Thread Apple Mason
Suppose I have three different types of users: buyer, distributor, and reseller. All buyers, distributors, and resellers have an email, password, and ratings. Since email and password are already part of auth_user, the ratings Field will be an extra field in auth_user. To separate the user rol

[web2py] Re: web2py - one step deployment - now what? :)

2013-10-14 Thread lesssugar
Sure, I understand. But let's say I want to display the welcome application. When I run web2py.py on the server I still get the information that I should visit http://127.0.0.1:8000/. So when I go to [my_domain]/welcome I get "Not found" error. My knowledge here is basic, just so you guys know.

[web2py] Re: GAE: Running test. issue with exec_environment()

2013-10-14 Thread Quint
I figured out that when i use env() in stead of exec_environment() i can successfully load my environment. Is this the recommended way? def setUp (self): self.testbed = testbed.Testbed() self.testbed.activate() self.testbed.init_datastore_v3_stub() self.testbed.ini

[web2py] Re: How to map custom code to specific user roles to determine the auth_user field?

2013-10-14 Thread Niphlod
Things can get messy in no-time with a field that is constantly recalculated every time (e.g.) a row gets inserted into the "ratings" table. Plan carefully those "updating functions" because if that function takes 0.15 sec to execute, than you incur in AT LEAST 0.15 sec delay for every insert/up

[web2py] Re: web2py - one step deployment - now what? :)

2013-10-14 Thread Anthony
If you used the setup script, then web2py is being served via nginx and uwsgi. You should not "run" web2py (i.e., do not enter "python web2py.py" at the command line) -- that serves web2py using the built-in Rocket web server, which you are not using. Once you have run the setup script and have

[web2py] Re: web2py - one step deployment - now what? :)

2013-10-14 Thread lesssugar
OK, I had apache running and blocking the port. Stopped apache, resterted nginx, all works fine. On Monday, October 14, 2013 10:28:47 PM UTC+2, Anthony wrote: > > If you used the setup script, then web2py is being served via nginx and > uwsgi. You should not "run" web2py (i.e., do not enter "pyt

[web2py] Re: How to map custom code to specific user roles to determine the auth_user field?

2013-10-14 Thread Cliff Kachinske
What I like about my solution is you can just let the db compute the average of the ratings for any given user when it's needed. Admittedly this gets a little hairy if you want to rank sellers according to rating in an index list, or show the ratings in such a list. On Monday, October 14, 2013

[web2py] Re: How to map custom code to specific user roles to determine the auth_user field?

2013-10-14 Thread Cliff Kachinske
You probably should rethink your database design. You will surely do not wish to prohibit your sellers from buying things on your commerce site. So leave your auth_user table alone and create three other tables, like so: db.define_table('reseller_rating', Field('rating', 'integer'), Field('rese

[web2py] Re: web2py - one step deployment - now what? :)

2013-10-14 Thread lesssugar
Now, however, I can't get to admin. The password was set during the one step deployment but I cannot get to admin panel with the pass. Any way to retrieve it? On Monday, October 14, 2013 10:56:57 PM UTC+2, lesssugar wrote: > > OK, I had apache running and blocking the port. Stopped apache, reste

[web2py] Change in ImapAdapter content field

2013-10-14 Thread Alan Etkin
> The previous versions of web2py used to store the Content as > a List whereby the Text part and HTML part could be extracted > using: Content[0] and Content[1] formats. For some reasons, the new > update seems to store the Content as a String and not a List. Since some releases back, the way of

[web2py] Re: web2py - one step deployment - now what? :)

2013-10-14 Thread lesssugar
Nevermind, figured it out. On Monday, October 14, 2013 11:09:31 PM UTC+2, lesssugar wrote: > > Now, however, I can't get to admin. The password was set during the one > step deployment but I cannot get to admin panel with the pass. Any way to > retrieve it? > > On Monday, October 14, 2013 10:56:

[web2py] Re: Download file from string not triggering

2013-10-14 Thread Kariloy Markief
Thanks, Yeah it figures it would be something dumb on my part like that. :s I'm actually trying to port an old site I've made over a couple of years back... So, basically on that js I processed everything I wanted out of the page and then... (...) var hidden_list = document.createElement('i

[web2py] odbc error question, when running scheduler_test app.

2013-10-14 Thread Andrew W
Hello, I've hit an odbc error using the Scheduler_Test app against an experimental instance on Teradata. When I turn on the scheduler monitoring I sometimes get: Error: ('HY000', '[HY000] [Teradata][ODBC Teradata Driver] Beyond SQL_ACTIVE_STATEMENTS limit') I've improved things a bit by settin

[web2py] Getting JSON data from a select into Javascript

2013-10-14 Thread david.waldrop
All I am trying to pass data from a function to javascript here is the function in web2py: def getitemtags(inid): jurisdictions = db(db.jurisdiction.aid == inid).select(db.jurisdiction.id, db.jurisdiction.jurisdiction, db.jurisdiction.training, db.jurisdiction.predicted) data = [[row.id

[web2py] Re: Download file from string not triggering

2013-10-14 Thread Kariloy Markief
Ok, as usual my blindness/dumbness knows no boundaries, as I suspect. Thankfully a new set of eyes usually helps me to in the right track, basically what I had to do what use my old JS code... change the cgi target to a controller function and that function was: def testdownform(): fi

[web2py] Re: Getting JSON data from a select into Javascript

2013-10-14 Thread Alan Etkin
> > Does anyone know how to cleanly pas json data to the client? > How about jdata = db(query).select(...).as_json() Then the js part: {{=SCRIPT(""" var myObject = %(jdata)s; """ % dict(jdata=jdata))}} -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github

[web2py] Re: Change in ImapAdapter content field

2013-10-14 Thread PRACHI VAKHARIA
How does one query the IMAP server based on the new format? Previously, to get messages from a given sender in a given mailbox, the following worked » messages = imapdb(imapdb.INBOX.sender.contains("SenderName")).select() Or an email on a given date by » messages = imapdb(imapdb.INBOX

[web2py] Programmatically Start/Restart

2013-10-14 Thread Auden RovelleQuartz
is there a way to programmatically start or restart a web2py application? -- 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 becaus

[web2py] Re: Embed PDF

2013-10-14 Thread Ari Lion BR Sp
I have reallized my mistakes. First of all, I didnt created my 'pdfs' folder under 'static' what I should have done. Second, I was using wrong sintaxe request.http_host instead off request.env. http_host Thanks for listening Em segunda-feira, 14 de outubro de 2013 10h41min31s UTC-3, Ari Lion

[web2py] Re: Change in ImapAdapter content field

2013-10-14 Thread Alan Etkin
> > How does one query the IMAP server based on the new format? > > You can use the same queries as before. The difference is on record representation. The Row object content attribute returned with selects is now a list object containing a dictionary for each message part. -- Resources: - htt

Re: [web2py] Re: Load with ajax doesn't work since upgrade > 1.6

2013-10-14 Thread Michael Helbling
this load works in 2.5.1 (please take a look at web2py.app.test251.w2p). ;-) the web2py.js is available on the page, because it is imported in test(), and the trigger was able to call this js. Am Montag, 14. Oktober 2013 16:43:38 UTC+2 schrieb Niphlod: > > wait a sec. before (< 2.6.0) the j

[web2py] Re: odbc error question, when running scheduler_test app.

2013-10-14 Thread Andrew W
I've found out that a cursor maps to a odbc hstmt. I also found out that Teradata supports 16 open result sets (hstmt) for each session. So it appears that web2py is reusing the same database session for multiple simultaneous requests, or isn't closing them correctly before starting the nex

Re: [web2py] Re: Load with ajax doesn't work since upgrade > 1.6

2013-10-14 Thread Niphlod
yep, but that's because ajax() doesn't raise a finger when talking about components: ajax() is meant to submit form values to an action, not to load components In fact, the recommended way (that continues to work) for the functionality you want is to use A('test', callback=URL(f='test2'),