[web2py] web2py ldap integration. ldap bind

2017-02-22 Thread Cory
Hi,

does anyone know how to make login credentials case sensitive when using 
LDAP authentication?  simple_bind_s(username, password) ignores case 
sensitivity for both username and password. 

thanks!

-Cory   

-- 
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] DB2 connection SQL1531

2016-06-01 Thread Cory
hello all, 
I am having trouble connecting to my company's DB2 via web2py. 
when I try to connect I get SQL1531N error "The connection failed because 
the name specified with the DSN connection string keyword could not be 
found in either the db2dsdriver.cfg configuration file or the db2cli.ini". 
I have followed this forum post 
http://ochiba77.blogspot.com/2011/09/how-to-connect-db2-with-python-pyodbc.html?_sm_au_=iVVbf50bnkSqvNSN
 
and am using database string DAL(db2:ibm_db_dbo://DSN=;UID=;PWD=;)

does anyone know if I am supposed to edit db2dsdriver.cfg to get this to 
work? or does anyone see anything blatantly wrong with my approach?


thanks for you time

-cory 

-- 
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] 'NoneType' object is not callable

2015-02-27 Thread Cory
Hi,

I am having trouble logging into my website because of a 'Nonetype' not 
callable error. More specifically, I believe I am getting the error from 
current.sesssion.renew because it is None. The traceback is below. I have 
emptied the sessions folder and cleared my cookies on my browser to see if 
it is connected, but no luck. 

-

Traceback (most recent call last):
  File "/var/www/web2py/gluon/restricted.py", line 212, in restricted
exec ccode in environment
  File "/var/www/web2py/applications/init/controllers/default.py" 
, line 
2587, in 
  File "/var/www/web2py/gluon/globals.py", line 194, in 
self._caller = lambda f: f()
  File "/var/www/web2py/applications/init/controllers/default.py" 
, line 
1854, in menu_login
user = auth.login_bare(login_form.vars.email, login_form.vars.password)
  File "/var/www/web2py/gluon/tools.py", line 2159, in login_bare
self.login_user(user)
  File "/var/www/web2py/gluon/tools.py", line 2128, in login_user
current.session.renew(clear_session=not self.settings.keep_session_onlogin)
TypeError: 'NoneType' object is not callable

-


Originally my problem was 'Formstyle not supported', but I fixed that by 
doing auth.settings.formstyle='bootstrap'. Does anyone know if this is 
connected with the above error? I have been trying to solve this problem 
all day. Any help would be appreciated. 


-- 
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: web2py usage monitor with slow web2py vs fast web2py

2014-09-30 Thread Cory
Thanks for the response! I will be looking at both of those tonight and 
seeing what comes up. I will update the post accordingly,


On Tuesday, September 30, 2014 4:20:32 PM UTC-7, PN wrote:
>
> Are the SLOW version and FAST version different web2py applications (i.e. 
> the code under web2py/applications/project_name is different)? If so, the 
> difference in speed is likely coming from what processes each app is 
> running on call.
>
> Some places to look at -- try to identify which page is the slowest in the 
> slow app, then use {{=response.toolbar()}} in the view, it will show you a 
> toolbar that shows database stats and how long and how many queries ran. 
> This will give you an idea. Usually slowness is from database lookups 
> (either a big data lookup, or many small lookups adding up). If db is not 
> the issue, look up 'profiling' for your IDE, it will let you see how much 
> time is being spent in various python processes.
>
> On Tuesday, September 30, 2014 5:34:31 PM UTC-4, Cory wrote:
>>
>>
>> Hey, does anyone know why my usage is the way it is? for instance, in the 
>> picture below (slow version) everything is in increments with a  gap in 
>> between each spike. This happens while under both heavy load and idle. My 
>> web2py is so slow its unusable. When I use web2py with a different project 
>> it does not display my usage in the same way (without consistent gaps 
>> between each spike, see fast version) and is very fast. Any ideas what 
>> could cause this? 
>>
>> *SLOW version*
>>
>>
>> <https://lh6.googleusercontent.com/-tg_x476D_Qw/VCsaVoNoouI/AnI/qbVJcAZhm_U/s1600/Screenshot%2B-%2B09302014%2B-%2B01%3A58%3A23%2BPM.png>
>>
>> *FAST version*
>>
>> <https://lh6.googleusercontent.com/-tg_x476D_Qw/VCsaVoNoouI/AnI/qbVJcAZhm_U/s1600/Screenshot%2B-%2B09302014%2B-%2B01%3A58%3A23%2BPM.png>
>>
>>
>> <https://lh6.googleusercontent.com/-tg_x476D_Qw/VCsaVoNoouI/AnI/qbVJcAZhm_U/s1600/Screenshot%2B-%2B09302014%2B-%2B01%3A58%3A23%2BPM.png>
>>  
>> <https://lh6.googleusercontent.com/-5hLsx84T-6w/VCsggrzo3oI/AnU/idYHzLKjFrs/s1600/fast.png>
>>
>>
>>  
>>
>

-- 
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] web2py usage monitor with slow web2py vs fast web2py

2014-09-30 Thread Cory


Hey, does anyone know why my usage is the way it is? for instance, in the 
picture below (slow version) everything is in increments with a  gap in 
between each spike. This happens while under both heavy load and idle. My 
web2py is so slow its unusable. When I use web2py with a different project 
it does not display my usage in the same way (without consistent gaps 
between each spike, see fast version) and is very fast. Any ideas what 
could cause this? 

*SLOW version*



*FAST version*



 



 

-- 
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: formstyle not supported

2014-09-30 Thread Cory
Problem fixed. it was a change from within sqlform.py in the gluon folder

