[web2py] Re: Web2py SOAP and local wsdl file

2013-06-17 Thread Barry Bridges
Hi Massimo,
Your correct in that I need to create a server that is complaint with 
someone else's WSDL. I have to full spec of the API, but need to provide 
that to the client devices. If I use pysimplesoap, the WSDL is created for 
me but is not totally compliant/formted to the customers spec. So the issue 
is can I serve up my WSDL file rather than the interally generated one.

You'll have to forgive my terminology but I'm and embedded engineer not a 
web developer so it's all a little new to me.

On Tuesday, 18 June 2013 06:22:55 UTC+1, Massimo Di Pierro wrote:
>
> If you have WSDL service you can connect to is using suds (pip insall suds)
>
> from suds.client import Client
> client = Client(wsdl_service)
> result = client.service.function(input)
>
> here function is a service which must provided by in WSLD.
>
> I understand you have the opposite problem. Create a server that is 
> compliant with given WSDL. Actually I need to do same for a project and I 
> have been unable to. I am not sure this is logically possible because the 
> WSDL contains enough info to generate the service.
>
>
> On Monday, 17 June 2013 08:44:06 UTC-5, Barry Bridges wrote:
>>
>>
>> Hi all,
>> I'm trying to create a SOAP server which uses a local wsdl file supplied 
>> by a third party. How can I use this within Web2py
>>
>>
>> Thanks
>> Barry
>>
>

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: version2.5.1:Approximative date of version correcting smartgrid with links to several tables

2013-06-17 Thread Serge Bourgeois
 smartgrids with linked_tables cannot be executed.

As the problem has already been reported (Antony reacted on it proposing to
include this situation in the non regression testing), I didn't document my
own case.

Serge


2013/6/17 Massimo Di Pierro 

> I am not aware of this. What is the problem with smartgrid in 2.5.1?
>
>
> On Monday, 17 June 2013 03:08:02 UTC-5, Serge Bourgeois wrote:
>>
>> At first, thanks a lot for the fantastic work around Web2py. Each time a
>> new version come, I iplemented it with excitation...
>> The last version 2.5.1 came with a regression in smartgrid
>> functionalities. As I use smartgird in many situation, I'd like to know
>> approximatively when the correction is planned to be implemented.
>> Thanks again for your efforts.
>>
>  --
>
> ---
> 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/HpqRd_bK9GY/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/groups/opt_out.
>
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Datepicker

2013-06-17 Thread tom
I am following some examples and created a table with a date of birth 
field. In my form I cannot seem to get the datepicker set to show when 
selecting that field. Is there something special to do to get that to work 
like that?

Thanks

-- 

--- 
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/groups/opt_out.




[web2py] DatePicker

2013-06-17 Thread tom
I am a bit confused on what I may be missing but how do I have a datepicker 
in my form?

My db.py:

b.define_table('patient', 
Field('first_name', requires=IS_NOT_EMPTY()),
Field('last_name', requires=IS_NOT_EMPTY()),
Field('phone', requires=IS_NOT_EMPTY()),
Field('date_of_birth', required=IS_DATE(), requires=IS_NOT_EMPTY()))

My Controller:

def display_your_form():
form = SQLFORM(db.patient)
return dict(form=form)

and my html:



Web Form

Inputs:
{{=form}}
Submitted variables:
{{=BEAUTIFY(request.vars)}}


Just doing this for example but was curious of there is more that I have to 
do to make this work so when a user selects date of birth the datepicker 
appears.

Thanks,

Tom

-- 

--- 
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/groups/opt_out.




[web2py] Re: smartgrid reference problem

2013-06-17 Thread Massimo Di Pierro
The difference between a grid and a smartgrid is that the former can 
represent the result of a join, the latter does not (even if it create 
links to linked tables). Your constraint creates a join. The output of the 
join is not like row[i].first_name but row[i].auth_user.first_name. The 
grid fails because does not know how to deal with this. I think the problem 
specifically arises when trying to represent references.

This can be improved.

On Monday, 17 June 2013 18:36:24 UTC-5, André Kablu wrote:
>
> Hi all,
>
> I am trying to create a grid with a query for auth_user table doing this:
>
> def controller1():
>
> query = ((db.auth_user.id == db.auth_membership.user_id) &
>  (db.auth_membership.group_id == 1))
> grid = SQLFORM.smartgrid(db.auth_user,
>  constraints=dict(auth_user=query
>   ),
>  deletable=False,
>  editable=True,
>  create=False,
>  csv=False)
> return dict(grid=grid)
>
> I am doing a constraint to filter only for members of group 1 in list... 
> and it is working fine.
>
> However when I try to click to any referenced table:
>
>
> It shows this error:
>
>  'Row' object has no attribute 
> 'first_name'
> I already tried to separate queries in constraints like this:
>
> query1 = db.auth_membership.user_id == db.auth_user.id
> query2 = db.auth_membership.group_id == 1
> grid = SQLFORM.smartgrid(db.auth_user,
>  constraints=dict(auth_user=query1,
>   auth_membership=query2
>   ),
>  deletable=False,
>  editable=True,
>  create=False,
>  csv=False)
>
> However it still return same error when clicking in one of the referenced 
> tables.
>
>
>
> Do anyone have an idea of what am I doing wrong?
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: SQLFORM.grid query widget not working

2013-06-17 Thread Massimo Di Pierro
There should be no difference on whether you use Windows or Linux. Perhaps 
there is a difference between the types of browsers. Which IE version are 
you using? Which web2py version? 

On Monday, 17 June 2013 15:58:44 UTC-5, ewon...@gmail.com wrote:
>
> Hi,
> I started using web2py on Windows (with IE) but realized that I needed to 
> use Linux (with Firefox).  SQLFORM.grids looked very nice on Windows, but 
> now that I am using Linux, they look very plain, and more concerningly, do 
> not seem to be working properly for me.  In particular, the query builder 
> feature is not appearing when I click in the search bar.  Also, I noticed 
> that if I execute a search query (writing the query string on my own since 
> the query builder was not working), when I click the Clear button nothing 
> happens--the search query is not cleared, the URL remains the same, and the 
> rows displayed remain the same.  Am I missing something?  I checked and I 
> have Firefox 17.0.5 if it makes a difference.  I would really like to be 
> able to use the query string builder.
>  
> Thanks!
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: computed fields ... order of calculation?

2013-06-17 Thread Massimo Di Pierro
I believe they are computed in te order in which they are defined. I never 
tried this but a quick at the source shows that is the case.

On Monday, 17 June 2013 14:32:55 UTC-5, Tim Richardson wrote:
>
> If I want a computer field which depends on another computed field, is 
> there a guaranteed order of computation (such as alphabetical sorting of 
> field names?)
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Web2py SOAP and local wsdl file

2013-06-17 Thread Massimo Di Pierro
If you have WSDL service you can connect to is using suds (pip insall suds)

from suds.client import Client
client = Client(wsdl_service)
result = client.service.function(input)

here function is a service which must provided by in WSLD.

I understand you have the opposite problem. Create a server that is 
compliant with given WSDL. Actually I need to do same for a project and I 
have been unable to. I am not sure this is logically possible because the 
WSDL contains enough info to generate the service.


On Monday, 17 June 2013 08:44:06 UTC-5, Barry Bridges wrote:
>
>
> Hi all,
> I'm trying to create a SOAP server which uses a local wsdl file supplied 
> by a third party. How can I use this within Web2py
>
>
> Thanks
> Barry
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: version2.5.1:Approximative date of version correcting smartgrid with links to several tables

2013-06-17 Thread Massimo Di Pierro
OK I reopened it.

On Monday, 17 June 2013 11:51:06 UTC-5, dev.ld...@gmail.com wrote:
>
>
>
> On Monday, June 17, 2013 11:44:11 AM UTC-4, Massimo Di Pierro wrote:
>>
>> But that issue was closed.
>>
>>
> Yes, I see that but I don't see any change set listed that that fixes it. 
> In my testing, the test app still fails with the latest github version as 
> do my apps.
>
> Dan
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: @request.restful() endpoints 404 when not localhost

2013-06-17 Thread Massimo Di Pierro
The problem is thet your restful API probably uses JSON. you still need to 
create a view for it. For security reasons default generic views only work 
from localhost.

On Monday, 17 June 2013 10:41:33 UTC-5, Eduardo Cruz wrote:
>
> I have made an restful api and it works perfectly on localhost but when I 
> try to use it from another machine all the api endpoints give me an 404, Im 
> running web2py with the built-in server on 0.0.0.0
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: passing variable and not string back to controller

2013-06-17 Thread funmanhk
Hi Anthony,

Yes, you are right! Your suggestion works like a charm!

I need to watch out for the {{}}  in the future.  How could I miss that :-) 
I guess that I definitely more practice.

Thanks very much for your help.

Best Regards,
funman

-- 

--- 
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/groups/opt_out.




[web2py] Re: smartgrid reference problem

2013-06-17 Thread André Kablu
Well the img did not appeared, when I say referenced tables, I mean the 
links: Auth casesAuth events   s Auth 
memberships

Em segunda-feira, 17 de junho de 2013 20h36min24s UTC-3, André Kablu 
escreveu:
>
> Hi all,
>
> I am trying to create a grid with a query for auth_user table doing this:
>
> def controller1():
>
> query = ((db.auth_user.id == db.auth_membership.user_id) &
>  (db.auth_membership.group_id == 1))
> grid = SQLFORM.smartgrid(db.auth_user,
>  constraints=dict(auth_user=query
>   ),
>  deletable=False,
>  editable=True,
>  create=False,
>  csv=False)
> return dict(grid=grid)
>
> I am doing a constraint to filter only for members of group 1 in list... 
> and it is working fine.
>
> However when I try to click to any referenced table:
>
>
> It shows this error:
>
>  'Row' object has no attribute 
> 'first_name'
> I already tried to separate queries in constraints like this:
>
> query1 = db.auth_membership.user_id == db.auth_user.id
> query2 = db.auth_membership.group_id == 1
> grid = SQLFORM.smartgrid(db.auth_user,
>  constraints=dict(auth_user=query1,
>   auth_membership=query2
>   ),
>  deletable=False,
>  editable=True,
>  create=False,
>  csv=False)
>
> However it still return same error when clicking in one of the referenced 
> tables.
>
>
>
> Do anyone have an idea of what am I doing wrong?
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Drop-down auto populate not working

