[web2py] New Relic module causing import error

2013-04-29 Thread Yarin
We're trying to integrate New Relic with web2py. We installed it per their instructions for web2py running on mod_wsgihttps://newrelic.com/docs/python/python-agent-and-web2py, adding the following lines in wsgihandler.py: import newrelic.agent

Re: [web2py] Re: New Relic module causing import error

2013-04-29 Thread Yarin Kessler
UTC+2, Yarin wrote: We're trying to integrate New Relic with web2py. We installed it per their instructions for web2py running on mod_wsgihttps://newrelic.com/docs/python/python-agent-and-web2py, adding the following lines in wsgihandler.py: import newrelic.agent newrelic.agent.initialize

Re: [web2py] Re: New Relic module causing import error

2013-04-29 Thread Yarin
error when httplib2 imported later newrelic.agent.initialize('/opt/web-apps/web2py/newrelic.ini')# DOES cause error On Monday, April 29, 2013 5:00:37 PM UTC-4, Ricardo Pedroso wrote: On Mon, Apr 29, 2013 at 9:30 PM, Yarin Kessler ykes...@gmail.comjavascript: wrote: Yes, we have

Re: [web2py] Re: New Relic module causing import error

2013-04-29 Thread Yarin
-4, Ricardo Pedroso wrote: On Tue, Apr 30, 2013 at 12:41 AM, Yarin ykes...@gmail.com javascript: wrote: Ricardo- yes, importing httplib2 throws the same error, even without importing oauth. We've noticed that the problem does not arise with the new relic import statment

Re: [web2py] Re: New Relic module causing import error

2013-04-29 Thread Yarin Kessler
Cliff- No, we are not using virtualenv On Mon, Apr 29, 2013 at 10:23 PM, Cliff Kachinske cjk...@gmail.com wrote: Are you using a virtualenv? Maybe you having a version clash between libs. -- --- You received this message because you are subscribed to a topic in the Google Groups

Re: [web2py] Re: New Relic module causing import error

2013-04-29 Thread Yarin Kessler
and leaving it at that. On Mon, Apr 29, 2013 at 11:49 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Is this only with web2py? What if you import newrelic followed by httplib2 in from shell or in wsgi before importing web2py? On Monday, 29 April 2013 21:28:24 UTC-5, Yarin wrote

[web2py] Upgrade from 2.2.1 to 2.4.6 breaks requests library??

2013-04-22 Thread Yarin
Our application makes use of the Python requestshttp://docs.python-requests.org/en/latest/library to post http requests. As soon as we upgraded from 2.2.1 to 2.4.6 we started getting errors. Trace: File

[web2py] Multiple session objects being created for the same client IP