On Tuesday, September 30, 2014 9:55:48 AM UTC-7, Cory wrote:
>
> Hello,
> has anyone seen this error before? if so, can you please tell me what it 
> may be related to? 
> I received this error when I cloned my project on a new computer. When I 
> try to start web2py
> on any of my apps it gives me this error. 
>
> I was running web2py version *2.9.5 *and now its *2.9.11*
>
> thanks!
>
>
> <https://lh3.googleusercontent.com/-ON9ciRO6S0o/VCr3EFEk-mI/Am4/h_qZ31e_OSM/s1600/Screenshot%2B-%2B09302014%2B-%2B11%3A22%3A33%2BAM.png>
>
>  formstyle not supported
>
> Traceback (most recent call last):
>   File "/home/cory/web2py/gluon/restricted.py", line 224, in restricted
> exec ccode in environment
>   File "/home/cory/web2py/applications/zoomit/controllers/default.py", 
> line 1535, in 
>   File "/home/cory/web2py/gluon/globals.py", line 392, in 
> self._caller = lambda f: f()
>   File "/home/cory/web2py/applications/zoomit/controllers/default.py", 
> line 955, in index
> Field('weight', 'integer', requires=IS_NOT_EMPTY()),
>   File "/home/cory/web2py/gluon/sqlhtml.py", line 1730, in factory
> **attributes)
>   File "/home/cory/web2py/gluon/sqlhtml.py", line 1324, in __init__
> table = self.createform(xfields)
>   File "/home/cory/web2py/gluon/sqlhtml.py", line 1354, in createform
> raise RuntimeError('formstyle not supported')
> RuntimeError: formstyle not supported
>
>
> *Here is another traceback from admin app which breaks in a different spot 
> along with my other apps*
>
> Traceback (most recent call last):
>   File "/home/cory/web2py/gluon/restricted.py", line 224, in restricted
> exec ccode in environment
>   File "/home/cory/web2py/applications/admin/controllers/default.py", line 
> 1946, in 
>   File "/home/cory/web2py/gluon/globals.py", line 392, in 
> self._caller = lambda f: f()
>   File "/home/cory/web2py/applications/admin/controllers/default.py", line 
> 221, in site
> table_name='appcreate')
>   File "/home/cory/web2py/gluon/sqlhtml.py", line 1730, in factory
> **attributes)
>   File "/home/cory/web2py/gluon/sqlhtml.py", line 1324, in __init__
> table = self.createform(xfields)
>   File "/home/cory/web2py/gluon/sqlhtml.py", line 1354, in createform
> raise RuntimeError('formstyle not supported')
> RuntimeError: formstyle not supported
>
>
>

-- 
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: formstyle not supported

2014-09-30 Thread Cory
y Anthony, I updated with some code and the versions. current is 9.11 and 
old was 9.6.  

On Tuesday, September 30, 2014 10:28:06 AM UTC-7, Anthony wrote:
>
> Can you show your code? What version of web2py were you running, and what 
> version are you running now?
>
> On Tuesday, September 30, 2014 12:55:48 PM UTC-4, Cory wrote:
>>
>> Hello,
>> has anyone seen this error before? if so, can you please tell me what it 
>> may be related to? 
>> I received this error when I cloned my project on a new computer. When I 
>> try to start web2py
>> on any of my apps it gives me this error. 
>>
>> thanks!
>>
>>  formstyle not supported
>>
>> Traceback (most recent call last):
>>   File "/home/cory/web2py/gluon/restricted.py", line 224, in restricted
>> exec ccode in environment
>>   File "/home/cory/web2py/applications/zoomit/controllers/default.py", 
>> line 1535, in 
>>   File "/home/cory/web2py/gluon/globals.py", line 392, in 
>> self._caller = lambda f: f()
>>   File "/home/cory/web2py/applications/zoomit/controllers/default.py", 
>> line 955, in index
>> Field('weight', 'integer', requires=IS_NOT_EMPTY()),
>>   File "/home/cory/web2py/gluon/sqlhtml.py", line 1730, in factory
>> **attributes)
>>   File "/home/cory/web2py/gluon/sqlhtml.py", line 1324, in __init__
>> table = self.createform(xfields)
>>   File "/home/cory/web2py/gluon/sqlhtml.py", line 1354, in createform
>> raise RuntimeError('formstyle not supported')
>> RuntimeError: formstyle not supported
>>
>

-- 
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] formstyle not supported

2014-09-30 Thread Cory
Hello,
has anyone seen this error before? if so, can you please tell me what it 
may be related to? 
I received this error when I cloned my project on a new computer. When I 
try to start web2py
on any of my apps it gives me this error. 

thanks!

 formstyle not supported

-- 
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] accessing tables using web2py scheduler

2014-06-25 Thread cory bekker
ah yes, you got me to think differently about the problem.  Thanks Nophlod, I 
will try a different approach. 

On Jun 25, 2014, at 8:57 AM, Niphlod  wrote:

> ok, the question at this point is really, what you'd expect "auth.user_id" to 
> be assumed as a value when you run inside a queued task on the scheduler
> 
> 
> On Wednesday, June 25, 2014 5:55:48 PM UTC+2, Cory wrote:
> Here is a better example of what I mean. 
> 
> in controller:
> 
> @auth.requires_login()  
> def foo():
>   row = db(db.mytable.id == auth.user_id).select().first()
>   return dict()
> 
> in scheduler.py 
> 
> def sched_function():
>   row = db(db.mytable.id == auth.user_id).select().first()
>   return dict()
> 
> 
> I am unable to fetch a row doing the same syntax in my scheduler function.
> It returns an empty row. I also tried to include "@auth.requires_login"  but
> it doesn't seem to work. 
> 
> sorry for the miscomunnication
>   
> 
> 
> On Jun 25, 2014, at 7:52 AM, Niphlod  wrote:
> 
>> there's no such thing (conceptually) as "tables that exists only if the user 
>> is logged in".
>> the concept is "a user logged in can read/update/delete/etc some tables". 
>> That's what you do in "controllers". 
>> tables are "defined" (not accessed) instead in "models", so are available to 
>> everybody, scheduler included.
>> 
>> On Wednesday, June 25, 2014 4:46:42 PM UTC+2, Cory wrote:
>> I am trying to access tables that require the user to be logged in.  Am I 
>> able to access these tables within my scheduler functions? 
>> 
>> 
>> On Wed, Jun 25, 2014 at 2:55 AM, Niphlod  wrote:
>> 
>> why on hearth should you define tables based on the fact that a user is 
>> logged-in or not ?
>> Scheduler functions are executed in a world that does not care for the usual 
>> request/response/session environment, and surely they do no count to be 
>> "logged in"...  
>> 
>> On Wednesday, June 25, 2014 12:53:57 AM UTC+2, Cory wrote:
>> Hi,
>> I am trying to access tables within my scheduler function. The tables I am 
>> trying to access require "@auth.requires_login()".
>> Am I able to access these tables within my scheduler.py model file? right 
>> now I am passing table row fields as parameters
>> to the scheduler function and it is very messy. 
>> In scheduler.py I have tried to include:
>> 
>> db = DAL("postgres://postgres..blah)
>> from gluon.tools import Auth
>> auth = Auth(db)
>> 
>> if auth.is_logged_in():
>> 
>> 
>> thanks!
>> 
>> 
>> 
>> -- 
>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/_-MWC1WrOkY/unsubscribe.
>> To unsubscribe from this group and all its topics, 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/_-MWC1WrOkY/unsubscribe.
>> To unsubscribe from this group and all its topics, 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 a topic in the Google 
> Groups "web2py-users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/web2py/_-MWC1WrOkY/unsubscribe.
> To unsubscribe from this group and all its topics, 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.


Re: [web2py] Re: accessing tables using web2py scheduler

2014-06-25 Thread cory bekker
Here is a better example of what I mean. 

in controller:

@auth.requires_login()  
def foo():
row = db(db.mytable.id == auth.user_id).select().first()
return dict()

in scheduler.py 

def sched_function():
row = db(db.mytable.id == auth.user_id).select().first()
return dict()


I am unable to fetch a row doing the same syntax in my scheduler function.
It returns an empty row. I also tried to include "@auth.requires_login"  but
it doesn't seem to work. 

sorry for the miscomunnication



On Jun 25, 2014, at 7:52 AM, Niphlod  wrote:

> there's no such thing (conceptually) as "tables that exists only if the user 
> is logged in".
> the concept is "a user logged in can read/update/delete/etc some tables". 
> That's what you do in "controllers". 
> tables are "defined" (not accessed) instead in "models", so are available to 
> everybody, scheduler included.
> 
> On Wednesday, June 25, 2014 4:46:42 PM UTC+2, Cory wrote:
> I am trying to access tables that require the user to be logged in.  Am I 
> able to access these tables within my scheduler functions? 
> 
> 
> On Wed, Jun 25, 2014 at 2:55 AM, Niphlod  wrote:
> 
> why on hearth should you define tables based on the fact that a user is 
> logged-in or not ?
> Scheduler functions are executed in a world that does not care for the usual 
> request/response/session environment, and surely they do no count to be 
> "logged in"...  
> 
> On Wednesday, June 25, 2014 12:53:57 AM UTC+2, Cory wrote:
> Hi,
> I am trying to access tables within my scheduler function. The tables I am 
> trying to access require "@auth.requires_login()".
> Am I able to access these tables within my scheduler.py model file? right now 
> I am passing table row fields as parameters
> to the scheduler function and it is very messy. 
> In scheduler.py I have tried to include:
> 
> db = DAL("postgres://postgres..blah)
> from gluon.tools import Auth
> auth = Auth(db)
> 
> if auth.is_logged_in():
> 
> 
> thanks!
> 
> 
> 
> -- 
> 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 a topic in the Google 
> Groups "web2py-users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/web2py/_-MWC1WrOkY/unsubscribe.
> To unsubscribe from this group and all its topics, 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 a topic in the Google 
> Groups "web2py-users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/web2py/_-MWC1WrOkY/unsubscribe.
> To unsubscribe from this group and all its topics, 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: accessing tables using web2py scheduler

2014-06-25 Thread Cory Bekker
I am trying to access tables that require the user to be logged in.  Am I able to access these tables within my scheduler functions? 
On Wed, Jun 25, 2014 at 2:55 AM, Niphlod <niph...@gmail.com> wrote:why on hearth should you define tables based on the fact that a user is logged-in or not ?Scheduler functions are executed in a world that does not care for the usual request/response/session environment, and surely they do no count to be "logged in"...  On Wednesday, June 25, 2014 12:53:57 AM UTC+2, Cory wrote:Hi,I am trying to access tables within my scheduler function. The tables I am trying to access require "@auth.requires_login()".Am I able to access these tables within my scheduler.py model file? right now I am passing table row fields as parametersto the scheduler function and it is very messy. In scheduler.py I have tried to include:db = DAL("postgres://postgres..blah)from gluon.tools import Authauth = Auth(db)if auth.is_logged_in():thanks!



-- 
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/_-MWC1WrOkY/unsubscribe.
To unsubscribe from this group and all its topics, 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] accessing tables using web2py scheduler

2014-06-24 Thread Cory
Hi,
I am trying to access tables within my scheduler function. The tables I am 
trying to access require "@auth.requires_login()".
*Am I able to access these tables within my scheduler.py model file?* right 
now I am passing table row fields as parameters
to the scheduler function and it is very messy. 
In scheduler.py I have tried to include:

db = DAL("postgres://postgres..blah)
from gluon.tools import Auth
auth = Auth(db)

if auth.is_logged_in():


thanks!


-- 
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: getting run_result from web2py scheduler

2014-05-28 Thread Cory
Thanks Niphlod and good point. I am using it with LOAD() so im still 
maintaining async, I just need to know when its ready. This helped a lot, I 
did not try db.commit before and did not realize. Thanks again! 

On Wednesday, May 28, 2014 1:23:16 PM UTC-7, Niphlod wrote:
>
> Hi.
> There must be something wrong with what you expect.
> The scheduler is an ASYNC process, meaning that - usually - trying to 
> fetch the result in the same request that queued it is a wrong idea in so 
> many ways that should be obvious.
> That being said, this works without any issues.
>
> models/scheduler.py
> def add(a,b):
> return a + b
>
> from gluon.scheduler import Scheduler
> mysched = Scheduler(db)
>
> controllers/default.py
>
> def index():
> thetask = mysched.queue_task('add', pargs=[3,4])
> db.commit() #otherwise the scheduler process can't see it
> result = None
> task_id = None
> while 1:
> intermediate = mysched.task_status(thetask.uuid, output=True)
> if intermediate.result:
> result = intermediate.result
> task_id = thetask.uuid
> break
> time.sleep(1)
> return dict(res=result, task_id=task_id)
>
> On Wednesday, May 28, 2014 5:55:20 PM UTC+2, Cory wrote:
>>
>> Hi,
>> I am having trouble getting the run_result after  web2py has finished a 
>> task using web2py's scheduler. 
>> The code below is what I am using. The trouble I am having is grabbing 
>> the result once the result is 
>> ready. Do any of you know how to get the run_result from a task once the 
>> task has finished? right now
>> when I try to get the run_result I get a "None" value because I try to 
>> get the result before it is ready.
>> The task can take a couple of seconds to finish. I have tried many 
>> different ways to get the result once
>> it is ready. For instance, creating a while loop that checks to see if 
>> the task status has changed to 
>> "completed" then grab the result, but that does not work. Any ideas? I 
>> have been stuck on this far too long.
>>
>> task2 = sched.queue_task('upsQuote', pargs = [session.Weight, 
>> session.OrigZip, session.DestZip], timeout = 5, start_time = request.now)   
>>  #add the task 
>> task_status2  = sched.task_status(task2.uuid, output=True)# 
>> get the task status 
>> result2 = task_status2.scheduler_run.run_result   
>># get the result from the finished task 
>>
>>
>>

-- 
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] getting run_result from web2py scheduler

2014-05-28 Thread Cory
Hi,
I am having trouble getting the run_result after  web2py has finished a 
task using web2py's scheduler. 
The code below is what I am using. The trouble I am having is grabbing the 
result once the result is 
ready. Do any of you know how to get the run_result from a task once the 
task has finished? right now
when I try to get the run_result I get a "None" value because I try to get 
the result before it is ready.
The task can take a couple of seconds to finish. I have tried many 
different ways to get the result once
it is ready. For instance, creating a while loop that checks to see if the 
task status has changed to 
"completed" then grab the result, but that does not work. Any ideas? I have 
been stuck on this far too long.

task2 = sched.queue_task('upsQuote', pargs = [session.Weight, 
session.OrigZip, session.DestZip], timeout = 5, start_time = request.now)   
 #add the task 
task_status2  = sched.task_status(task2.uuid, output=True)# get 
the task status 
result2 = task_status2.scheduler_run.run_result 
 # get the result from the finished task 


-- 
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] Post Request Timeout

2014-05-23 Thread Cory
Hi,
I have a url that is supposed to receive a post request that contains xml. 
This post request is a callback from an api. 
For some reason the post request cannot connect to the url I have 
specified. The view that is supposed to 
receive the request only contains 

fieldKeys = []
if request.post_vars:
for value in request.post_vars:
fieldKeys.append(value)
if fieldKeys[0]:
db.test_post.insert(field1 = fieldKeys[0])

I just do this for testing purposes to see if I receive the post at all. 
when I make a post request to myself I end up getting the 
post variables fine.

Does anyone know any possible reasons on why a post 
request from a 3rd party would not connect to a valid
url with the above code?

thanks 

-- 
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] Post Request Data