2013-06-17 Thread villas
I think you need to get something simple working before you can make 
progress.
I suggest you play around with something like this

Paste this into  controller/default.py

def test():
optlist = [OPTION(x) for x in ['A','B']]
testvar = SELECT(optlist, _id='idtest')
return dict(testvar=testvar)

def testoptions():
if request.vars.dpt == 'A':
return 'A requested'
elif request.vars.dpt == 'B':
return 'B requested'
else:
return request.vars

 
Paste this into views/default/test.html:

{{extend 'layout.html'}}

  jQuery(document).ready(function() {
$("#idtest").change(function() {
$("#idresult").load("{{=URL('testoptions')}}" + 
"?dpt="+$("#idtest").val());
});
  });

{{=testvar}}
{{=DIV(_id='idresult')}}

#

go to  /default/test   in your browser

-- 

--- 
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/groups/opt_out.




[web2py] smartgrid reference problem

2013-06-17 Thread André Kablu
Hi all,

I am trying to create a grid with a query for auth_user table doing this:

def controller1():

query = ((db.auth_user.id == db.auth_membership.user_id) &
 (db.auth_membership.group_id == 1))
grid = SQLFORM.smartgrid(db.auth_user,
 constraints=dict(auth_user=query
  ),
 deletable=False,
 editable=True,
 create=False,
 csv=False)
return dict(grid=grid)

I am doing a constraint to filter only for members of group 1 in list... 
and it is working fine.

However when I try to click to any referenced table:


It shows this error:

 'Row' object has no attribute 
'first_name'
I already tried to separate queries in constraints like this:

query1 = db.auth_membership.user_id == db.auth_user.id
query2 = db.auth_membership.group_id == 1
grid = SQLFORM.smartgrid(db.auth_user,
 constraints=dict(auth_user=query1,
  auth_membership=query2
  ),
 deletable=False,
 editable=True,
 create=False,
 csv=False)

However it still return same error when clicking in one of the referenced 
tables.



Do anyone have an idea of what am I doing wrong?

-- 

--- 
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/groups/opt_out.




[web2py] Re: passing variable and not string back to controller

2013-06-17 Thread Anthony
 

> 
> url:'{{=URL(r=request,f='call',args=['json','get_one_purchase_order_item', 
> parent_row_id])}}'
> ==> 
> http://127.0.0.1:8000/purchase/default/call/json/get_one_purchase_order_item/parent_row_id
> ?
>

The problem is the the part inside the {{...}} delimiters is not Javascript 
-- it is Python code that gets executed on the server before the page is 
sent to the browser -- so it cannot reference Javascript variables that 
exist only in the browser.
 

> var parent_row_id = row_data.id;
> 
> jQuery("#"+subgrid_table_id).jqGrid({
> 
> url:'{{=URL(r=request,f='call',args=['json','get_one_purchase_order_item', 
> parent_row_id])}}',
>

Instead of the above line, try this:

url:'{{=URL(r=request,f='call',args=['json','get_one_purchase_order_item
'])}}' + '/' + parent_row_id

So, the base URL is created by web2py on the server, and Javascript is used 
to append the parent_row_id in the browser.

Anthony

-- 

--- 
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/groups/opt_out.




Re: [web2py] @request.restful() only works on localhost

2013-06-17 Thread Anthony
On Monday, June 17, 2013 4:47:30 PM UTC-4, Paolo valleri wrote:

> that could be a problem of a generic view not correctly loaded due to the 
> following line in db.py
>
> response.generic_patterns = ['*'] if request.is_local else []
>
> change it to
>
> response.generic_patterns = ['*']
>
>
> Though there's a reason for the local request condition there -- open 
access to all generic views for all requests is a security risk (attackers 
can use them to expose data that is returned by a controller but not 
intended to be included in the view). It is better to enable generic views 
in a more targeted fashion (i.e., either make use of the ability to specify 
glob patterns, or set it inside the controller function where it is needed).

Anthony

-- 

--- 
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/groups/opt_out.




[web2py] Re: Can I have access to the LESS files that generate the welcome app css?

2013-06-17 Thread Ian W. Scott
Thanks Ales, but web2py_bootstrap.css (and maybe web2py.css) overrides some 
of those stock Bootstrap settings. I want to override some of those 
overrides (!), and this will be simplest if I have the LESS files behind 
web2py_bootstrap.css. This is assuming that I read the earlier post 
correctly, and that such LESS files do exist. 

Ian

On Monday, June 17, 2013 4:42:36 PM UTC-4, LightDot wrote:
>
> The Bootstrap version included in web2py welcome app is completely stock, 
> straight download from their page, so you can get LESS files from them. At 
> the moment, welcome app is still using Bootstrap version 2.2.2, although 
> 2.3.2 is pretty much a drop in replacement.
>
> Regards,
> Ales
>
> On Monday, June 17, 2013 9:50:16 PM UTC+2, Ian W. Scott wrote:
>>
>> Hi. I noticed on the forum here mention of LESS files that are used to 
>> generate the welcome app css but are not included in the web2py 
>> distribution. I'm trying to customize Bootstrap from the LESS files, and it 
>> would make things easier if I could have those LESS files. Is there any 
>> particular reason they aren't distributed?
>>
>> Thanks,
>>
>> Ian
>>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: example for validating input (using requires = IS_IN_DB) against form.vars before submit.