2013-04-17 Thread Yarin
(This question stems from an issue first brought up herehttps://groups.google.com/forum/?fromgroups=#!topic/web2py/iAlrv6yaHWk ) We store user sessions in the DB using the web2py_session_{app} table. Inspecting the table, we've noticed a strange pattern happening over and over again: Many of

[web2py] Re: MySQL server has gone away errors happening more and more with db-based sessions?

2013-04-17 Thread Yarin
Yes- I've documented this issue in a new question - please see: https://groups.google.com/d/msg/web2py/A7P4HoST-Lg/NZ3kmTTwVG0J On Wednesday, April 17, 2013 3:08:38 AM UTC-4, Niphlod wrote: everyone with a different unique_key ? On Wednesday, April 17, 2013 12:43:35 AM UTC+2, Yarin wrote

[web2py] Re: Multiple session objects being created for the same client IP

2013-04-17 Thread Yarin
2.2.1 On Wednesday, April 17, 2013 9:16:41 AM UTC-4, Massimo Di Pierro wrote: Which web2py version? On Wednesday, 17 April 2013 08:08:48 UTC-5, Yarin wrote: (This question stems from an issue first brought up herehttps://groups.google.com/forum/?fromgroups=#!topic/web2py/iAlrv6yaHWk

[web2py] Re: Multiple session objects being created for the same client IP

2013-04-17 Thread Yarin
that don't send cookies? On Wednesday, April 17, 2013 9:08:48 AM UTC-4, Yarin wrote: (This question stems from an issue first brought up herehttps://groups.google.com/forum/?fromgroups=#!topic/web2py/iAlrv6yaHWk ) We store user sessions in the DB using the web2py_session_{app} table

[web2py] Re: Multiple session objects being created for the same client IP

2013-04-17 Thread Yarin
/changed. Therefore is the cookie was not returned it would start making new session files/records. On Wednesday, 17 April 2013 08:26:30 UTC-5, Yarin wrote: 2.2.1 On Wednesday, April 17, 2013 9:16:41 AM UTC-4, Massimo Di Pierro wrote: Which web2py version? On Wednesday, 17 April 2013 08:08

[web2py] Re: MySQL server has gone away errors happening more and more with db-based sessions?

2013-04-16 Thread Yarin
changes) ? On Tuesday, April 16, 2013 11:09:50 PM UTC+2, Yarin wrote: We've had our production application running problem free for 10 months, but in the past month or so we've started encountering MySQL server has gone away errors sporadically, but with increasing frequency. Currently

[web2py] Re: MySQL server has gone away errors happening more and more with db-based sessions?

2013-04-16 Thread Yarin
Largest session_data fields were 12 KiB On Tuesday, April 16, 2013 5:49:45 PM UTC-4, Niphlod wrote: either than a large blob/object in the session I really can't see how an update so simple (syntax-wise) takes 50 seconds (when the minimum reported time is 0.8ms) on mysql end. edit: did you

[web2py] Re: MySQL server has gone away errors happening more and more with db-based sessions?

2013-04-16 Thread Yarin
app from 13 different devices today. Why would a single user connecting from a single device have so many session records?? On Tuesday, April 16, 2013 6:21:56 PM UTC-4, Yarin wrote: Largest session_data fields were 12 KiB On Tuesday, April 16, 2013 5:49:45 PM UTC-4, Niphlod wrote

[web2py] User specific sessions

2013-02-26 Thread Yarin
Normally when storing variables within the session object, they will persist throughout the entire browser session lifetime, regardless of whether a user is logged in. What's the best way to implement user-specific session storage- i.e. variables I want stored in session for as long as a

[web2py] Re: User specific sessions

2013-02-26 Thread Yarin
:34:34 PM UTC-5, Anthony wrote: You could use auth.settings.login_onaccept and auth.settings.logout_onlogout functions to clear the items from session that you don't want to persist. On Tuesday, February 26, 2013 8:59:46 PM UTC-5, Yarin wrote: Normally when storing variables within

Re: [web2py] Re: Scheduler: help us test it while learning

2013-02-25 Thread Yarin Kessler
Sweet- looking forward to using the API. Schema changes a pain but done for right reasons. Can you give more explanation of the immediate=True param? As for patterns- a basic event calendar would be good demo Thanks for the great work Niphlod On Sat, Feb 23, 2013 at 1:21 PM, Niphlod

[web2py] Re: Purpose of creating group for each user?

2013-02-14 Thread Yarin
. Turns out most users (including me) do not use them and prefer to set simpler ad hoc permission rules. In case there is no problem in disabling user groups. On Friday, 1 February 2013 15:42:49 UTC-6, Yarin wrote: The documentationhttp://web2py.com/books/default/chapter/29/09

[web2py] Error when trying to access membership table: type 'exceptions.AttributeError' 'Row' object has no

2013-02-13 Thread Yarin
I'm getting a type 'exceptions.AttributeError' 'Row' object has no attribute 'username' error when I try to access the membership table in the db admin screens. This is happening on a project that *used* to use username as the login field but does not anymore (*username* column is no longer

[web2py] Re: Error when trying to access membership table: type 'exceptions.AttributeError' 'Row' object has no

2013-02-13 Thread Yarin
auth.define_tables(username=None) ? is there some non-standard db connection / auth tables definitions ? On Wednesday, February 13, 2013 9:59:57 PM UTC+1, Yarin wrote: I'm getting a type 'exceptions.AttributeError' 'Row' object has no attribute 'username' error when I try to access the membership

[web2py] Why aren't email/username fields unique?

2013-02-10 Thread Yarin
Why are email/username fields not created with (unique=True) by default? Since these fields are use to identify users, non-unique values would clearly break auth. (Side note: where is the code for defining the default auth table fields located?- can't find it anywhere) -- --- You received

Re: [web2py] Re: Why aren't email/username fields unique?

2013-02-10 Thread Yarin Kessler
friendly error message on the form rather than causing a database operational error and a 500 response. Anthony On Sunday, February 10, 2013 11:11:39 AM UTC-5, Yarin wrote: Why are email/username fields not created with (unique=True) by default? Since these fields are use to identify users, non

[web2py] Purpose of creating group for each user?

2013-02-01 Thread Yarin
The documentationhttp://web2py.com/books/default/chapter/29/09#Authorizationstates: The creation of the group can be disabled with auth.settings.create_user_groups = None although we do not suggest doing so. Massimo also says

[web2py] Re: Purpose of creating group for each user?

2013-02-01 Thread Yarin
:42:49 UTC-6, Yarin wrote: The documentationhttp://web2py.com/books/default/chapter/29/09#Authorizationstates: The creation of the group can be disabled with auth.settings.create_user_groups = None although we do not suggest doing so. Massimo also says herehttps://groups.google.com/d

Re: [web2py] Re: calendar.js incompatible with moment.js

2012-12-24 Thread Yarin
with dates, upgrade calendar.js. Massimo On Sunday, 23 December 2012 15:57:27 UTC-6, Yarin wrote: 10 4 - Submitted issue to moment.js: https://github.com/timrwood/moment/issues/556 On Sunday, December 23, 2012 4:05:38 PM UTC-5, Massimo Di Pierro wrote: Looks like both do function

Re: [web2py] Re: calendar.js incompatible with moment.js

2012-12-23 Thread Yarin
functions in the global namespace. On Sunday, 23 December 2012 00:26:15 UTC-6, Yarin wrote: Not errors, just incorrect results- fails to parse dates, and returns isValid() false when testing valid date strings- see my bug report for a reproducable example- On Sat, Dec 22, 2012 at 10:27 PM

[web2py] calendar.js incompatible with moment.js

2012-12-22 Thread Yarin
We've found that the popular date library moment.js fails on date parsing when used alongside the calendar.js file included by default with web2py projects. I've submitted a bug report: http://code.google.com/p/web2py/issues/detail?id=1243 We removed calendar.js from our projects, but I'm

Re: [web2py] Re: calendar.js incompatible with moment.js

2012-12-22 Thread Yarin Kessler
? On Saturday, 22 December 2012 20:41:43 UTC-6, Yarin wrote: We've found that the popular date library moment.js fails on date parsing when used alongside the calendar.js file included by default with web2py projects. I've submitted a bug report: http://code.google.com/p/**web2py/issues

[web2py] Changing subject line of email verification email

2012-10-17 Thread Yarin
I'd like to change the subject line of the email verification sent on registration- is that possible? --

[web2py] Re: inserting/updating NULL values via db admin screens

2012-10-16 Thread Yarin
October 2012 19:50:31 UTC-5, Yarin wrote: Is it possible to work with NULL values via the DB admin screens? I've got a bunch of string fields that should default to NULL, but everytime I try to insert a record through the admin screens they wind up as empty strings. Worse, existing records

[web2py] inserting/updating NULL values via db admin screens

2012-10-15 Thread Yarin
Is it possible to work with NULL values via the DB admin screens? I've got a bunch of string fields that should default to NULL, but everytime I try to insert a record through the admin screens they wind up as empty strings. Worse, existing records that have NULL values get those values

[web2py] Re: Improving SSL Support

2012-10-04 Thread Yarin
requires_https() while the user is logged in, and on all login/registration methods. I'll update the ticket On Friday, September 21, 2012 2:26:36 PM UTC-4, Yarin wrote: Done http://code.google.com/p/web2py/issues/detail?id=1023 On Friday, September 21, 2012 2:05:41 PM UTC-4, Massimo Di

[web2py] Re: Problem with securing sessions

2012-10-04 Thread Yarin
UTC-5, Yarin wrote: Niphlod- Thanks, you're correct- that's exactly what's happening. We should then update the *requires_https()* implementation: *gluon/globals.py:* def requires_https(self): If request comes in over HTTP, redirect it to HTTPS and secure the session

[web2py] Re: Improving SSL Support

2012-10-04 Thread Yarin
=='on' or request.env.http_x_forwarded_proto in ['https', 'HTTPS'] address the first issue? Massimo On Thursday, 4 October 2012 07:05:17 UTC-5, Yarin wrote: I'm revising my stance on this. After further digging around, I'm gonna go with Niphlod's position that securing only the login traffic without

Re: [web2py] Re: Improving SSL Support

2012-10-04 Thread Yarin Kessler
Awesome thanks Massimo- will test tonight On Thu, Oct 4, 2012 at 4:13 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: OK. check trunk. Auth(db,secure=True). On Thursday, 4 October 2012 13:01:51 UTC-5, Yarin wrote: Yes exactly On Thursday, October 4, 2012 12:38:34 PM UTC-4

[web2py] Re: Problem with securing sessions

2012-10-04 Thread Yarin
Massimo- quick fix: *session.forget()* must be *current.session.forget()*, otherwise throws error On Thursday, October 4, 2012 8:11:23 AM UTC-4, Yarin wrote: Great- I've updated/simplified my other recommendations on SSLhttps://groups.google.com/d/msg/web2py/me1e5d6Dudk/R5Bgt6axSPEJas well

[web2py] Re: Problem with securing sessions

2012-10-03 Thread Yarin
Niphlod- Thanks, you're correct- that's exactly what's happening. We should then update the *requires_https()* implementation: *gluon/globals.py:* def requires_https(self): If request comes in over HTTP, redirect it to HTTPS and secure the session. if not

[web2py] Problem with securing sessions

2012-10-01 Thread Yarin
I'm bumping up against a problem in the session.secure() implementation. If a session is secured, and then the app is hit with an http request, the session is blown out. This happens even if the session isn't modified by the http request and even if it is immediately redirected to https. The

[web2py] Re: Problem with securing sessions

2012-10-01 Thread Yarin
ottobre 2012 17:43:25 UTC+2, Yarin ha scritto: I'm bumping up against a problem in the session.secure() implementation. If a session is secured, and then the app is hit with an http request, the session is blown out. This happens even if the session isn't modified by the http request and even

[web2py] Re: Problem with securing sessions

2012-10-01 Thread Yarin
.) I'm going to test it. On Monday, October 1, 2012 7:07:17 PM UTC+2, Yarin wrote: Forget 2 its irrelevant- I'm only securing session for HTTPS requests, but what I'm concerned with is maintaining the secure session even if an HTTP request slips in. For example, I had this in my model

[web2py] Re: web2py 2.0 DAL no longer usable for mysql stored procedures

2012-09-27 Thread Yarin
Done: http://code.google.com/p/web2py/issues/detail?id=1037 On Thursday, September 27, 2012 4:33:37 PM UTC-4, Massimo Di Pierro wrote: Is this issue still open? If so, can you open a ticket about it? Massimo On Monday, 24 September 2012 14:38:14 UTC-5, Yarin wrote: db.py

[web2py] Re: web2py 2.0 DAL no longer usable for mysql stored procedures

2012-09-24 Thread Yarin
, September 24, 2012 1:10:14 PM UTC-4, Massimo Di Pierro wrote: can you show us some of your code. This may be a concurrency issues. I cannot thing anything we change that would affect the behavior. On Sunday, 23 September 2012 22:43:28 UTC-5, Yarin wrote: After upgrading to web2py 2.0, we can

[web2py] web2py 2.0 DAL no longer usable for mysql stored procedures

2012-09-23 Thread Yarin
After upgrading to web2py 2.0, we can no longer use the DAL or mysql adapters to make MySQL stored procedure calls. In web2py 1.x I had reportedhttps://groups.google.com/d/msg/web2py/VaGJjwE3eYQ/GPa3xRe-HVsJhow mysql stored procedures weren't working for us in certain circumstances- however

[web2py] Re: Improving SSL Support

2012-09-21 Thread Yarin
, 2012 8:40:35 AM UTC-4, Massimo Di Pierro wrote: Can you suggest a way to detect that? On Thursday, 20 September 2012 13:56:55 UTC-5, Yarin wrote: @Massimo - that'd be great. One more kink to throw in is recognizing proxied SSL calls. This requires knowing whether you can trust

[web2py] Re: Improving SSL Support

2012-09-21 Thread Yarin
' ]: return # Redirect to HTTPS: redirect(URL(scheme='https', args=request.args, vars=request.vars)) On Friday, September 21, 2012 9:53:36 AM UTC-4, Yarin wrote: The completely naive approach would be to do: if request.env.http_x_forwarded_for

[web2py] Re: Improving SSL Support

2012-09-21 Thread Yarin
reliably? On Friday, 21 September 2012 10:28:26 UTC-5, Yarin wrote: FYI this is the enforcer function we wrote for our implementation- basically a rewrite of request.requires_https(): def force_https(trust_proxy = False): Enforces HTTPS in appropriate environments Args

[web2py] Re: Improving SSL Support

2012-09-21 Thread Yarin
, HTTP url from it: login_next_url = URL(scheme='http',c='default',f='index') +login_next_path [1:] # Redirect to the HTTP URL: redirect(login_next_url) auth.settings.login_onaccept = on_login On Friday, September 21, 2012 12:35:37 PM UTC-4, Yarin wrote: You

[web2py] Re: Improving SSL Support

2012-09-21 Thread Yarin
Done http://code.google.com/p/web2py/issues/detail?id=1023 On Friday, September 21, 2012 2:05:41 PM UTC-4, Massimo Di Pierro wrote: Yarin, please open an issue on google code as suggested enhancement so ti does not get lost. Also feel free to move the discussion on web2py developers

[web2py] Improving SSL Support

2012-09-20 Thread Yarin
A proposal for improving SSL support in web2py For authenticated web applications, there are two grades of SSL implementions: Forcing SSL on login, vs forcing SSL on the entire authenticated session. In the first case, HTTPS is forced on login/registration, but reverts back to HTTP upon

[web2py] Re: Improving SSL Support

2012-09-20 Thread Yarin
at http*S*://example.com is managed by Yarin). If you are trustworthy for only *some *of the urls, you publish something at http*S*://example.com and something at http://example.com, and users need to know *in advance* that your login is on a http*S*, *and pay attention before hitting login

[web2py] Re: Monitoring scheduler with supervisord

2012-09-20 Thread Yarin
Any luck with this Simone? On Friday, September 14, 2012 12:39:19 PM UTC-4, Niphlod wrote: ok, give me a few hours, I need to get home first :P --

Re: [web2py] Re: Monitoring scheduler with supervisord

2012-09-20 Thread Yarin Kessler
You the man On Thu, Sep 20, 2012 at 12:13 PM, Niphlod niph...@gmail.com wrote: no free time at home to test on every platform, but the code part is done. in a few days. On Thursday, September 20, 2012 6:09:59 PM UTC+2, Yarin wrote: Any luck with this Simone? On Friday, September 14

[web2py] Re: Improving SSL Support

2012-09-20 Thread Yarin
auth.settings.force_ssl_login and auth.settings.force_ssl_login. We could add secure=True option to existing requires validators. This should not be enforced from localhost. On Thursday, 20 September 2012 09:07:14 UTC-5, Yarin wrote: A proposal for improving SSL support in web2py For authenticated web

[web2py] Re: Improving SSL Support

2012-09-20 Thread Yarin
I, mad ? Absolutely not! The obvious big +1 is that no man in the middle can ever see the exchanged data between Yarin server and user A. As for users concerns and dns poisoning, if every page of http://example.com normally redirects to httpS://example.com, then users knows that every page

[web2py] Re: Monitoring scheduler with supervisord

2012-09-14 Thread Yarin
; current._scheduler.loop() app = 'myapp' run(app,True,True,None,False,code) On Wednesday, August 15, 2012 5:48:54 AM UTC+2, Yarin wrote: I'm trying to use supervisord to monitor scheduler workers. My supervisord.conf file: [program:my_scheduler] command={my_site_path}/web2py.py -K

[web2py] Re: web2py book on github

2012-09-14 Thread Yarin
@Alan- delete the html file completely from the static_chaps folder- that's what worked for me On Friday, September 14, 2012 11:48:53 AM UTC-4, Alan Etkin wrote: there's no development app. The book app is the one in production :p . It caches the output of markmin pages to avoid cpu usage. If

[web2py] Re: Monitoring scheduler with supervisord

2012-09-14 Thread Yarin
want to manage the workers through supervisord with the standard config you have to use this script. On Friday, September 14, 2012 5:41:47 PM UTC+2, Yarin wrote: @Niphlod- I was hoping this embedded mode patch was going to become part of the 2.0 implementation. I see you added a -X flag

[web2py] Re: Monitoring scheduler with supervisord

2012-09-14 Thread Yarin
Sure that works for me On Friday, September 14, 2012 12:25:02 PM UTC-4, Niphlod wrote: well, maybe we can support not spawning if -K is followed by one app only. Thoughts ? On Friday, September 14, 2012 6:16:08 PM UTC+2, Yarin wrote: Right, I was just voting for having the script

[web2py] Re: web2py book on github

2012-09-13 Thread Yarin
as documented in the bok itself. Massimo -- From 0f2eef084252b641eae8e5b671ad06c1b715f0ed Mon Sep 17 00:00:00 2001 From: Yarin Kessler ykess...@gmail.com Date: Thu, 13 Sep 2012 17:10:51 -0400 Subject: [PATCH] Squashed changes --- sources/29-web2py-english/04.markmin | 122

[web2py] Filtering on NULL values in DAL query

2012-09-05 Thread Yarin
Is this documented anywhere? --

Re: [web2py] Filtering on NULL values in DAL query

2012-09-05 Thread Yarin
Thanks. Massimo we need this in the docs. On Wednesday, September 5, 2012 2:38:26 PM UTC-4, rochacbruno wrote: On Wed, Sep 5, 2012 at 3:12 PM, Marin Pranjić marin@gmail.comjavascript: wrote: it is db.table.field != None operator ~ is used for ORDER BY and it maps to DESC. Yes, my

[web2py] Async processing options

2012-08-31 Thread Yarin
I have an app where the user uploads a large photo using web2py's normal upload mechanism. After that, the program needs to do some image manipulation, upload it to cloudfiles, and update the db when it's complete. But I don't want to require the user to wait around for all that to finish

[web2py] Re: Async processing options

2012-08-31 Thread Yarin
it as a blocked thread/process and terminate it abruptly. That's the main reason behind the existence of all various tasks schedulers (and cron scripts). Il giorno venerdì 31 agosto 2012 18:24:10 UTC+2, Yarin ha scritto: I have an app where the user uploads a large photo using web2py's normal upload

[web2py] Re: web2py 2.0.2 is out

2012-08-30 Thread Yarin
Congratulations and many thanks to Massimo and all contributors - the best framework keeps getting better --

[web2py] Accessing auth_user the first time a user logs in

2012-08-30 Thread Yarin
We have to perform a series of checks and updates on an auth_user record as soon as their registration has been verified. Previously, we had not required verification and had done everything in register_onaccept: def first_thing(form): Performs a series of checks for newly registered

[web2py] Versioning static files or other options for browser cache reloading

2012-08-30 Thread Yarin
I'm trying to apply a version number to my CSS files as a way to force browsers to load the latest version, but the following examples never get outputted even though they create valid URLs: response.files.append(URL('static','css/main.css', vars=dict(v='1208301'))) or

Re: [web2py] Re: Accessing auth_user the first time a user logs in

2012-08-30 Thread Yarin Kessler
if auth_event holds a record of the user logged in. On Thursday, August 30, 2012 6:41:27 PM UTC+2, Yarin wrote: We have to perform a series of checks and updates on an auth_user record as soon as their registration has been verified. Previously, we had not required verification and had done

Re: [web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Yarin
So it seems like response.files has a problem with appended vars? Even when I spell out the URL entirely, it never gets output: response.files.append(/css/main.css?v=123) # Doesn't get output response.files.append(/css/main.css) # Does get output Assuming this is why rocha used html. Can we fix

Re: [web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Yarin
response.optimize_css co. disabled: they somewhat cache around your files for some time. That implementation is buggy in my POV. On Thursday, August 30, 2012 9:38:51 PM UTC+2, Yarin wrote: So it seems like response.files has a problem with appended vars? Even when I spell out the URL

Re: [web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Yarin
a different scaffolding app for 1.99.7 that didn't use response.include_files(), so that's because it was working for me in 1.99.7. Sorry. On Thursday, August 30, 2012 10:55:10 PM UTC+2, Yarin wrote: Niphlod- here you go, a brand new example app created as follows: 1. Created basic app

Re: [web2py] Re: Avoiding loading models for the public portion of a site

2012-08-29 Thread Yarin
, Yarin ykes...@gmail.com javascript:wrote: pbreit- Yeah I thought about letting apache handle the public part, but that still leaves me in the lurch because I can't use web2py to determine whether the user is logged in, which is how we decide whether to deliver the public or private

[web2py] Avoiding loading models for the public portion of a site

2012-08-28 Thread Yarin
A basic architecture question: We're putting together a typical web app where non-logged in users reach a public-facing basic 'brochure' site, and then log in to reach the 'real' application. With such a setup, it makes no sense to be loading models for the public portion of the site, as it's

Re: [web2py] Avoiding loading models for the public portion of a site

2012-08-28 Thread Yarin
, 2012 at 10:52 PM, Yarin ykes...@gmail.com javascript:wrote: A basic architecture question: We're putting together a typical web app where non-logged in users reach a public-facing basic 'brochure' site, and then log in to reach the 'real' application. With such a setup, it makes no sense

Re: [web2py] Avoiding loading models for the public portion of a site

2012-08-28 Thread Yarin
PM UTC-4, Yarin wrote: Thanks guys but don't understand how conditional models could be applied here. I thought conditional models were models specific to a single controller/function? My app has many controllers that use the models, and only a few basic pages where I don't want models

Re: [web2py] Avoiding loading models for the public portion of a site

2012-08-28 Thread Yarin
They will not load when you call actions in public. Massimo On Tuesday, 28 August 2012 22:19:03 UTC-5, Yarin wrote: And now I'm also not sure how to go about separating the public site into a separate application- wouldn't I still need to hit the 'real' application to check the whether the user

Re: [web2py] Avoiding loading models for the public portion of a site

2012-08-28 Thread Yarin
. Do not have a solution other than use two apps or move all public controllers under the same file or use lazy_tables. On Tuesday, 28 August 2012 22:28:09 UTC-5, Yarin wrote: But my app has 13 private controllers and 1 public controller? On Tuesday, August 28, 2012 11:21:46 PM UTC-4, Massimo

[web2py] Re: Avoiding loading models for the public portion of a site

2012-08-28 Thread Yarin
, 2012 6:52:12 PM UTC-7, Yarin wrote: A basic architecture question: We're putting together a typical web app where non-logged in users reach a public-facing basic 'brochure' site, and then log in to reach the 'real' application. With such a setup, it makes no sense to be loading models

Re: [web2py] Re: Avoiding loading models for the public portion of a site

2012-08-28 Thread Yarin
be a solution. Thanks On Tuesday, August 28, 2012 11:56:27 PM UTC-4, Bruce Wade wrote: Hi Yarin, Using conditional models will allow you to not load any models when you don't need them. Your idea of moving the brochure part of the site so it doesn't even get loaded by web2py will definitely

[web2py] Re: Avoiding loading models for the public portion of a site

2012-08-28 Thread Yarin
the static site direct through Nginx/Apache. Otherwise, as you note, conditional models may not work so waiting for lazy tables might be best (should be any day now in 2.0). On Tuesday, August 28, 2012 8:55:35 PM UTC-7, Yarin wrote: Who said anything about premature? We want our app to run

[web2py] Re: DAL not returning results on temp table query

2012-08-27 Thread Yarin
executesql() wrapped string you'll be fine. If some of your lines returns results, then the driver doesn't know what set to actually return. Anyway splitting those lines in multiple db.executesql()s is working great. On Saturday, August 25, 2012 5:58:40 PM UTC+2, Yarin wrote: I'm trying to execute

[web2py] DAL calls fail after first stored procedure call

2012-08-27 Thread Yarin
Once I call a stored procedure through the DAL, any subsequent calls are returning None results. *Basic stored procedure:* BEGIN SELECT * FROM people; END *Works:* def test(): sql = CALL GetPeople(); sproc_results = db_test.executesql(sql) return str(sproc_results) *Works:* def

[web2py] Re: DAL calls fail after first stored procedure call

2012-08-27 Thread Yarin
Pretty desperate on this one- brought everything to a screeching halt. We need to be able to call more than one stored procedure per request. Anybody got any ideas? On Monday, August 27, 2012 10:37:45 AM UTC-4, Yarin wrote: Once I call a stored procedure through the DAL, any subsequent calls

[web2py] Re: DAL calls fail after first stored procedure call

2012-08-27 Thread Yarin
Villas- Thanks but no it doesn't- tried that.. On Monday, August 27, 2012 1:53:32 PM UTC-4, villas wrote: Just a thought - does db.commit() help? Rgds, D On Monday, August 27, 2012 3:37:45 PM UTC+1, Yarin wrote: Once we call a stored procedure through the DAL, any subsequent DAL calls

[web2py] Re: DAL calls fail after first stored procedure call

2012-08-27 Thread Yarin
another else but pass your SQL to the driver and fetch responses. Is this SQLITE? In any case, I suggest you try the native driver APIs. On Monday, 27 August 2012 09:37:45 UTC-5, Yarin wrote: Once we call a stored procedure through the DAL, any subsequent DAL calls are returning None results

[web2py] Re: DAL calls fail after first stored procedure call

2012-08-27 Thread Yarin
. Massimo On Monday, 27 August 2012 14:20:00 UTC-5, Yarin wrote: This is MySQL using the default driver, whatever that is. I'm going to test on other drivers/dbs and will report back.. On Monday, August 27, 2012 3:03:15 PM UTC-4, Massimo Di Pierro wrote: I do not think this is a DAL issue

[web2py] Re: DAL calls fail after first stored procedure call

2012-08-27 Thread Yarin
:37:42 PM UTC-4, Yarin wrote: This is an issue with pymsql: http://code.google.com/p/pymysql/issues/detail?id=72, https://github.com/petehunt/PyMySQL/blob/master/pymysql/cursors.py Running against pymysql's api directly, I can execute sproc calls on on two different connections

Re: [web2py] Re: Defining stored procedures

2012-08-26 Thread Yarin Kessler
+1 On Sun, Aug 26, 2012 at 8:55 PM, Andrew awillima...@gmail.com wrote: Thanks Anthony, Wasn't aware of that one, and it looks quite useful. On Monday, August 27, 2012 6:29:55 AM UTC+12, Anthony wrote: Often wondered about this too. You would also have to call them with executesql.

[web2py] DAL not returning results on temp table query

2012-08-25 Thread Yarin
I'm trying to execute some SQL from the DAL that relies on a temp table: CREATE TEMPORARY TABLE tmp LIKE people; INSERT INTO tmp SELECT * FROM people; INSERT INTO tmp SELECT * FROM people; SELECT * FROM tmp; This code works fine in a SQL panel, but fails when used in the DAL: def test():

[web2py] Re: DAL not returning results on temp table query

2012-08-25 Thread Yarin
) in your executesql() wrapped string you'll be fine. If some of your lines returns results, then the driver doesn't know what set to actually return. Anyway splitting those lines in multiple db.executesql()s is working great. On Saturday, August 25, 2012 5:58:40 PM UTC+2, Yarin wrote: I'm

Re: [web2py] Re: DAL not returning results on temp table query

2012-08-25 Thread Yarin Kessler
to actually return. Anyway splitting those lines in multiple db.executesql()s is working great. On Saturday, August 25, 2012 5:58:40 PM UTC+2, Yarin wrote: I'm trying to execute some SQL from the DAL that relies on a temp table: CREATE TEMPORARY TABLE tmp LIKE people; INSERT INTO tmp SELECT

[web2py] Defining stored procedures

2012-08-25 Thread Yarin
I'm assuming there's probably no support for defining stored procedures using DAL functions. Instead I was going to try to create them in raw sql using executesql whenever migrate was turned on. Just wondering if this is the best technique, or someone has another idea --

Re: [web2py] Re: Defining stored procedures

2012-08-25 Thread Yarin Kessler
On Saturday, August 25, 2012 5:56:10 PM UTC-4, Yarin wrote: I'm assuming there's probably no support for defining stored procedures using DAL functions. Instead I was going to try to create them in raw sql using executesql whenever migrate was turned on. Just wondering if this is the best

[web2py] Clearing session for single user

2012-08-21 Thread Yarin
Is it possible to clear a session for a single user? Currently, if we need to block user access, we must delete the user record or set registration key = blocked, and then clear session for the entire site. Is there a better way? --

Re: [web2py] Clearing session for single user

2012-08-21 Thread Yarin
of the box if you opt for it), you can delete entry of user from it to disconnect him instantly, without affecting other users. this table has a name like : web2py_session_YourApplicationName Regards On Tue, Aug 21, 2012 at 6:22 PM, Yarin ykes...@gmail.com javascript:wrote: Is it possible to clear

[web2py] Re: Clearing session for single user

2012-08-21 Thread Yarin
registered user can have multiple sessions (one in chrome, the other in firefox), even in multiple devices (desktop, nettop, tablet, cell phone, etc) and they are considered (rightfully) valid. On Tuesday, August 21, 2012 7:22:42 PM UTC+2, Yarin wrote: Is it possible to clear a session

[web2py] Clarification on using classes in models

2012-08-20 Thread Yarin
In this posthttps://groups.google.com/forum/#!topic/web2py/dmN54cpMuXo%5B1-25%5D Massimo says: One should not define classes in Models and Controllers. I have issued that warning already to our users... On the other hand, in this

Re: [web2py] Clarification on using classes in models

2012-08-20 Thread Yarin
as the original link Yarin posted. Anthony On Monday, August 20, 2012 3:12:57 PM UTC-4, rochacbruno wrote: You can define classes on models or controllers, the only caveat is that you can never import that classes in to other modules. They will be defined and will be available

[web2py] Rendering views manually

2012-08-20 Thread Yarin
Im trying to follow the example given herehttps://groups.google.com/forum/?fromgroups=#!topic/web2py/yBBhvADGGB4%5B1-25%5Dfor manually rendering views. I have this code in my controller: def index(): global my_var my_var = something content = '''htmlbodyh1My Page/h1p {{=my_var}}

Re: [web2py] Rendering views manually

2012-08-20 Thread Yarin
wow im an idiot.. thanks On Monday, August 20, 2012 5:27:59 PM UTC-4, ian douglas wrote: On 08/20/2012 02:17 PM, Yarin wrote: def index(): global my_var my_var = something content = '''htmlbodyh1My Page/h1p {{=my_var}} {{=request.raw_args}} /body/html''' output

  1   2   3   >