2014-05-22 Thread Cory


On Wednesday, May 21, 2014 6:35:31 AM UTC-7, marco mansilla wrote:
>
> El Tue, 20 May 2014 15:27:29 -0700 (PDT) 
> Cory > escribió: 
>
> > Hi, 
> > I am trying to access the contents of a post request made to a url on 
> > my website. 
> > To test this I have been trying to send post requests to a url on my 
> > website to see I if am able to get the data from the post. 
> > Does anyone know how I can access the post data? am I accessing it 
> > correctly by using "request.vars"?   
> > thanks!   
> > 
> > def post_sender(): 
> > requests.post(url,data) 
> > 
> > def post_receiver(): 
> > if request.vars: 
> >do stuff with data 
> > 
> > 
> > 
>
> something like: 
>
> def post_sender(): 
> redirect(URL('youController','post_receiver', 
> vars=dict(myvar="someValue"))) 
>
> return dict() 
>
> def post_receiver(): 
> if request.vars.myvar: 
> do stuff with data 
>
> that's pretty much it. 
>
> Marco. 
>

thanks for the response,

 I have tried to do the above code, but I am unable to access or view the 
data from the post request. I think this is because every time I reload the 
receiving url to see if I can post the data to the view it starts a new 
session? and gets rid of the post variables that it received? 

Does anyone know how I can view the data using the above pseudo code 

-- 
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] Post Request Data

2014-05-21 Thread Cory
Hi,
I am trying to access the contents of a post request made to a url on my 
website. 
To test this I have been trying to send post requests to a url on my 
website to see I if am able to get the data from the post.
Does anyone know how I can access the post data? am I accessing it correctly
by using "request.vars"?  
thanks!  

def post_sender():
requests.post(url,data)

def post_receiver():
if request.vars:
   do stuff with data



-- 
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 Receive Post requests?

2014-05-20 Thread Cory Bekker
Hi,
I am using rightSignature API which allows websites to do embedded pdf 
signing. I am having trouble figuring out how to receive POST requests from 
RighSignature. RightSignature sends POST requests to a url (which I 
specify) every time the status of a document changes. 

My question is... how do I receive POST requests from an outside source?
Right now I have created a blank view so I can use its url for the post 
request. 

I have looked into 

request.post_vars
and 
request.body.read()

I have made no progress with either. 

thanks



-- 
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: SQLFORM.factory Field2 depends on Field1

2012-04-28 Thread cory n
Yeah, I thought it would have to be a little complicated, I was hoping 
there was an easy way out.

Any how, I got it working and will post it as a slice next week.  Thank you 
gentlemen.

Cory