2013-06-17 Thread villas
Indeed,  and of course you can create the METALS list from a table and then 
cache it (as long as it doesn't change so much).  It works very 
efficiently.  


On Monday, 17 June 2013 19:14:29 UTC+1, André Kablu wrote:
>
> Hi,
>
> I don`t know why you are referencing another table, but if this is only 
> for populate that field and you know that those values will not change or 
> increase, you may consider using lists:
>
> METALS = (
> (1, 'silver'),
> (2, 'gold'),
> (3, 'iron'),
> (4, 'zinc')
> )
> db.table.field1.requires = IS_IN_SET(METALS, zero=None)
>
> this should solve your problem and create a select for you, also you will 
> not need to confirm selection.
>
> Em segunda-feira, 17 de junho de 2013 13h48min05s UTC-3, webpypy escreveu:
>>
>> Thank you, everybody.
>>
>> let me describe what i am trying to do.
>>
>> a table has field1 , field2
>>
>> field1 is referenced in reftable1
>> field2 is referenced in reftable2
>>
>> reftable2 has a field (reftable1_id) that is referenced in reftable1.
>>
>> field1 is entered through dropdown list by
>> db.table.field1.requires = IS_IN_DB(db(db.reftable1.id>0),'reftable1.id' 
>> , '%(name)s')
>>  
>>
>> My question is about entering field2, the dropdown list needs to be 
>> according to the value entered in field1.
>> db.table.field2.requires = IS_IN_DB(db(db.reftable2.reftable1_id == 
>> request.vars.field1),'reftable2.id','%(name)s')
>>
>> is not working.
>>
>>
>> why?
>> or how to debug?
>>
>> Regards,
>>
>> ashraf
>>
>>

-- 

--- 
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/groups/opt_out.




Re: [web2py] @request.restful() only works on localhost

2013-06-17 Thread Eduardo Cruz
Thanks that line was the problem!

El lunes, 17 de junio de 2013 16:47:30 UTC-4, Paolo valleri escribió:
>
> that could be a problem of a generic view not correctly loaded due to the 
> following line in db.py
>
> response.generic_patterns = ['*'] if request.is_local else []
>
> change it to
>
> response.generic_patterns = ['*']
>
>
> Paolo
>
> On Monday, June 17, 2013 9:50:58 PM UTC+2, Michele Comitini wrote:
>>
>> send example code to reproduce the error please!  model, controller and 
>> iff you have modified routes.py send that too.
>>
>> mic
>>
>>
>>
>>
>> 2013/6/17 Eduardo Cruz 
>>
>>> I have made an api using @request.restful() decorator but when I try to 
>>> use the api from another machine it gives me an 404, Im running web2py with 
>>> the built-in server at 0.0.0.0
>>>
>>> -- 
>>>  
>>> --- 
>>> 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+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>  
>>>  
>>>
>>
>>

-- 

--- 
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/groups/opt_out.




[web2py] SQLFORM.grid query widget not working

2013-06-17 Thread ewong1111
Hi,
I started using web2py on Windows (with IE) but realized that I needed to 
use Linux (with Firefox).  SQLFORM.grids looked very nice on Windows, but 
now that I am using Linux, they look very plain, and more concerningly, do 
not seem to be working properly for me.  In particular, the query builder 
feature is not appearing when I click in the search bar.  Also, I noticed 
that if I execute a search query (writing the query string on my own since 
the query builder was not working), when I click the Clear button nothing 
happens--the search query is not cleared, the URL remains the same, and the 
rows displayed remain the same.  Am I missing something?  I checked and I 
have Firefox 17.0.5 if it makes a difference.  I would really like to be 
able to use the query string builder.
 
Thanks!

-- 

--- 
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/groups/opt_out.




Re: [web2py] @request.restful() only works on localhost

2013-06-17 Thread Paolo valleri
that could be a problem of a generic view not correctly loaded due to the 
following line in db.py

response.generic_patterns = ['*'] if request.is_local else []

change it to

response.generic_patterns = ['*']


Paolo

On Monday, June 17, 2013 9:50:58 PM UTC+2, Michele Comitini wrote:
>
> send example code to reproduce the error please!  model, controller and 
> iff you have modified routes.py send that too.
>
> mic
>
>
>
>
> 2013/6/17 Eduardo Cruz >
>
>> I have made an api using @request.restful() decorator but when I try to 
>> use the api from another machine it gives me an 404, Im running web2py with 
>> the built-in server at 0.0.0.0
>>
>> -- 
>>  
>> --- 
>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Can I have access to the LESS files that generate the welcome app css?

2013-06-17 Thread LightDot
The Bootstrap version included in web2py welcome app is completely stock, 
straight download from their page, so you can get LESS files from them. At 
the moment, welcome app is still using Bootstrap version 2.2.2, although 
2.3.2 is pretty much a drop in replacement.

Regards,
Ales

On Monday, June 17, 2013 9:50:16 PM UTC+2, Ian W. Scott wrote:
>
> Hi. I noticed on the forum here mention of LESS files that are used to 
> generate the welcome app css but are not included in the web2py 
> distribution. I'm trying to customize Bootstrap from the LESS files, and it 
> would make things easier if I could have those LESS files. Is there any 
> particular reason they aren't distributed?
>
> Thanks,
>
> Ian
>

-- 

--- 
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/groups/opt_out.




[web2py] How to configure web2py server to http and https

2013-06-17 Thread Vinicius Assef
I'd like to configure web2py embedded server to work with http and https.

Following this guideline[1] I can make everything work with https, but
my apps don't work with http. When I try to
http://localhost:8000/myapp I get a "Bad Request" error.

What am I missing?

[1] http://www.web2py.com/AlterEgo/default/show/140

--
Vinicius Assef

-- 

--- 
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/groups/opt_out.




[web2py] passing variable and not string back to controller

2013-06-17 Thread funmanhk
Hi All,

I have a variable in my javascript - "parent_row_id" that i want to make 
its value as the last argument of the url. Then my controller can take 
this, and return a bunch of data for the subgrid of this jqgrid.  

I found that the below turn my variable to simply a string using the 
variable name. then i got a ticket as there is no definition of 
"parent_row_id" there in the controller.

url:'{{=URL(r=request,f='call',args=['json','get_one_purchase_order_item', 
parent_row_id])}}'
==> 
http://127.0.0.1:8000/purchase/default/call/json/get_one_purchase_order_item/parent_row_id?

I have been trying to get it to work like this... if parent_row_id = 1
http://127.0.0.1:8000/purchase/default/call/json/get_one_purchase_order_item/1?

I have not been successful, and would hope to seek your advices to tackle 
it  Hope you can shed some light...


This is part of my view.

var row_data = $("#list").jqGrid('getRowData', row_id);
console.log(row_id);
console.log(row_data.id);
var parent_row_id = row_data.id;

jQuery("#"+subgrid_table_id).jqGrid({

url:'{{=URL(r=request,f='call',args=['json','get_one_purchase_order_item', 
parent_row_id])}}',
data: "{}",
datatype: 'json',
mtype: 'GET',
contentType: "application/json; charset=utf-8",
complete: function(jsondata, stat) {
if (stat == "success") {
var thegrid2 = jQuery("#"+subgrid_table_id)[0];

thegrid2.addJSONData(JSON.parse(jsondata.responseText).d);
}
},

This is part of my controller. 
@service.json
def get_one_purchase_order_item():
# db.order_item.category.represent = lambda v: v.name
item_id = request.args[-1]
for r in db(db.order_item.purchase_id == 
item_id).select(limitby=limitby,orderby=orderby):


-- 

--- 
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/groups/opt_out.




Re: [web2py] @request.restful() only works on localhost

2013-06-17 Thread Michele Comitini
send example code to reproduce the error please!  model, controller and iff
you have modified routes.py send that too.

mic




2013/6/17 Eduardo Cruz 

> I have made an api using @request.restful() decorator but when I try to
> use the api from another machine it gives me an 404, Im running web2py with
> the built-in server at 0.0.0.0
>
> --
>
> ---
> 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/groups/opt_out.
>
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Can I have access to the LESS files that generate the welcome app css?

2013-06-17 Thread Ian W. Scott
Hi. I noticed on the forum here mention of LESS files that are used to 
generate the welcome app css but are not included in the web2py 
distribution. I'm trying to customize Bootstrap from the LESS files, and it 
would make things easier if I could have those LESS files. Is there any 
particular reason they aren't distributed?

Thanks,

Ian

-- 

--- 
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/groups/opt_out.




[web2py] computed fields ... order of calculation?

2013-06-17 Thread Tim Richardson
If I want a computer field which depends on another computed field, is 
there a guaranteed order of computation (such as alphabetical sorting of 
field names?)

-- 

--- 
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/groups/opt_out.




[web2py] Re: Web2py SOAP and local wsdl file

2013-06-17 Thread Derek
You aren't quite making sense. You want to create a soap server with 
web2py, but you want that to consume another soap server's api? why?

On Monday, June 17, 2013 6:44:06 AM UTC-7, Barry Bridges wrote:
>
>
> Hi all,
> I'm trying to create a SOAP server which uses a local wsdl file supplied 
> by a third party. How can I use this within Web2py
>
>
> Thanks
> Barry
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Asynchronous logging

2013-06-17 Thread Niphlod
all operations on redis are atomic, so it's quite easy to write such a 
system, e.g. adding and popping a redis list.

On Monday, June 17, 2013 8:20:55 PM UTC+2, ssuresh wrote:
>
>
>
> Since all my analytics will be done through the database, i require the 
> log data in the table(by end of day at least).. 
> So if I write all logs to redis and then can I run scheduler to flush it 
> to db? Do you think that would be the right approach?
>
> On Monday, June 17, 2013 9:10:31 PM UTC+5:30, Niphlod wrote:
>>
>> continous operations kinda don't play well with logs files issues are 
>> more prominent in a multiprocess environment.
>>
>> Redis can do it without hiccup, if you have it in your environment...
>>
>>
>>
>> Il giorno lunedì 17 giugno 2013 15:22:43 UTC+2, ssuresh ha scritto:
>>>
>>> hi,
>>> I am planning to build  some sort of user action analytics into my 
>>> system. For this, I need to log all user actions into the table . Since an 
>>> additional db write for every function call can be a performance issue, my 
>>> idea is to introduce an async batch write(say after every hundred lines of 
>>> logs, a job will bulk insert that into the table).
>>>
>>> Please advice on the best way of doing this using web2py.
>>>
>>> regds,
>>> Suresh
>>>
>>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Asynchronous logging

2013-06-17 Thread ssuresh


Since all my analytics will be done through the database, i require the log 
data in the table(by end of day at least).. 
So if I write all logs to redis and then can I run scheduler to flush it to 
db? Do you think that would be the right approach?

On Monday, June 17, 2013 9:10:31 PM UTC+5:30, Niphlod wrote:
>
> continous operations kinda don't play well with logs files issues are 
> more prominent in a multiprocess environment.
>
> Redis can do it without hiccup, if you have it in your environment...
>
>
>
> Il giorno lunedì 17 giugno 2013 15:22:43 UTC+2, ssuresh ha scritto:
>>
>> hi,
>> I am planning to build  some sort of user action analytics into my 
>> system. For this, I need to log all user actions into the table . Since an 
>> additional db write for every function call can be a performance issue, my 
>> idea is to introduce an async batch write(say after every hundred lines of 
>> logs, a job will bulk insert that into the table).
>>
>> Please advice on the best way of doing this using web2py.
>>
>> regds,
>> Suresh
>>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: example for validating input (using requires = IS_IN_DB) against form.vars before submit.

2013-06-17 Thread André Kablu
Hi,

I don`t know why you are referencing another table, but if this is only for 
populate that field and you know that those values will not change or 
increase, you may consider using lists:

METALS = (
(1, 'silver'),
(2, 'gold'),
(3, 'iron'),
(4, 'zinc')
)
db.table.field1.requires = IS_IN_SET(METALS, zero=None)

this should solve your problem and create a select for you, also you will 
not need to confirm selection.

Em segunda-feira, 17 de junho de 2013 13h48min05s UTC-3, webpypy escreveu:
>
> Thank you, everybody.
>
> let me describe what i am trying to do.
>
> a table has field1 , field2
>
> field1 is referenced in reftable1
> field2 is referenced in reftable2
>
> reftable2 has a field (reftable1_id) that is referenced in reftable1.
>
> field1 is entered through dropdown list by
> db.table.field1.requires = IS_IN_DB(db(db.reftable1.id>0),'reftable1.id' 
> , '%(name)s')
>  
>
> My question is about entering field2, the dropdown list needs to be 
> according to the value entered in field1.
> db.table.field2.requires = IS_IN_DB(db(db.reftable2.reftable1_id == 
> request.vars.field1),'reftable2.id','%(name)s')
>
> is not working.
>
>
> why?
> or how to debug?
>
> Regards,
>
> ashraf
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: example for validating input (using requires = IS_IN_DB) against form.vars before submit.

2013-06-17 Thread Anthony
If the dropdown for field2 depends on the value of field1, then you cannot 
specify the contents of the field2 dropdown on the server at the time the 
form is first created. Instead, you'll have to fill in the field2 dropdown 
via Ajax after a selection is made in field1. web2py does not include any 
built-in functionality for this, but there are some options: 
http://stackoverflow.com/questions/8146260/best-practice-for-populating-dropdown-based-on-other-dropdown-selection-in-web2p/8152910#8152910
.

Anthony

On Monday, June 17, 2013 12:48:05 PM UTC-4, webpypy wrote:
>
> Thank you, everybody.
>
> let me describe what i am trying to do.
>
> a table has field1 , field2
>
> field1 is referenced in reftable1
> field2 is referenced in reftable2
>
> reftable2 has a field (reftable1_id) that is referenced in reftable1.
>
> field1 is entered through dropdown list by
> db.table.field1.requires = IS_IN_DB(db(db.reftable1.id>0),'reftable1.id' 
> , '%(name)s')
>  
>
> My question is about entering field2, the dropdown list needs to be 
> according to the value entered in field1.
> db.table.field2.requires = IS_IN_DB(db(db.reftable2.reftable1_id == 
> request.vars.field1),'reftable2.id','%(name)s')
>
> is not working.
>
>
> why?
> or how to debug?
>
> Regards,
>
> ashraf
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: version2.5.1:Approximative date of version correcting smartgrid with links to several tables

2013-06-17 Thread dev . ldhughes


On Monday, June 17, 2013 11:44:11 AM UTC-4, Massimo Di Pierro wrote:
>
> But that issue was closed.
>
>
Yes, I see that but I don't see any change set listed that that fixes it. 
In my testing, the test app still fails with the latest github version as 
do my apps.

Dan

-- 

--- 
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/groups/opt_out.




[web2py] Re: example for validating input (using requires = IS_IN_DB) against form.vars before submit.

2013-06-17 Thread webpypy
Thank you, everybody.

let me describe what i am trying to do.

a table has field1 , field2

field1 is referenced in reftable1
field2 is referenced in reftable2

reftable2 has a field (reftable1_id) that is referenced in reftable1.

field1 is entered through dropdown list by
db.table.field1.requires = IS_IN_DB(db(db.reftable1.id>0),'reftable1.id' , 
'%(name)s')
 

My question is about entering field2, the dropdown list needs to be 
according to the value entered in field1.
db.table.field2.requires = IS_IN_DB(db(db.reftable2.reftable1_id == 
request.vars.field1),'reftable2.id','%(name)s')

is not working.


why?
or how to debug?

Regards,

ashraf

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: Fields being set to NULL on SQLFORM.grid update

2013-06-17 Thread Jim S
FWIW - My concern for this is primarily that as I add fields to tables 
months/years from now I may forget to set writable to False for them and 
therefore they would be set to NULL without my being aware.  To get around 
this, I've added the following to my controllers that use SQLFORM.grid and 
call custom forms.

if request.args(0) == 'edit':
for field in db.table_for_grid.fields:
db.table_for_grid[field].writable = False

db.table_for_grid.field_to_edit_1.writable = True
db.table_for_grid.field_to_edit_2.writable = True
...etc...

grid = SQLFORM.grid(db.table_for_grid.id > 0)

-Jim

On Monday, June 17, 2013 8:31:17 AM UTC-5, Jim S wrote:
>
> Not what I wanted to hear, but that is what I figured was the issue.
>
> However, I think it should be noted in the book that when using 
> SQLFORM.grid and custom forms that any field not included in the custom 
> form will be set to NULL on every update of the form.
>
>
>
> On Mon, Jun 17, 2013 at 12:53 AM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> I am afraid this is not possible because HTML cannot distinguish an empty 
>> submission from no submission. Somehow we have to tell that explicitly to 
>> web2py. Perhaps there is a better way to do it but I do not see on. :-(
>>
>>
>> On Sunday, 16 June 2013 15:35:27 UTC-5, Jim S wrote:
>>
>>> I thought I could just use whatever fields I wanted and it would figure 
>>> out which ones to update.  The way it is now, if I add a field to a table 
>>> and it isn't included in the writable = False statements the It is going to 
>>> be set to null on any future updates.  I would prefer to not have to worry 
>>> about updating all custom forms if I should add a field to a table sometime 
>>> in the future. 
>>>  
>>> Jim
>>> On Jun 16, 2013 3:32 PM, "Massimo Di Pierro"  
>>> wrote:
>>>
 How do you think it should work? If we can make it better we will.

 On Sunday, 16 June 2013 15:02:28 UTC-5, Jim S wrote:
>
> I was hoping I wouldn't have to do that but I understand.  I think it 
> should be pointed out in the manual that this needs to be done so others 
> don't make the same mistake I did. 
>
> Thanks Massimo, I really appreciate the reply. 
>
> Jim
>  On Jun 16, 2013 3:41 AM, "Massimo Di Pierro"  
> wrote:
>
>> The problem is that the grid expects the field to be writable in the 
>> form. You do not include them therefore it thinks they are empty (html 
>> convention, not web2py's).
>>
>> Assuming you want the fields in the "create" form but not in the edit 
>> form you can replace:
>>
>> grid = SQLFORM.grid(db.person.id>0,
>> fields=[db.person.first, db.person.last])
>>
>> with
>>
>> if request.args(0) == 'edit':
>> db.person.song.writable = False
>> db.person.tv_show.writable = False
>> grid = SQLFORM.grid(db.person.id>0,
>> fields=[db.person.first, db.person.last])
>>
>> On Friday, 14 June 2013 08:54:59 UTC-5, Jim S wrote:
>>>
>>> Here you go.  Attached.
>>>
>>> -Jim
>>>
>>>
>>> On Thursday, June 13, 2013 10:46:58 PM UTC-5, Massimo Di Pierro 
>>> wrote:

 Can we see an example?

 On Thursday, 13 June 2013 16:32:34 UTC-5, Jim S wrote:
>
> It is possible that I'm losing my mind, but it appears to me that 
> when I submit a SQLFORM.grid update with a custom form that fields 
> not 
> included in the custom form are being set to NULL even if they had a 
> value 
> in them before.
>
> I've just noticed this after updating to 2.5.1 stable.
>
> -Jim
>
  -- 
>>  
>> --- 
>> 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/**
>> to**pic/web2py/EiAy_w4BLxY/**unsubsc**ribe
>> .
>> 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/**grou**ps/opt_out
>> .
>>  
>>  
>>
>  -- 
  
 --- 
 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/EiAy_w4BLxY/**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/**groups/opt_out

[web2py] Web2py SOAP and local wsdl file

2013-06-17 Thread Barry Bridges

Hi all,
I'm trying to create a SOAP server which uses a local wsdl file supplied by 
a third party. How can I use this within Web2py


Thanks
Barry

-- 

--- 
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/groups/opt_out.




[web2py] @request.restful() endpoints 404 when not localhost

2013-06-17 Thread Eduardo Cruz
I have made an restful api and it works perfectly on localhost but when I 
try to use it from another machine all the api endpoints give me an 404, Im 
running web2py with the built-in server on 0.0.0.0

-- 

--- 
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/groups/opt_out.




[web2py] @request.restful() only works on localhost

2013-06-17 Thread Eduardo Cruz
I have made an api using @request.restful() decorator but when I try to use 
the api from another machine it gives me an 404, Im running web2py with the 
built-in server at 0.0.0.0

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: web2canvas looks nice

2013-06-17 Thread samuel bonilla
http://web2canvas.agenciax4.com.br/


2013/6/17 Martin Barnard 

> That would explain my confusion when changing the language didn't change
> the menu :)
>
>
> On Monday, June 10, 2013 5:06:25 AM UTC+3, Gustavo Souza wrote:
>
>> Hello guys, I'm the one responsible for this project, I intend to make it
>> multi language, is currently only in Portuguese.
>>
>>
>> 2013/6/8 samuel bonilla 
>>
>>> Alan solo me gusta la aplicación, me parece interesante.
>>> El 09/06/2013 08:32, "Alan Etkin"  escribió:
>>>
  wowww. nice LOL
>

 Do you like it or it makes you laugh? (or both?) Both is fine, although
 rare.

  --

 ---
 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/rfyhvXxtGcY/**unsubscribe?hl=en
 .
 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/**groups/opt_out
 .



>>>  --
>>>
>>> ---
>>> 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+un...@**googlegroups.com.
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>>
>>>
>>
>>
>>
>> --
>> **
>> *
>> *
>> *Gustavo de Souza Lima*
>> gus...@agenciax4.com.br
>> DESENVOLVEDOR
>>
>> *(21) 2423-4351* (escritório)
>> *(21) 8163-0309* (celular)
>>
>> Twitter: @dodilei 
>> Google+: gplus.to/dodilei
>>
>> tech4noobs.agenciax4.com.br/
>>
>  --
>
> ---
> 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/rfyhvXxtGcY/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/groups/opt_out.
>
>
>

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: admin access password file

2013-06-17 Thread Massimo Di Pierro
I think the port is set by your script: 9001 and it is the same for http 
and https.

On Monday, 17 June 2013 09:24:36 UTC-5, Paolo valleri wrote:
>
> Hi Massimo, I've just tried but the issue hasn't gone :(
> what can I do to debug it more, by who is the request.env.server_port 
> setter ?
>
> Paolo
>
> On Sunday, June 16, 2013 10:32:37 AM UTC+2, Massimo Di Pierro wrote:
>>
>> After
>>
>>  uwsgi_param UWSGI_SCHEME $scheme;
>>
>> you must add
>>
>>  uwsgi_param HTTP_X_FORWARDED_PROTO https;
>>
>>
>>
>> On Wednesday, 12 June 2013 09:09:01 UTC-5, Paolo valleri wrote:
>>>
>>> Hi Massimo, I used https. I expired the same behavior on both apache and 
>>> nginx.
>>> please find attached the condiguration file of nginx 
>>>
>>>  Paolo
>>>
>>>
>>> 2013/6/12 Massimo Di Pierro 
>>>
 In the URL, are you using http or https? Assuming you use apache, can 
 you show the config file?

 On Wednesday, 12 June 2013 01:53:25 UTC-5, Paolo valleri wrote:
>
> Hi all, I have to migrate a web2py app to a centos server. It has 
> python 2.6.6, uwsgi 1.9.12.  admin fails saying:
>
> "admin disabled because unable to access password file"
>
> the file (parameters_443.py) is there. I tried to debug the failure 
> and I discover that, despite the fact that I use https, it tries to 
> access 
> parameters_80.py.
> Thus, I created the file parameters_80.py but then it fails saying to 
> use https :(.
>
> Paolo
>
>
>
>  -- 
  
 --- 
 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/1PDpL5yRKMs/unsubscribe?hl=en.
 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/groups/opt_out.
  
  

>>>
>>>

-- 

--- 
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/groups/opt_out.




[web2py] Re: How to run the sheduler on AppFog?

2013-06-17 Thread Niphlod
appfog lets you run your own permanent processes ? 
if yes, there might be a way, if no, there's no way to run the scheduler.

Generally, every "hosting" provider that does just hosting doesn't allow 
you to span additional processes of your own that aren't web-related

Il giorno lunedì 17 giugno 2013 15:07:14 UTC+2, aabelyakov ha scritto:
>
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: version2.5.1:Approximative date of version correcting smartgrid with links to several tables

2013-06-17 Thread Massimo Di Pierro
But that issue was closed.

On Monday, 17 June 2013 09:09:54 UTC-5, dev.ld...@gmail.com wrote:
>
>
>
> On Monday, June 17, 2013 4:50:55 AM UTC-4, Massimo Di Pierro wrote:
>>
>> I am not aware of this. What is the problem with smartgrid in 2.5.1?
>>
>
> Ticket 1527 describes one of the issues.
>
> Dan 
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Scheduler compatible with nginx/uwsgi?

2013-06-17 Thread Niphlod
the "error on popping task" is shown as soon as an exception is raised into 
the wrapped_pop_task() function. You can remove the try:except block to see 
what's the underlying error, but I really don't know what it could be just 
watching at logs.

Il giorno lunedì 17 giugno 2013 15:18:54 UTC+2, Joe Barnhart ha scritto:
>
> Hi Niphlod --
>
> I can start with debugging...  Here is the output:
>
> root@groomlake2:~# python /home/www-data/web2py/web2py.py -K swim_smarter 
> -D 0
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2013
> Version 2.5.1-stable+timestamp.2013.06.06.15.39.19
> Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL(
> psycopg2), PostgreSQL(pg8000), IMAP(imaplib)
> starting single-scheduler for "swim_smarter"...
> DEBUG:web2py.dal:Your database version does not support the JSON data 
> type (using TEXT instead)
> DEBUG:web2py.scheduler.groomlake2#5474:defining tables (migrate=True)
> DEBUG:web2py.scheduler.groomlake2#5474:thread building own DAL object
> DEBUG:web2py.scheduler.groomlake2#5474:looping...
> ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
> DEBUG:web2py.dal:Your database version does not support the JSON data 
> type (using TEXT instead)
> DEBUG:web2py.scheduler.groomlake2#5474:defining tables (migrate=False)
> ERROR:web2py.scheduler.groomlake2#5474:Error retrieving status
> ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
> ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
> ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
> ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
> ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
> ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
> ERROR:web2py.scheduler.groomlake2#5474:Error retrieving status
> ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
> ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
> ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
> DEBUG:web2py.scheduler.groomlake2#5474:sleeping...
> ERROR:web2py.scheduler.groomlake2#5474:Error retrieving status
> ^CINFO:web2py.scheduler.groomlake2#5474:catched
> INFO:web2py.scheduler.groomlake2#5474:die!
>
> I saw the migrate=True stuff and went and switched off all migrates but 
> the error remained.
>
> I also think it is odd the error is about "popping tasks" because the 
> tasks table has no entries at all -- nor does the run table or the worker 
> table.  All three schduler tables are completely empty.
>
> As for real-time debugging this, I'm in Malaysia this week on a biz trip.  
> (I'm so jet-lagged I don't think I can find my head with both hands!)
>
> -- Joe
>
> On Sunday, June 16, 2013 8:20:16 PM UTC+8, Niphlod wrote:
>>
>> never run the scheduler with sqlite database, if you're planning to 
>> launch multiple schedulers. SQLite and concurrency don't go along very well.
>> If your app accesses the postgresql database it should be able to connect 
>> as well from the scheduler, it's true, but evidently something is different 
>> between your "web" environment and your "scheduler" one.
>> PS: can you start the scheduler with web2py.py -K appname -D 0 ?
>> -D 0 enables DEBUG logs and we maybe able to see the "something" that is 
>> not working.
>> If you can't come up with a solution, I'm available to do some debugging, 
>> send me a PM.
>>
>> On Sunday, June 16, 2013 9:08:33 AM UTC+2, Joe Barnhart wrote:
>>>
>>> Good points.
>>>
>>> But since I'm running the same application in the web server, and it can 
>>> see and read/write the PostgreSQL database from the web process, does that 
>>> imply that the scheduler process (which uses all the same files) can see 
>>> the database as well?  If there is nu such assumption, how would I go about 
>>> proving access from the scheduler process?
>>>
>>> As an aside, I tried running the scheduler as root and as www-data (the 
>>> owner and group of all the web2py files).  They both resulted in the same 
>>> errors.  I was thinking about changing the scheduler to run its tables in 
>>> SQLite and keep the application in PostgreSQL.  Would that be tempting the 
>>> fates to throw down more anguish on me?
>>>
>>> -- Joe
>>>
>>> On Saturday, June 15, 2013 9:56:37 PM UTC+8, Niphlod wrote:

 scheduler and whatever you choose to run your "web part" are totally 
 unrelated. It's meant to be as a separate process, and can totally run on 
 its own. What you need to check is that the scheduler instance can connect 
 to the database (if this was a result of permission problems on the file, 
 the breakage should have happened before those logs, e.g. reading the 
 source file of web2py.py).

 On Saturday, June 15, 2013 4:20:14 AM UTC+2, Joe Barnhart wrote:
>
> I'm trying to set up a test server that's close to the production 
> server I'm going to have.  I have a VM with web2py and nginx/uwsgi 
> installed on Debian.  Th

[web2py] Re: Asynchronous logging

2013-06-17 Thread Niphlod
continous operations kinda don't play well with logs files issues are 
more prominent in a multiprocess environment.

Redis can do it without hiccup, if you have it in your environment...



Il giorno lunedì 17 giugno 2013 15:22:43 UTC+2, ssuresh ha scritto:
>
> hi,
> I am planning to build  some sort of user action analytics into my system. 
> For this, I need to log all user actions into the table . Since an 
> additional db write for every function call can be a performance issue, my 
> idea is to introduce an async batch write(say after every hundred lines of 
> logs, a job will bulk insert that into the table).
>
> Please advice on the best way of doing this using web2py.
>
> regds,
> Suresh
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: web2py 2.5.1 is OUT

2013-06-17 Thread Josh Myers
Nice!  Thanks Massimo!  I'm excited about the Conditional Fields!

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: admin access password file

2013-06-17 Thread Paolo valleri
Hi Massimo, I've just tried but the issue hasn't gone :(
what can I do to debug it more, by who is the request.env.server_port 
setter ?

Paolo

On Sunday, June 16, 2013 10:32:37 AM UTC+2, Massimo Di Pierro wrote:
>
> After
>
>  uwsgi_param UWSGI_SCHEME $scheme;
>
> you must add
>
>  uwsgi_param HTTP_X_FORWARDED_PROTO https;
>
>
>
> On Wednesday, 12 June 2013 09:09:01 UTC-5, Paolo valleri wrote:
>>
>> Hi Massimo, I used https. I expired the same behavior on both apache and 
>> nginx.
>> please find attached the condiguration file of nginx 
>>
>>  Paolo
>>
>>
>> 2013/6/12 Massimo Di Pierro 
>>
>>> In the URL, are you using http or https? Assuming you use apache, can 
>>> you show the config file?
>>>
>>> On Wednesday, 12 June 2013 01:53:25 UTC-5, Paolo valleri wrote:

 Hi all, I have to migrate a web2py app to a centos server. It has 
 python 2.6.6, uwsgi 1.9.12.  admin fails saying:

 "admin disabled because unable to access password file"

 the file (parameters_443.py) is there. I tried to debug the failure and 
 I discover that, despite the fact that I use https, it tries to access 
 parameters_80.py.
 Thus, I created the file parameters_80.py but then it fails saying to 
 use https :(.

 Paolo



  -- 
>>>  
>>> --- 
>>> 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/1PDpL5yRKMs/unsubscribe?hl=en.
>>> 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/groups/opt_out.
>>>  
>>>  
>>>
>>
>>

-- 

--- 
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/groups/opt_out.




[web2py] Re: version2.5.1:Approximative date of version correcting smartgrid with links to several tables

2013-06-17 Thread dev . ldhughes


On Monday, June 17, 2013 4:50:55 AM UTC-4, Massimo Di Pierro wrote:
>
> I am not aware of this. What is the problem with smartgrid in 2.5.1?
>

Ticket 1527 describes one of the issues.

Dan 

-- 

--- 
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/groups/opt_out.




[web2py] Errors in form, please check it out....... HOW?

2013-06-17 Thread REM
I'm attempting to understand a few things and decided to test out one of 
the items at: http://web2py.com/appliances

Specifically, the video library example at the bottom of the page. I tried 
installing it from the URL feature on the admin page but I get the message:

"Errors in form, please check it out"

However, how in the world does one "check it out"? WHERE is "it"? WHAT, in 
fact, am I "checking out"?

I downloaded the referenced .web2py file and my (Ubuntu) system tells me 
it's a gzipped file, but I can't open it with anything. I then tried 
installing that locally downloaded file through admin: same error.

So, I tried downloading and installing others and, in every single case: no 
donuts!

So, how does one even begin to figure out the cause of this?

-- 

--- 
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/groups/opt_out.




[web2py] Re: impersonate any user

2013-06-17 Thread Kostas M
Just for the record, these two issues have been fixed at the latest 
revision.

http://code.google.com/p/web2py/issues/detail?id=1530
http://code.google.com/p/web2py/issues/detail?id=1539

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: Fields being set to NULL on SQLFORM.grid update

2013-06-17 Thread Jim Steil
Not what I wanted to hear, but that is what I figured was the issue.

However, I think it should be noted in the book that when using
SQLFORM.grid and custom forms that any field not included in the custom
form will be set to NULL on every update of the form.



On Mon, Jun 17, 2013 at 12:53 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> I am afraid this is not possible because HTML cannot distinguish an empty
> submission from no submission. Somehow we have to tell that explicitly to
> web2py. Perhaps there is a better way to do it but I do not see on. :-(
>
>
> On Sunday, 16 June 2013 15:35:27 UTC-5, Jim S wrote:
>
>> I thought I could just use whatever fields I wanted and it would figure
>> out which ones to update.  The way it is now, if I add a field to a table
>> and it isn't included in the writable = False statements the It is going to
>> be set to null on any future updates.  I would prefer to not have to worry
>> about updating all custom forms if I should add a field to a table sometime
>> in the future.
>>
>> Jim
>> On Jun 16, 2013 3:32 PM, "Massimo Di Pierro" 
>> wrote:
>>
>>> How do you think it should work? If we can make it better we will.
>>>
>>> On Sunday, 16 June 2013 15:02:28 UTC-5, Jim S wrote:

 I was hoping I wouldn't have to do that but I understand.  I think it
 should be pointed out in the manual that this needs to be done so others
 don't make the same mistake I did.

 Thanks Massimo, I really appreciate the reply.

 Jim
  On Jun 16, 2013 3:41 AM, "Massimo Di Pierro" 
 wrote:

> The problem is that the grid expects the field to be writable in the
> form. You do not include them therefore it thinks they are empty (html
> convention, not web2py's).
>
> Assuming you want the fields in the "create" form but not in the edit
> form you can replace:
>
> grid = SQLFORM.grid(db.person.id>0,
> fields=[db.person.first, db.person.last])
>
> with
>
> if request.args(0) == 'edit':
> db.person.song.writable = False
> db.person.tv_show.writable = False
> grid = SQLFORM.grid(db.person.id>0,
> fields=[db.person.first, db.person.last])
>
> On Friday, 14 June 2013 08:54:59 UTC-5, Jim S wrote:
>>
>> Here you go.  Attached.
>>
>> -Jim
>>
>>
>> On Thursday, June 13, 2013 10:46:58 PM UTC-5, Massimo Di Pierro wrote:
>>>
>>> Can we see an example?
>>>
>>> On Thursday, 13 June 2013 16:32:34 UTC-5, Jim S wrote:

 It is possible that I'm losing my mind, but it appears to me that
 when I submit a SQLFORM.grid update with a custom form that fields not
 included in the custom form are being set to NULL even if they had a 
 value
 in them before.

 I've just noticed this after updating to 2.5.1 stable.

 -Jim

>>>  --
>
> ---
> 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/**to
> **pic/web2py/EiAy_w4BLxY/**unsubsc**ribe
> .
> 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/**grou**ps/opt_out
> .
>
>
>
  --
>>>
>>> ---
>>> 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/EiAy_w4BLxY/**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/**groups/opt_out
>>> .
>>>
>>>
>>>
>>  --
>
> ---
> 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/EiAy_w4BLxY/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/groups/opt_out.
>
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Asynchronous logging

2013-06-17 Thread ssuresh
hi,
I am planning to build  some sort of user action analytics into my system. 
For this, I need to log all user actions into the table . Since an 
additional db write for every function call can be a performance issue, my 
idea is to introduce an async batch write(say after every hundred lines of 
logs, a job will bulk insert that into the table).

Please advice on the best way of doing this using web2py.

regds,
Suresh

-- 

--- 
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/groups/opt_out.




[web2py] Re: Scheduler compatible with nginx/uwsgi?

2013-06-17 Thread Joe Barnhart
Hi Niphlod --

I can start with debugging...  Here is the output:

root@groomlake2:~# python /home/www-data/web2py/web2py.py -K swim_smarter 
-D 0
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2013
Version 2.5.1-stable+timestamp.2013.06.06.15.39.19
Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL(
psycopg2), PostgreSQL(pg8000), IMAP(imaplib)
starting single-scheduler for "swim_smarter"...
DEBUG:web2py.dal:Your database version does not support the JSON data type (
using TEXT instead)
DEBUG:web2py.scheduler.groomlake2#5474:defining tables (migrate=True)
DEBUG:web2py.scheduler.groomlake2#5474:thread building own DAL object
DEBUG:web2py.scheduler.groomlake2#5474:looping...
ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
DEBUG:web2py.dal:Your database version does not support the JSON data type (
using TEXT instead)
DEBUG:web2py.scheduler.groomlake2#5474:defining tables (migrate=False)
ERROR:web2py.scheduler.groomlake2#5474:Error retrieving status
ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
ERROR:web2py.scheduler.groomlake2#5474:Error retrieving status
ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
ERROR:web2py.scheduler.groomlake2#5474:error popping tasks
DEBUG:web2py.scheduler.groomlake2#5474:sleeping...
ERROR:web2py.scheduler.groomlake2#5474:Error retrieving status
^CINFO:web2py.scheduler.groomlake2#5474:catched
INFO:web2py.scheduler.groomlake2#5474:die!

I saw the migrate=True stuff and went and switched off all migrates but the 
error remained.

I also think it is odd the error is about "popping tasks" because the tasks 
table has no entries at all -- nor does the run table or the worker table.  
All three schduler tables are completely empty.

As for real-time debugging this, I'm in Malaysia this week on a biz trip.  
(I'm so jet-lagged I don't think I can find my head with both hands!)

-- Joe

On Sunday, June 16, 2013 8:20:16 PM UTC+8, Niphlod wrote:
>
> never run the scheduler with sqlite database, if you're planning to launch 
> multiple schedulers. SQLite and concurrency don't go along very well.
> If your app accesses the postgresql database it should be able to connect 
> as well from the scheduler, it's true, but evidently something is different 
> between your "web" environment and your "scheduler" one.
> PS: can you start the scheduler with web2py.py -K appname -D 0 ?
> -D 0 enables DEBUG logs and we maybe able to see the "something" that is 
> not working.
> If you can't come up with a solution, I'm available to do some debugging, 
> send me a PM.
>
> On Sunday, June 16, 2013 9:08:33 AM UTC+2, Joe Barnhart wrote:
>>
>> Good points.
>>
>> But since I'm running the same application in the web server, and it can 
>> see and read/write the PostgreSQL database from the web process, does that 
>> imply that the scheduler process (which uses all the same files) can see 
>> the database as well?  If there is nu such assumption, how would I go about 
>> proving access from the scheduler process?
>>
>> As an aside, I tried running the scheduler as root and as www-data (the 
>> owner and group of all the web2py files).  They both resulted in the same 
>> errors.  I was thinking about changing the scheduler to run its tables in 
>> SQLite and keep the application in PostgreSQL.  Would that be tempting the 
>> fates to throw down more anguish on me?
>>
>> -- Joe
>>
>> On Saturday, June 15, 2013 9:56:37 PM UTC+8, Niphlod wrote:
>>>
>>> scheduler and whatever you choose to run your "web part" are totally 
>>> unrelated. It's meant to be as a separate process, and can totally run on 
>>> its own. What you need to check is that the scheduler instance can connect 
>>> to the database (if this was a result of permission problems on the file, 
>>> the breakage should have happened before those logs, e.g. reading the 
>>> source file of web2py.py).
>>>
>>> On Saturday, June 15, 2013 4:20:14 AM UTC+2, Joe Barnhart wrote:

 I'm trying to set up a test server that's close to the production 
 server I'm going to have.  I have a VM with web2py and nginx/uwsgi 
 installed on Debian.  The database is Postgres which runs on the host of 
 the VM and talks thru a "host only" network adapter, also on Linux.

 It all seems to work -- web2py can see and use the Postgres database, I 
 can serve pages thru nginx and uwsgi.  But when I start the scheduler all 
 hell breaks loose.


 web2py Web Framework
 Created by Massimo Di Pierro, Copyright 2007-2013
 Version 2.5.1-stable+timestamp.2013.06.06.15.39.19

[web2py] How to run the sheduler on AppFog?

2013-06-17 Thread aabelyakov


-- 

--- 
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/groups/opt_out.




[web2py] Re: Drop-down auto populate not working

2013-06-17 Thread lesssugar
Yeah, I'm stuck. I don't know how to pass 'dpt' variable to my LOAD 
component correclty.

Here's what I have now:

script which passes 'dpt' variable to add_experience() function


$("#seafarer_experience_department").change(function() {
$("#seafarer_experience_rank").load("?dpt=" + 
$("#seafarer_experience_department").val());
});


the function in 'seafarer.py' controller

def add_experience():
add_experience = crud.create(db.seafarer_experience, next=(URL('seafarer', 
'profile')), _class='formstyle')
 return dict(add_experience=add_experience,dpt=request.vars.dpt)

the rank.populate.load file

{{if dpt:}}
{{ranks = db(db.rank.department_id == dpt).select(orderby=db.rank.name)}}
{{for r in ranks:}}
{{=OPTION(r.name, _value=r.id)}}
{{pass}}

and the view



{{=LOAD('seafarer','rank_populate.load',ajax=True, vars={'dpt': 
dpt})}}



I also tried vars={'dpt': request.vars.dpt} - and nothing.



On Monday, June 17, 2013 11:11:49 AM UTC+2, villas wrote:
>
> Still isn't clear to me what you are doing.  It seems to me that you 
> should use a separate function to return your Options.  I would suggest 
> studying the Components section of the book.  Use the web2py LOAD to get 
> the Options from a separate function.  
>
>
>
>
> On Monday, 17 June 2013 01:16:46 UTC+1, lesssugar wrote:
>>
>> Furthermore... strange. If I print the request.vars.dpt somewhere in the 
>> 'add_experience' function, the value is printed in the terminal every time 
>> I select an option the first drop-down.
>>
>> However, If I return this in the same function:
>>
>> ...
>> ranks = db(db.rank.department_id == request.vars.dpt).select(orderby=db.
>> rank.name)
>>
>> return dict(ranks=ranks)
>>
>> and then check if 'ranks' exists in my view - I get False...
>>
>> Do I need an Ajax call to somehow achieve my goal?
>>
>> On Monday, June 17, 2013 1:35:51 AM UTC+2, lesssugar wrote:
>>>
>>> Yes, I checked: the load function is being triggered and *dpt* variable 
>>> is being set in the function every time I select an option from the first 
>>> drop-down.
>>>
>>> The respective view fragment:
>>>
>>> 
>>> >> name="rank">
>>> {{=result}}
>>> 
>>> 
>>>
>>> (The HTML is fixed just for now, I've cut the dynamic code to test the 
>>> auto-populating only...)
>>>
>>> Not sure if I get the part about rendering "a complete page layout", 
>>> though, but it's a secondary issue for at this point.
>>>
>>>
>>> On Monday, June 17, 2013 12:47:57 AM UTC+2, villas wrote:

 Hmm I'm not sure you have given enough info.  Anyhow:

 Check in Firebug whether the load function is being triggered.
 Place print statements in your function to test that the variables are 
 being set.
 Bear in mind that "return dict(...)"  will render a complete page 
 layout.  I wonder if that is what you want? 
 Check out the SELECT and OPTION helpers.


 On Sunday, 16 June 2013 23:10:12 UTC+1, lesssugar wrote:
>
> I need to auto-populate my 'ranks' drop-down based on the value 
> selected in the 'department' one.
>
> This is my script:
>
> 
> $("#department").change(function() {
> $("#ranks").load("?dpt=" + $("#department").val());
> });
> 
>
> As you can see, I pass *dpt *var to my current function. This is its 
> code:
>
> def add_experience():
>
> ranks = db(db.rank.department_id == 
> request.vars.dpt).select(orderby=db.rank.name)
>
> result = ""
>
> for r in ranks:
> result += "" + r.name + 
> ""
>
>
> return dict(result=XML(result))
>
> When I select a value in the first drop-down, a request is being sent 
> to [controller]/add_experience?dpt=[value selected]. However the second 
> drop-down does not populate with respective data - it's empty. I'm 
> clearly 
> missing something. Any help?
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Drop-down auto populate not working

2013-06-17 Thread lesssugar
Yeah, I'm stuck. I don't know how to pass the request.vars.dpt correctly to 
my LOAD component.

Here's what I have now:

controller

def add_experience():
add_experience = crud.create(db.seafarer_experience, next=(URL('seafarer', 
'profile')), _class='formstyle')
 return dict(add_experience=add_experience,dpt=request.vars.dpt)

rank_populate.load

{{if dpt:}}
{{ranks = db(db.rank.department_id == dpt).select(orderby=db.rank.name)}}
{{for r in ranks:}}
{{=OPTION(r.name, _value=r.id)}}
{{pass}}

view



{{=LOAD('seafarer','rank_populate.load',ajax=True, vars={'dpt': 
request.vars.dpt})}}



I tried vars={'dpt': dpt} also - and nothing. I'm confused.

On Monday, June 17, 2013 11:11:49 AM UTC+2, villas wrote:
>
> Still isn't clear to me what you are doing.  It seems to me that you 
> should use a separate function to return your Options.  I would suggest 
> studying the Components section of the book.  Use the web2py LOAD to get 
> the Options from a separate function.  
>
>
>
>
> On Monday, 17 June 2013 01:16:46 UTC+1, lesssugar wrote:
>>
>> Furthermore... strange. If I print the request.vars.dpt somewhere in the 
>> 'add_experience' function, the value is printed in the terminal every time 
>> I select an option the first drop-down.
>>
>> However, If I return this in the same function:
>>
>> ...
>> ranks = db(db.rank.department_id == request.vars.dpt).select(orderby=db.
>> rank.name)
>>
>> return dict(ranks=ranks)
>>
>> and then check if 'ranks' exists in my view - I get False...
>>
>> Do I need an Ajax call to somehow achieve my goal?
>>
>> On Monday, June 17, 2013 1:35:51 AM UTC+2, lesssugar wrote:
>>>
>>> Yes, I checked: the load function is being triggered and *dpt* variable 
>>> is being set in the function every time I select an option from the first 
>>> drop-down.
>>>
>>> The respective view fragment:
>>>
>>> 
>>> >> name="rank">
>>> {{=result}}
>>> 
>>> 
>>>
>>> (The HTML is fixed just for now, I've cut the dynamic code to test the 
>>> auto-populating only...)
>>>
>>> Not sure if I get the part about rendering "a complete page layout", 
>>> though, but it's a secondary issue for at this point.
>>>
>>>
>>> On Monday, June 17, 2013 12:47:57 AM UTC+2, villas wrote:

 Hmm I'm not sure you have given enough info.  Anyhow:

 Check in Firebug whether the load function is being triggered.
 Place print statements in your function to test that the variables are 
 being set.
 Bear in mind that "return dict(...)"  will render a complete page 
 layout.  I wonder if that is what you want? 
 Check out the SELECT and OPTION helpers.


 On Sunday, 16 June 2013 23:10:12 UTC+1, lesssugar wrote:
>
> I need to auto-populate my 'ranks' drop-down based on the value 
> selected in the 'department' one.
>
> This is my script:
>
> 
> $("#department").change(function() {
> $("#ranks").load("?dpt=" + $("#department").val());
> });
> 
>
> As you can see, I pass *dpt *var to my current function. This is its 
> code:
>
> def add_experience():
>
> ranks = db(db.rank.department_id == 
> request.vars.dpt).select(orderby=db.rank.name)
>
> result = ""
>
> for r in ranks:
> result += "" + r.name + 
> ""
>
>
> return dict(result=XML(result))
>
> When I select a value in the first drop-down, a request is being sent 
> to [controller]/add_experience?dpt=[value selected]. However the second 
> drop-down does not populate with respective data - it's empty. I'm 
> clearly 
> missing something. Any help?
>
>

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: web2canvas looks nice

2013-06-17 Thread Martin Barnard
That would explain my confusion when changing the language didn't change 
the menu :)


On Monday, June 10, 2013 5:06:25 AM UTC+3, Gustavo Souza wrote:
>
> Hello guys, I'm the one responsible for this project, I intend to make it 
> multi language, is currently only in Portuguese.
>
>
> 2013/6/8 samuel bonilla >
>
>> Alan solo me gusta la aplicación, me parece interesante.
>> El 09/06/2013 08:32, "Alan Etkin" > 
>> escribió:
>>
>>>  wowww. nice LOL

>>>
>>> Do you like it or it makes you laugh? (or both?) Both is fine, although 
>>> rare.
>>>
>>>  -- 
>>>  
>>> --- 
>>> 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/rfyhvXxtGcY/unsubscribe?hl=en.
>>> 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/groups/opt_out.
>>>  
>>>  
>>>
>>  -- 
>>  
>> --- 
>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>
>
> -- 
> **
> *
> *
> *Gustavo de Souza Lima*
> gus...@agenciax4.com.br 
> DESENVOLVEDOR
>
> *(21) 2423-4351* (escritório)
> *(21) 8163-0309* (celular)
>
> Twitter: @dodilei 
> Google+: gplus.to/dodilei
>
> tech4noobs.agenciax4.com.br/
>  

-- 

--- 
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/groups/opt_out.




[web2py] Re: Importing files present in models in db.py

2013-06-17 Thread Anthony
Files in the /models folder are executed by the framework in a prepared 
environment, so they are not to be imported (i.e., they are not standard 
Python modules). Same goes for controllers. If you want to create a Python 
module and import it, put it in the /modules folder or anywhere on the 
PYTHONPATH. Note, model files are executed in alphabetical order. For more 
details, see http://web2py.com/books/default/chapter/29/04#Workflow.

Anthony

On Monday, June 17, 2013 8:06:01 AM UTC-4, Apoorve Mohan wrote:
>
> Hi
>
> The problem with modules is solved. I was missing __init__.py file. But 
> how to import files present in models in db.py. This is still unclear.
>
> --
> Thanks
>
> Apoorve
>
> On Monday, June 17, 2013 1:23:57 PM UTC+5:30, Apoorve Mohan wrote:
>>
>> Hello All
>>
>> In my applications i have several files present in models. I need to 
>> import this helper.py file in my db.py.
>> So in db.py i have written "from helper import get_config_file"
>> But when I do so it always gives an import error:
>>  
>> * No module named modules.helper*
>>
>> Now the question is why is it trying to locate my file in modules folder 
>> instead of models. Shouldn't it just pick it up from models as they are in 
>> same folder.
>>
>> I also placed this helper.py file in modules and restarted the server but 
>> still it gave the same error. Why is this happening? Please let me know 
>> what wrong I am doing.
>>
>> --
>> Thanks
>>
>> Apoorve
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Importing files present in models in db.py

2013-06-17 Thread Apoorve Mohan
Hi

The problem with modules is solved. I was missing __init__.py file. But how 
to import files present in models in db.py. This is still unclear.

--
Thanks

Apoorve

On Monday, June 17, 2013 1:23:57 PM UTC+5:30, Apoorve Mohan wrote:
>
> Hello All
>
> In my applications i have several files present in models. I need to 
> import this helper.py file in my db.py.
> So in db.py i have written "from helper import get_config_file"
> But when I do so it always gives an import error:
>  
> * No module named modules.helper*
>
> Now the question is why is it trying to locate my file in modules folder 
> instead of models. Shouldn't it just pick it up from models as they are in 
> same folder.
>
> I also placed this helper.py file in modules and restarted the server but 
> still it gave the same error. Why is this happening? Please let me know 
> what wrong I am doing.
>
> --
> Thanks
>
> Apoorve

-- 

--- 
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/groups/opt_out.




[web2py] Access MySQL PythonAnywhere

2013-06-17 Thread Ovidio Marinho
   Is there anyone else who can not access MySQL in pythonanywhere or just
me?



 Ovidio Marinho Falcao Neto
  ITJP.NET.BR
 ovidio...@gmail.com
   83   8826 9088 - Oi
   83   9336 3782 - Claro
Brasil

-- 

--- 
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/groups/opt_out.




[web2py] Re: Spammers on web2pyslices.com

2013-06-17 Thread Paolo Betti
Hi,

is a different solution but have you ever tried CloudFlare (cloudflare.com) 
service?

It is a kind of proxy-cache online.

I use it with my site that has very very low traffic :-) but open comments 
and spammers have disappeared.

{the site is made with Plone but I have to upgrade to web2py as soon as 
possible ;-)}

PB

Il giorno sabato 15 giugno 2013 06:40:50 UTC+2, rochacbruno ha scritto:
>
> Hi,
>
> recently we are having too many spams posted on web2pyslices.com
>
> I am deleting one by one, but started to be difficult to track this.
>
> We need to implement a captcha system or any other kind of spam blocking.
>
> is there any volunter? to do this for user registration form and also for 
> article post form?
>
> I am in a rush between work and medical treatments, I tried but I really 
> have no time now to develop this.
>
> If anybody can take this, please email me ans I give you access to the 
> development version of the code on pythonanywhere.
>
> Thanks.
>
> []'s
>
> ---
>
> Bruno Rocha
> http://github.com/rochacbruno
> http://rochacbruno.com.br
> http://terraqueos.org
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: example for validating input (using requires = IS_IN_DB) against form.vars before submit.

2013-06-17 Thread villas
If you simply wish to validate one field based on the value of another 
field,  I would usually suggest using the onvalidation argument:

http://web2py.com/books/default/chapter/29/07#onvalidation

-- 

--- 
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/groups/opt_out.




[web2py] Re: DAL.executesql timeout..

2013-06-17 Thread Niphlod
make sure web2py doesn't handle migrations if you have users hitting your 
application.
Don't know if there's a connection timeout check in psycopg2, that can eb 
set to 3 min and it auto-checks if every call to the database remains 
withing the limits you set

Il giorno lunedì 17 giugno 2013 11:20:25 UTC+2, hiro ha scritto:
>
> I am using the DAL to connect to a Postgres server. This server is very 
> big and under constant heavy load.
>
> The problem I am experiencing is that from time to time when the server is 
> under really heavy load, or when the tables queried from the DAL are 
> currently being recreated, the server just wait.
>
> This causes web2py to just wait as well and if the user try to make a few 
> of these calls the web2py server just dies and I have to restart it.
>
> What I would like is some way of making sure no query take more than 3 
> seconds. If they do the query should be aborted and and error should be 
> raised. What is the best way to implement this?
>
>
>
>

-- 

--- 
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/groups/opt_out.




[web2py] DAL.executesql timeout..

2013-06-17 Thread hiro
I am using the DAL to connect to a Postgres server. This server is very big 
and under constant heavy load.

The problem I am experiencing is that from time to time when the server is 
under really heavy load, or when the tables queried from the DAL are 
currently being recreated, the server just wait.

This causes web2py to just wait as well and if the user try to make a few 
of these calls the web2py server just dies and I have to restart it.

What I would like is some way of making sure no query take more than 3 
seconds. If they do the query should be aborted and and error should be 
raised. What is the best way to implement this?



-- 

--- 
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/groups/opt_out.




[web2py] Re: Drop-down auto populate not working

2013-06-17 Thread villas
Still isn't clear to me what you are doing.  It seems to me that you should 
use a separate function to return your Options.  I would suggest studying 
the Components section of the book.  Use the web2py LOAD to get the Options 
from a separate function.  




On Monday, 17 June 2013 01:16:46 UTC+1, lesssugar wrote:
>
> Furthermore... strange. If I print the request.vars.dpt somewhere in the 
> 'add_experience' function, the value is printed in the terminal every time 
> I select an option the first drop-down.
>
> However, If I return this in the same function:
>
> ...
> ranks = db(db.rank.department_id == request.vars.dpt).select(orderby=db.
> rank.name)
>
> return dict(ranks=ranks)
>
> and then check if 'ranks' exists in my view - I get False...
>
> Do I need an Ajax call to somehow achieve my goal?
>
> On Monday, June 17, 2013 1:35:51 AM UTC+2, lesssugar wrote:
>>
>> Yes, I checked: the load function is being triggered and *dpt* variable 
>> is being set in the function every time I select an option from the first 
>> drop-down.
>>
>> The respective view fragment:
>>
>> 
>> > name="rank">
>> {{=result}}
>> 
>> 
>>
>> (The HTML is fixed just for now, I've cut the dynamic code to test the 
>> auto-populating only...)
>>
>> Not sure if I get the part about rendering "a complete page layout", 
>> though, but it's a secondary issue for at this point.
>>
>>
>> On Monday, June 17, 2013 12:47:57 AM UTC+2, villas wrote:
>>>
>>> Hmm I'm not sure you have given enough info.  Anyhow:
>>>
>>> Check in Firebug whether the load function is being triggered.
>>> Place print statements in your function to test that the variables are 
>>> being set.
>>> Bear in mind that "return dict(...)"  will render a complete page 
>>> layout.  I wonder if that is what you want? 
>>> Check out the SELECT and OPTION helpers.
>>>
>>>
>>> On Sunday, 16 June 2013 23:10:12 UTC+1, lesssugar wrote:

 I need to auto-populate my 'ranks' drop-down based on the value 
 selected in the 'department' one.

 This is my script:

 
 $("#department").change(function() {
 $("#ranks").load("?dpt=" + $("#department").val());
 });
 

 As you can see, I pass *dpt *var to my current function. This is its 
 code:

 def add_experience():

 ranks = db(db.rank.department_id == 
 request.vars.dpt).select(orderby=db.rank.name)

 result = ""

 for r in ranks:
 result += "" + r.name + 
 ""


 return dict(result=XML(result))

 When I select a value in the first drop-down, a request is being sent 
 to [controller]/add_experience?dpt=[value selected]. However the second 
 drop-down does not populate with respective data - it's empty. I'm clearly 
 missing something. Any help?



-- 

--- 
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/groups/opt_out.




[web2py] Re: version2.5.1:Approximative date of version correcting smartgrid with links to several tables

2013-06-17 Thread Massimo Di Pierro
I am not aware of this. What is the problem with smartgrid in 2.5.1?

On Monday, 17 June 2013 03:08:02 UTC-5, Serge Bourgeois wrote:
>
> At first, thanks a lot for the fantastic work around Web2py. Each time a 
> new version come, I iplemented it with excitation...
> The last version 2.5.1 came with a regression in smartgrid 
> functionalities. As I use smartgird in many situation, I'd like to know 
> approximatively when the correction is planned to be implemented.
> Thanks again for your efforts.
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Move from VPS to Cloud? Too big to pack

2013-06-17 Thread Massimo Di Pierro
I would zip everything, rsync it there and unzip it. The only caveat is 
that when you zip the database, you must make sure the server is not 
running.

On Monday, 17 June 2013 01:42:11 UTC-5, Mika Sjöman wrote:
>
> Hi
>
> I want to move my website from a VPS to Pythonanywhere. The problem is 
> that my webpage has some houndred megabytes of video material so packing it 
> just ends up in a python error "internal error: requested number of bytes 
> is more than a Python string can hold"
>
> Is there another way I can move from my Ubuntu/MySQL/Apache server to 
> Pythonanywhere? Like a commandline packing and then pushing it with git/hg 
> or something? Is there any pitfalls that I should be aware of? What are the 
> steps? Would this work?
>
> 1. use HG of two folders; init folder and static web2py folder. Pull to 
> local machine from VPS.
> 2. make a db backup of databases 
> 3. getting the DB backups to pythonanywhere. Any ideas on how to do this?
> 4. pushing the files to pythonanywhere? Not much a hacker, so any 
> proposals on how to do this? I just know how to first pull and then push to 
> the server I pulled from. 
>
> Would this work?
>
> Cheers
>

-- 

--- 
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/groups/opt_out.




[web2py] PyQt Model Views and gluon. Has anyone had any experience with this combination?

2013-06-17 Thread Simon Carr
Hello All,

I am working on a application that uses PyQt for the GUI. I am also using 
gluon as my ORM. 

The next stage of the project is going to be working with much larger data 
sets and and unknown column headings so I want to start using QView 
objects. I have not used the Model View facility in Qt before so I was 
wondering if anyone here has had any experience or examples about how I 
would integrate this with gluon.

Thanks
Simon

-- 

--- 
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/groups/opt_out.




[web2py] version2.5.1:Approximative date of version correcting smartgrid with links to several tables

2013-06-17 Thread Serge Bourgeois
At first, thanks a lot for the fantastic work around Web2py. Each time a 
new version come, I iplemented it with excitation...
The last version 2.5.1 came with a regression in smartgrid functionalities. 
As I use smartgird in many situation, I'd like to know approximatively when 
the correction is planned to be implemented.
Thanks again for your efforts.

-- 

--- 
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/groups/opt_out.




[web2py] Importing files present in models in db.py

2013-06-17 Thread Apoorve Mohan
Hello All

In my applications i have several files present in models. I need to import 
this helper.py file in my db.py.
So in db.py i have written "from helper import get_config_file"
But when I do so it always gives an import error:
 
* No module named modules.helper*

Now the question is why is it trying to locate my file in modules folder 
instead of models. Shouldn't it just pick it up from models as they are in 
same folder.

I also placed this helper.py file in modules and restarted the server but 
still it gave the same error. Why is this happening? Please let me know 
what wrong I am doing.

--
Thanks

Apoorve

-- 

--- 
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/groups/opt_out.