On Friday, April 27, 2012 1:44:58 PM UTC-5, Anthony wrote:
>
> See 
> http://stackoverflow.com/questions/8146260/best-practice-for-populating-dropdown-based-on-other-dropdown-selection-in-web2p/8152910#8152910
> .
>
> On Friday, April 27, 2012 11:00:44 AM UTC-4, cory n wrote:
>>
>> This works, after I submit once, then my selection for FIELD1 appears in 
>> FIELD2.  I need it to operate before a submit though, so that once a 
>> "Segment" is selected, I can use that selection in the other dropdown boxes 
>> before a submit.
>>
>> Thanks
>>
>> Cory
>>
>> On Friday, April 27, 2012 8:13:58 AM UTC-5, Massimo Di Pierro wrote:
>>>
>>> IS_IN_SET(getFamilies(form.vars.Segment
>>>
>>> should be
>>>
>>> IS_IN_SET(getFamilies(request.vars.Segment
>>>
>>> but I would not set this validator in models, I would set it in 
>>> controller function, where needed.
>>>
>>> On Thursday, 26 April 2012 12:54:26 UTC-5, cory n wrote:
>>>>
>>>> Okay, I want to make the second field of a SQLFORM.factory depend on 
>>>> what is chosen in the first field...  something like this...
>>>>
>>>> form = SQLFORM.factory(
>>>> Field('PN', requires=IS_NOT_EMPTY()),
>>>> Field('Segment', requires=IS_IN_SET(['Segment1', 'Segment2'])),
>>>> Field('Family', 
>>>> requires=IS_IN_SET(getFamilies(form.vars.Segment
>>>> ...
>>>>
>>>> Of course I can't use form.vars.Segment until the form is submitted, so 
>>>> how can I accomplish this?
>>>>
>>>> So that the field 'Family' takes the value of the field 'Segment', does 
>>>> a calculation and returns the appropriate list of families.
>>>>
>>>> I'm super new to web programming, so I apologize in advance if this is 
>>>> a dumb question.
>>>>
>>>>
>>>>
>>>>
>>>>
>>> On Thursday, 26 April 2012 12:54:26 UTC-5, cory n wrote:
>>>>
>>>> Okay, I want to make the second field of a SQLFORM.factory depend on 
>>>> what is chosen in the first field...  something like this...
>>>>
>>>> form = SQLFORM.factory(
>>>> Field('PN', requires=IS_NOT_EMPTY()),
>>>> Field('Segment', requires=IS_IN_SET(['Segment1', 'Segment2'])),
>>>> Field('Family', 
>>>> requires=IS_IN_SET(getFamilies(form.vars.Segment
>>>> ...
>>>>
>>>> Of course I can't use form.vars.Segment until the form is submitted, so 
>>>> how can I accomplish this?
>>>>
>>>> So that the field 'Family' takes the value of the field 'Segment', does 
>>>> a calculation and returns the appropriate list of families.
>>>>
>>>> I'm super new to web programming, so I apologize in advance if this is 
>>>> a dumb question.
>>>>
>>>>
>>>>
>>>>
>>>>

[web2py] Re: SQLFORM.factory Field2 depends on Field1

2012-04-27 Thread cory n
This works, after I submit once, then my selection for FIELD1 appears in 
FIELD2.  I need it to operate before a submit though, so that once a 
"Segment" is selected, I can use that selection in the other dropdown boxes 
before a submit.

Thanks

Cory

On Friday, April 27, 2012 8:13:58 AM UTC-5, Massimo Di Pierro wrote:
>
> IS_IN_SET(getFamilies(form.vars.Segment
>
> should be
>
> IS_IN_SET(getFamilies(request.vars.Segment
>
> but I would not set this validator in models, I would set it in controller 
> function, where needed.
>
> On Thursday, 26 April 2012 12:54:26 UTC-5, cory n wrote:
>>
>> Okay, I want to make the second field of a SQLFORM.factory depend on what 
>> is chosen in the first field...  something like this...
>>
>> form = SQLFORM.factory(
>> Field('PN', requires=IS_NOT_EMPTY()),
>> Field('Segment', requires=IS_IN_SET(['Segment1', 'Segment2'])),
>> Field('Family', 
>> requires=IS_IN_SET(getFamilies(form.vars.Segment
>> ...
>>
>> Of course I can't use form.vars.Segment until the form is submitted, so 
>> how can I accomplish this?
>>
>> So that the field 'Family' takes the value of the field 'Segment', does a 
>> calculation and returns the appropriate list of families.
>>
>> I'm super new to web programming, so I apologize in advance if this is a 
>> dumb question.
>>
>>
>>
>>
>>
> On Thursday, 26 April 2012 12:54:26 UTC-5, cory n wrote:
>>
>> Okay, I want to make the second field of a SQLFORM.factory depend on what 
>> is chosen in the first field...  something like this...
>>
>> form = SQLFORM.factory(
>> Field('PN', requires=IS_NOT_EMPTY()),
>> Field('Segment', requires=IS_IN_SET(['Segment1', 'Segment2'])),
>> Field('Family', 
>> requires=IS_IN_SET(getFamilies(form.vars.Segment
>> ...
>>
>> Of course I can't use form.vars.Segment until the form is submitted, so 
>> how can I accomplish this?
>>
>> So that the field 'Family' takes the value of the field 'Segment', does a 
>> calculation and returns the appropriate list of families.
>>
>> I'm super new to web programming, so I apologize in advance if this is a 
>> dumb question.
>>
>>
>>
>>
>>

[web2py] SQLFORM.factory Field2 depends on Field1

2012-04-26 Thread cory n
Okay, I want to make the second field of a SQLFORM.factory depend on what 
is chosen in the first field...  something like this...

form = SQLFORM.factory(
Field('PN', requires=IS_NOT_EMPTY()),
Field('Segment', requires=IS_IN_SET(['Segment1', 'Segment2'])),
Field('Family', requires=IS_IN_SET(getFamilies(form.vars.Segment
...

Of course I can't use form.vars.Segment until the form is submitted, so how 
can I accomplish this?

So that the field 'Family' takes the value of the field 'Segment', does a 
calculation and returns the appropriate list of families.

I'm super new to web programming, so I apologize in advance if this is a 
dumb question.






[web2py] Re: python 2.4 - last supported version

2011-10-18 Thread Cory Coager
Thank you both, version 1.95.1 seems to be working so far on python
2.4.


[web2py] python 2.4 - last supported version

2011-10-18 Thread Cory Coager
Could you tell me the last release of web2py that supported python 2.4
and where I can download it?  The new version of web2py obviously
don't support it and don't work either.


[web2py] Re: table without id

2011-10-12 Thread Cory Coager
Thanks both.  I ended up adding an id field to the tables.


[web2py] table without id

2011-10-11 Thread Cory Coager
I have created some database tables externally to web2py.  Does web2py
require an id field for tables?  The reason why I'm asking is, when I
use the DAL to do an insert, web2py tries to retrieve the currval of
the insert.  Seeing how I don't have an id, this throws an exception.
How should I handle this?


[web2py] Re: existing database, can't migrate

2011-07-29 Thread Cory Coager
That worked, thank you!

On Jul 29, 9:25 am, Richard G  wrote:
> Sorry, the id type declaration should be in quotes:
>
> db.define_table('test',
>  Field('test_id', 'id'),
>  Field('name'),
> migrate=False, fake_migrate=True)


[web2py] existing database, can't migrate

2011-07-29 Thread Cory Coager
I designed and setup a database that was created directly in Postgres,
not web2py.  When attempting to view the database administration tool
in web2py it gives me constant errors:


Jul 29 07:32:38 postgres postgres[11459]: [6-1] 2011-07-29 07:32:38
EDT testdb postgres 192.168.148.68 WARNING:  there is already a
transaction in progress
Jul 29 07:32:38 postgres postgres[11459]: [7-1] 2011-07-29 07:32:38
EDT testdb postgres 192.168.148.68 ERROR:  column test.id does not
exist at character 36
Jul 29 07:32:38 postgres postgres[11459]: [7-2] 2011-07-29 07:32:38
EDT testdb postgres 192.168.148.68 STATEMENT:  SELECT count(*) FROM
test WHERE (test.id > 0)

Here is the SQL used to create it:

create table test (
test_id integer primary key default nextval('test_id_seq'),
name varchar(100)
);

Here is the definition in models/db.py

db.define_table('test', Field('test_id'), Field('name'),
migrate=False, fake_migrate=True)

As you can see, there is no 'id' field.  Is this a requirement?
Everytime I bring up the database administration tool it is trying to
select field 'id'.  If I change the field the select still fails.
I've tried every variation of migrate, fake_migrate without luck.

Can someone assist?


[web2py] error with mod_wsgi on shared host

2011-01-19 Thread Cory Coager
This is a new setup of web2py using mod_wsgi on a shared host.  Any
idea what is wrong?

.htaccess:
SetHandler wsgi-script
Options +ExecCGI
RewriteEngine On
RewriteRule ^((static|auth|admin|mycontroller).*)$ /wsgihandler.py/
myapp/$1 [QSA,PT,L]

Error logs:
[Wed Jan 19 17:52:06 2011] [error] [client 127.0.0.1]   File "/home/
user/gluon/utils.py", line 10, in ?
[Wed Jan 19 17:52:06 2011] [error] [client 127.0.0.1]   File "/home/
user/restricted.py", line 18, in ?
[Wed Jan 19 17:52:06 2011] [error] [client 127.0.0.1]   File "/home/
user/gluon/main.py", line 32, in ?
[Wed Jan 19 17:52:06 2011] [error] [client 127.0.0.1]   File "/home/
user/wsgihandler.py", line 27, in ?
[Wed Jan 19 17:52:06 2011] [error] [client 127.0.0.1] mod_wsgi
(pid=4975): Exception occurred processing WSGI script '/home/user/
wsgihandler.py'.
[Wed Jan 19 17:52:06 2011] [error] [client 127.0.0.1] mod_wsgi
(pid=4975): Target WSGI script '/home/user/wsgihandler.py' cannot be
loaded as Python module.


[web2py] Re: dashes in controller names?

2010-08-30 Thread Cory Coager
You're 100% correct.  However, since the functionality is lacking I
would use this as a workaround for SEO.

On Aug 30, 3:37 pm, Kevin  wrote:
> That last point of yours is why I feel the way I do: the slug is
> redundant.  Then again, I'm not the kind of programmer to put SEO
> ahead of cleanliness.
>
> For example, if the original URL were:
>
> http://myblog.com/articles/5/net-neutrality-and-you
>
> Then I'd expect the following URL to fail:
>
> http://myblog.com/articles/5/nothing-here
>
> (However, it would return a 200 status code with the same article).
>
> As a user, I would find that surprising, and as a user, I never want
> to be surprised.


[web2py] Re: dashes in controller names?

2010-08-30 Thread Cory Coager
I suppose I could pass in bogus arguments in the url with dashes that
never get used.  Still would be nice if the controllers would support
dashes.


[web2py] Re: dashes in controller names?

2010-08-25 Thread Cory Coager
Add to the list:

* Hyphens are preferred to underscores for SEO,
http://www.google.com/support/webmasters/bin/answer.py?answer=76329&topic=15261

Can we make this a feature request?


[web2py] dashes in controller names?

2010-08-24 Thread Cory Coager
How do you use dashes in controller names?  I get errors, "Invalid
request".


[web2py] Re: integrate editarea in application

2010-08-23 Thread Cory Coager
I checked the manual and didn't see anything regarding TEXTAREA.  Is
there a way to enable the editarea editor on TEXTAREA fields?

On Aug 21, 1:41 am, KMax  wrote:
> What does mean 'without going through the admin interface' ?
> Try search TEXTAREA in book?


[web2py] integrate editarea in application

2010-08-20 Thread Cory Coager
How would I integrate editarea in my application without going through
the admin interface?


[web2py] Re: python 2.4 support

2010-07-28 Thread Cory Coager
Sorry for my delay in testing.  The gluon/tools.py seems to be
compatible now and the rocket patch seems to work also.  However, the
hashlib issue still exists as I'm still getting this error:

AttributeError: 'builtin_function_or_method' object has no attribute
'new'


[web2py] Re: Internal error

2010-06-17 Thread Cory Coager
The databases directory is chmod 777 and I have pysqlite-2.6.0 for
python 2.4 installed and included in the path PythonPath for
htaccess.  Is this version not compatible?

On Jun 17, 8:11 am, mdipierro  wrote:
> Only two possibilities come to mind:
> - unable to write on filesystem
> - sqllite driver missing or corrupted


[web2py] Re: Internal error

2010-06-16 Thread Cory Coager
See above, post #5.

On Jun 15, 11:42 pm, mdipierro  wrote:
> No. the error you reported was with postgresql 8.1. What is the
> problem with sqlite?


[web2py] Re: Internal error

2010-06-15 Thread Cory Coager
Any idea why sqlite is not working?


[web2py] Re: Internal error

2010-06-14 Thread Cory Coager
According to the postgresql 8.1 documentation,
standard_conforming_strings is a read-only variable.

http://postgresql2.openmirrors.org/docs/8.1/static/release-8-1.html


[web2py] Re: python 2.4 support

2010-06-13 Thread Cory Coager
Another problem is, I can't launch from the cli because the rocket
module doesn't work with python 2.4:


-bash-3.2$ python web2py.py -i 127.0.0.1 -p 8001 -a 'password'
sh: ifconfig: command not found
WARNING:root:unable to import Rocket
web2py Enterprise Web Framework
Created by Massimo Di Pierro, Copyright 2007-2010
Version 1.79.2 (2010-06-08 22:45:26)
Database drivers available: MySQL, PostgreSQL
Starting hardcron...
please visit:
http://127.0.0.1:8001
use "kill -SIGTERM 21185" to shutdown the web2py server
Traceback (most recent call last):
  File "web2py.py", line 20, in ?
gluon.widget.start(cron=True)
  File "/path/to/gluon/widget.py", line 863, in start
path=options.folder)
  File "/path/to/gluon/main.py", line 618, in __init__
rocket.SERVER_NAME = server_name
NameError: global name 'rocket' is not defined


[web2py] Re: python 2.4 support

2010-06-13 Thread Cory Coager
Found another problem with the welcome application.  When attempting
to register an account I get this error:

Traceback (most recent call last):
File "gluon/restricted.py", line 178, in restricted
exec ccode in environment
File "/path/to/applications/welcome/controllers/default.py", line 57,
in ?
File "gluon/globals.py", line 96, in 
self._caller = lambda f: f()
File "/path/to/applications/welcome/controllers/default.py", line 34,
in user
return dict(form=auth())
File "gluon/tools.py", line 966, in __call__
return self.register()
File "gluon/tools.py", line 1502, in register
onvalidation=onvalidation):
File "gluon/sqlhtml.py", line 876, in accepts
onvalidation,
File "gluon/html.py", line 1452, in accepts
status = self._traverse(status)
File "gluon/html.py", line 480, in _traverse
newstatus = c._traverse(status) and newstatus
File "gluon/html.py", line 480, in _traverse
newstatus = c._traverse(status) and newstatus
File "gluon/html.py", line 480, in _traverse
newstatus = c._traverse(status) and newstatus
File "gluon/html.py", line 480, in _traverse
newstatus = c._traverse(status) and newstatus
File "gluon/html.py", line 487, in _traverse
newstatus = self._validate()
File "gluon/html.py", line 1245, in _validate
(value, errors) = validator(value)
File "gluon/validators.py", line 2329, in __call__
return (hmac.new(self.key, value, alg).hexdigest(), None)
File "/usr/lib64/python2.4/hmac.py", line 107, in new
return HMAC(key, msg, digestmod)
File "/usr/lib64/python2.4/hmac.py", line 42, in __init__
self.outer = digestmod.new()
AttributeError: 'builtin_function_or_method' object has no attribute
'new'

Apparently this version of hashlib doesn't work the same as the one in
python 2.5.


[web2py] Re: python 2.4 support

2010-06-13 Thread Cory Coager
I found some compatibility problems with web2py 1.79.2 and python
2.4.3.  The syntax in gluon/tools.py doesn't appear to work in this
version of python so I made to make some modifications to get it
working.  Here is a diff:



2838,2841c2838,2839
< if not refsearch:
< return field
< else:
< lambda row: row[field.name][format] == value
---
> return field == value if not refsearch else \
>lambda row: row[field.name][format] == value
2843,2846c2841,2842
< if not refsearch:
< return field != value
< else:
< lambda row: row[field.name][format] != value
---
> return field != value if not refsearch else \
>lambda row: row[field.name][format] != value
2848,2851c2844,2845
<   if not refsearch:
<   return field > value
<   else:
<   lambda row: row[field.name][format] > value
---
> return field > value if not refsearch else \
>lambda row: row[field.name][format] > value
2853,2856c2847,2848
<   if not refsearch:
<   return field < value
<   else:
<   lambda row: row[field.name][format] < value
---
> return field < value if not refsearch else \
>lambda row: row[field.name][format] < value
2858,2861c2850,2851
<   if not refsearch:
<   return field.like(value+'%')
<   else:
<   lambda row: str(row[field.name][format]).startswith(value)
---
> return field.like(value+'%') if not refsearch else \
>lambda row: 
> str(row[field.name][format]).startswith(value)
2863,2866c2853,2854
<   if not refsearch:
<   return field.like('%'+value)
<   else:
<   lambda row: str(row[field.name][format]).endswith(value)
---
> return field.like('%'+value) if not refsearch else \
>lambda row: 
> str(row[field.name][format]).endswith(value)
2868,2871c2856,2857
<   if not refsearch:
<   return field.like('%'+value+'%')
<   else:
<   lambda row: value in row[field.name][format]
---
> return field.like('%'+value+'%') if not refsearch else \
>lambda row: value in row[field.name][format]


[web2py] Re: Internal error

2010-06-13 Thread Cory Coager
I did end up getting it working with MySQL although I would have
preferred PostGreSQL.


[web2py] Re: Internal error

2010-06-13 Thread Cory Coager
Here is the error when using PostGreSQL:

Traceback (most recent call last):
File "gluon/restricted.py", line 178, in restricted
exec ccode in environment
File "/path/to/applications/test/models/db.py", line 17, in ?
db=SQLDB('postgres://user:p...@localhost:5432/database')
File "gluon/sql.py", line 967, in __init__
self._execute("SET standard_conforming_strings=on;")
File "gluon/sql.py", line 962, in 
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
OperationalError: parameter "standard_conforming_strings" cannot be
changed

Looks like web2py isn't compatible with postgres 8.1?


[web2py] Re: Internal error

2010-06-13 Thread Cory Coager
Here is the error when using SQLite:


Traceback (most recent call last):
File "gluon/restricted.py", line 178, in restricted
exec ccode in environment
File "/path/to/applications/test/models/db.py", line 15, in ?
db = DAL('sqlite://storage.sqlite')
File "gluon/sql.py", line 3855, in DAL
raise RuntimeError, "Failure to connect to DB. Tried 5 times"
RuntimeError: Failure to connect to DB. Tried 5 times


The databases directory is chmod 777.


[web2py] Re: Internal error

2010-06-12 Thread Cory Coager
It seems to be failing on the model.  I can't seem to get any DAL
working.  If I do a simple hello world test it works fine.  If I add
in a model like sqlite or postgresql, it gives "Internal error".
Whats going on here?


[web2py] Re: Internal error

2010-06-12 Thread Cory Coager
I'm using python 2.4 on a shared host.  I installed hashlib, uuid,
pysqlite, psycopg2, MySQL-python, PyGreSQL.  I'm using web2py with
mod_python with my htaccess as follows:

SetHandler python-program
PythonHandler web2py_modpython
PythonDebug On
PythonPath "sys.path + ['', '/path/to/w2env/lib/python2.4/site-
packages', '/path/to/w2env/lib/python2.4', '/path/to/w2env/lib/
python2.4/site-packages/uuid-1.30-py2.4.egg', ''/path/to/w2env/lib/
python2.4/site-packages/pysqlite-2.6.0-py2.4-linux-x86_64.egg']"


[web2py] Internal error

2010-06-11 Thread Cory Coager
Getting this on an initial setup of web2py trying to load the welcome
application.  Not much in the logs...

[Fri Jun 11 12:45:39 2010] [notice] mod_python (pid=3793,
interpreter='example.com'): Importing module '/path/to/
modpythonhandler.py'
[Fri Jun 11 12:45:39 2010] [notice] mod_python (pid=3793,
interpreter='example.com'): Importing module '/path/to/
web2py_modpython.py'
  File "/path/to/applications/welcome/models/db.py", line 15, in ?


[web2py] mod_python error, contains no 'handler'

2010-06-10 Thread Cory Coager
Any idea why I'm getting this error?


[Thu Jun 10 17:59:15 2010] [error] [client 74.76.167.89]
AttributeError: module '/path/to/modpythonhandler.py' contains no
'handler'
[Thu Jun 10 17:59:15 2010] [error] [client 74.76.167.89] Filename: '/
path/to/500.shtml'
[Thu Jun 10 17:59:15 2010] [error] [client 74.76.167.89] Directory: '/
path/to/'
[Thu Jun 10 17:59:15 2010] [error] [client 74.76.167.89] DocumentRoot:
'/path/to'
[Thu Jun 10 17:59:15 2010] [error] [client 74.76.167.89]   File "/path/
to/gluon/utils.py", line 10, in ?\nimport hashlib
[Thu Jun 10 17:59:15 2010] [error] [client 74.76.167.89]   File "/path/
to/gluon/restricted.py", line 18, in ?\nfrom utils import
web2py_uuid
[Thu Jun 10 17:59:15 2010] [error] [client 74.76.167.89]   File "/path/
to/gluon/main.py", line 32, in ?\nfrom restricted import
RestrictedError
[Thu Jun 10 17:59:15 2010] [error] [client 74.76.167.89]   File "/path/
to/modpythonhandler.py", line 37, in ?\nimport gluon.main


[web2py] Re: fastcgi install not working

2010-06-08 Thread Cory Coager
 Answering my own question, the host provider didn't have mod_fcgid
enabled.


[web2py] fastcgi install not working

2010-06-06 Thread Cory Coager
I just setup a new install of web2py on a shared host.  Using the
fastcgi instructions results in the webpage displaying the contents of
dispatch.fcgi instead of executing it.  What am I doing wrong?

Here is dispatch.fcgi:

#!/usr/bin/env /home//w2env/bin/python
import sys
from flup.server.fcgi_fork import WSGIServer
import gluon.main
application=gluon.main.wsgibase
## or
# application=gluon.main.wsgibase_with_logging
WSGIServer(application).run()


Here is .htaccess:
Options +FollowSymLinks +ExecCGI
AddHandler fcgid-script .cgi
RewriteEngine On
RewriteBase /
RewriteRule ^dispatch\.fcgi/ - [L]
RewriteRule ^(.*)$ dispatch.fcgi/$1 [L]


[web2py] Re: python 2.4 support

2010-06-02 Thread Cory Coager
Still looking for help if anyone has the answer.


[web2py] Re: python 2.4 support

2010-05-31 Thread Cory Coager
Sorry I should have been more clear, its a shared web host running
python 2.4.  I do not have root access.  Will this still be possible?


[web2py] Re: python 2.4 support

2010-05-31 Thread Cory Coager
I just found this documentation on AlterEgo, is this all thats needed?

http://web2py.com/AlterEgo/default/show/231


[web2py] Re: python 2.4 support

2010-05-24 Thread Cory Coager
Is this possible without root permissions?


[web2py] python 2.4 support

2010-05-24 Thread Cory Coager
I'm looking at a web host that uses python 2.4.  I'm wondering what
the compatibility is with python 2.4?  Is there any caveats?  Should I
just move on and find another host that uses python 2.5?


[web2py:25107] Re: Using GAE DB model Directly into web2py?

2009-06-27 Thread Cory Preus

> ... making a list of those GAE expression that you would
> like to be supported by web2py, provide an example of GAE syntax and a
> proposed web2py syntax

Great. Will do.

> The new DAL will have lots more room for customization so we should
> focus on design before implementation.

I've been meaning to dig deeper into this; will do as well. Is there a
thread on how the new DAL functions?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:25100] Re: Using GAE DB model Directly into web2py?

2009-06-27 Thread Cory Preus

I'm in agreement with Hans about how GAE is fundamentally different
from relational databases. There are few threads on this and Yarko's
proposal is something I'm a fan of. Maybe not the most correct
approach, but continuing the discussion is valuable, methinks.

http://groups.google.com/group/web2py/msg/29fa8b3ec9ac0e41

I love how web2py makes shifting between database implementations
simple. Moving between database paradigms is less so, and web2py is
caught inbetween. I want to take advantage of Big Table, but since it
is web2py treats it as a "relational database with limitations",
web2py is the limitation on Big Table.

Massimo, what would you need from me or the community to help? I
understand and appreciate web2py's portability mantra, yet as a
developer who doesn't need portability, I would like to make the
deliberate decision to opt-out of the relational DAL "limitations" and
opt-in to full GAE support in web2py.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:22627] Re: Non-relational databases

2009-05-25 Thread Cory Preus

Great, thanks for this.

I'm interested in seeing how you mimic ListProperty in a relational
database, Massimo. My gut says it doesn't belong, because it breaks
down normalization and/or it just seems like a proxied data type in a
relational database. Not sure how I feel about it since it seems like
it could be used in lieu of more correct normalization practice in a
relational db, much like my argument against IS_IN_DB above for GAE.
I'm Looking forward to what comes to pass. :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:22535] Re: Non-relational databases

2009-05-23 Thread Cory Preus

> Can you make a concrete example? It will help us improve.

The oft-cited ListProperty is a great example. Because GAE/BigTable
doesn't provide substr support, we have a couple options for a search
facility. One is to take a string, say "foobar" and tokenize it into
parts.

['fo','oo','ba','ar','foo','bar','foob','obar','fooba','oobar','foobar']

Using ListProperty, this would be a single write. Our BigTable model
looks as such:

   id name tokens
   1  foobar   ['fo','oo','ob','ba','ar','foo','bar',...]

And a search query:

   # Get all entities where numbers contains a 6.
   results = db.GqlQuery("SELECT * FROM MyModel WHERE tokens = 'foo'")

GQL natively returns all entities contain an element in a list.

http://code.google.com/appengine/docs/python/datastore/entitiesandmodels.html#Lists

Conversely, using the oft cited IS_IN_DB pattern for web2py, we would
have 12 rows inserted, one for each token  with a column of comma
delimited foreign key ids to each full-string entity matching the
token and a bunch of code to manage the integrity across tokens/
entities instead of what is relevant in this case: tokens *per*
entity. Duplication of a token is irrelevant.

So in this scenario, which is key for the project I'm working on with
a friend, a single SELECT using GAE's API would produce the results
needed versus a series of queries to a) SELECT the token in a tokens
table, then iterate over the elements execute SELECTs on each to get
the representation.

While the ListProperty may be unique to GAE/BigTable, omitting it
removes the ability to harness GAE's power. It is also representative
of the difference between data store paradigms, I think.

Hope this helps.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:22526] Re: Non-relational databases

2009-05-23 Thread Cory Preus

> Perhaps some unification between these two - so that applications can be
> portable accross both types - will emerge, and this would be useful.
>
> But I think the first step is to cleanly, intentionally separate the two
> kinds of back ends and see where that leads.

These two statements are key.

1. A separate DAL for GAE/BigTable is needed to harness it. web2py is
too relational specific and not portable to column oriented databases
like BigTable. After going through several data model design
iterations and getting to one that feels correct, web2py imposes the
relational model on a non-relational model, which suggests to me the
"portability" web2py provides to BigTable is in most cases, a good
data model on the wrong data store or vice versa. web2py removes
BigTable's benefit with the current DAL.

2. Patterns will emerge. When another is access layer is created for a
like persistence layer, we should start seeing patterns bubble up and
perhaps then, web2py will become a truer portable architecture.

Meanwhile, a separate DAL feels more correct to me. True portability
between each isn't known or clear; the architecture are not the same
and should not be treated as such.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13701] Re: calling functions from controllers

2008-12-16 Thread Cory Coager

When I meant call functions I meant actions and I don't think you can
pass variables to actions, no?  I did some more research and it looks
like I need to use exec_environment to call other actions.  I can't
seem to figure out how to pass variables with this though.

On Dec 16, 10:53 pm, Baron  wrote:
> within the controller you can call other functions directly like
> normal Python! Did you try it?
>
> On Dec 17, 12:58 pm, Cory Coager  wrote:
>
> > How do you call a function from another function in a controller?  And
> > how do you pass variables between them?  The only way I can see how to
> > do this is using ajax but their must be a better way.
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13696] calling functions from controllers

2008-12-16 Thread Cory Coager

How do you call a function from another function in a controller?  And
how do you pass variables between them?  The only way I can see how to
do this is using ajax but their must be a better way.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13325] Re: dynamically create sql objects

2008-12-10 Thread Cory Coager

That worked, thanks!

On Dec 9, 1:02 am, mdipierro <[EMAIL PROTECTED]> wrote:
> or using war SQL (not nice but possible)
>
>     sort="table.id, table.otherfield, table.yetanotherfield DESC"
>     records=db().select(db.table.ALL,orderby=sort)
>
> Notice in the second case there is no "db." because the connection
> exist in Python not in SQL.
>
> Massimo

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13166] dynamically create sql objects

2008-12-08 Thread Cory Coager

Is it possible to dynamically create a sql object to be used in the
orderby field?

Example:
sort="db.table.id"
records=db().select(db.table.ALL,orderby=sort)

Gives error:
ProgrammingError: schema "db" does not exist

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---