[web2py] Include statement in view.

2013-10-16 Thread hiro

I have a smartgrid, and need to add a custom form during an insert. 
Basically I just want to add some html and hide the original form. Very 
easy to do with some javascript. My problem is that this is the first time 
I have tried to use the include statement. And it seems to behave very 
weird for me:

{{=grid}}
{{if special_view_to_add_custom_form:}}
{{print 'Adding custom form.'}}
{{include 'folder/custom_way_to_fill_form.html'}}
{{pass}}

{{# Or to make it more clear:}}

{{if True:}}
{{include 'folder/custom_way_to_fill_form.html'}}
{{# folder/custom_way_to_fill_form.html NOT INCLUDED}}
{{pass}}

{{if False:}}
{{include 'folder/custom_way_to_fill_form.html'}}
{{# folder/custom_way_to_fill_form.html INCLUDED}}
{{pass}}



Is this not the correct way to do it? My problem is that if the variable 
special_view_to_add_custom_form is set to true The print statement is 
called but the include statement is not run.

If, on the other hand special_view_to_add_custom_form is set to false. The 
print statement does not run, but the html is included. It seems the 
include statement does the opposite of what it should do!

Any idea?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] admin page is not working in web2py 2.7.4

2013-10-16 Thread frasse
HI 
I upgrade web2py to 2.7.4 from 2.7.3. admin page is not working any more 
please see the attach file.
do you have any idea ?

Regards
Frasse

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
<>

[web2py] Re: admin page is not working in web2py 2.7.4

2013-10-16 Thread Niphlod
did you configure your webserver to allow the static files to be served 
with folder versioning ?

as a quick way to restore things as they were is to remove this line

https://github.com/web2py/web2py/blob/master/applications/admin/models/0.py#L84

from the file.
But, you'll be missing quite an important feature.

Il giorno mercoledì 16 ottobre 2013 11:21:50 UTC+2, frasse ha scritto:
>
> HI 
> I upgrade web2py to 2.7.4 from 2.7.3. admin page is not working any more 
> please see the attach file.
> do you have any idea ?
>
> Regards
> Frasse
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: TypeError: not indexable

2013-10-16 Thread __pyslan__ - Ayslan Jenken
I'm using the last version, the 2.7.4...  In version 2.7.2 the same thing
happened


On Wed, Oct 16, 2013 at 3:36 AM, Niphlod  wrote:

> upgrade web2py, it's a known bug.
>
> Il giorno mercoledì 16 ottobre 2013 01:46:08 UTC+2, __pyslan__ ha scritto:
>
>> Hello!
>>
>> I'm trying update a field (total_treated) with ajax. I'm using a
>> SQLFORM.grid.
>>
>> In the index.html:
>>
>> {{extend 'masterpage.html'}}
>> 
>> $(document).ready(function(){
>> window.setInterval(function() {
>> var objs = $("[name^='t_']");
>>  for(var i = 0; i < objs.length; i++)
>> {
>> var l = objs[i].getAttribute("id");
>>  ajax('total_treated?l=' + l, ['id'], l);
>> # doesn't work:
>> # ajax('{{URL('total_treated')}}**', ['id'], 'id');
>>  }
>> }, 1);
>> });
>> 
>>
>>
>> In the lists.py:
>>
>> @auth.requires_login()
>> def total_treated():
>> print request.vars
>>
>>
>> ERROR:
>>
>> ...
>>
>>   File "/opt/web-apps/web2py/gluon/**globals.py", line 218, in 
>> parse_post_vars
>>
>> if len(dpost):
>>   File "/usr/local/lib/python2.7/cgi.**py", line 599, in __len__
>>
>> return len(self.keys())
>>
>>   File "/usr/local/lib/python2.7/cgi.**py", line 582, in keys
>>
>> raise TypeError, "not indexable"
>> TypeError: not indexable
>>
>>
>> I tried a lot of things... but without success...
>>
>>
>> Help, please...
>>
>>
>> Thanks!
>>
>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Scheduler on Ubuntu Worker name

2013-10-16 Thread Tushar Tuteja
Hey I am using web2py on ubuntu.
I am trying to use the scheduler but there is not workers name that is 
coming .
and the task is always queued and it never runs.
I followed the video on Vimeo on scheduler.
it runs on mac but not on ubuntu.
apparently my app is hosted on a ubuntu server.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Scheduler on Ubuntu Worker name

2013-10-16 Thread Niphlod
a) what ubuntu ?
b) how do you start the scheduler ?



Il giorno mercoledì 16 ottobre 2013 14:06:41 UTC+2, Tushar Tuteja ha 
scritto:
>
> Hey I am using web2py on ubuntu.
> I am trying to use the scheduler but there is not workers name that is 
> coming .
> and the task is always queued and it never runs.
> I followed the video on Vimeo on scheduler.
> it runs on mac but not on ubuntu.
> apparently my app is hosted on a ubuntu server.
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: TypeError: not indexable

2013-10-16 Thread Niphlod
you are not using 2.7.4
Line 218 in trunk doesn't match your traceback.

https://github.com/web2py/web2py/blob/master/gluon/globals.py#L218

Il giorno mercoledì 16 ottobre 2013 13:45:53 UTC+2, __pyslan__ ha scritto:
>
> I'm using the last version, the 2.7.4...  In version 2.7.2 the same thing 
> happened
>
>
> On Wed, Oct 16, 2013 at 3:36 AM, Niphlod  >wrote:
>
>> upgrade web2py, it's a known bug.
>>
>> Il giorno mercoledì 16 ottobre 2013 01:46:08 UTC+2, __pyslan__ ha scritto:
>>
>>> Hello!
>>>
>>> I'm trying update a field (total_treated) with ajax. I'm using a 
>>> SQLFORM.grid.
>>>
>>> In the index.html:
>>>
>>> {{extend 'masterpage.html'}}
>>> 
>>> $(document).ready(function(){ 
>>> window.setInterval(function() {
>>> var objs = $("[name^='t_']");
>>>  for(var i = 0; i < objs.length; i++)
>>> {
>>> var l = objs[i].getAttribute("id");
>>>  ajax('total_treated?l=' + l, ['id'], l);
>>> # doesn't work:
>>> # ajax('{{URL('total_treated')}}**', ['id'], 'id');
>>>  }
>>> }, 1);
>>> });
>>> 
>>>
>>>
>>> In the lists.py:
>>>
>>> @auth.requires_login()
>>> def total_treated():
>>> print request.vars
>>>
>>>
>>> ERROR: 
>>>
>>> ...
>>>
>>>   File "/opt/web-apps/web2py/gluon/**globals.py", line 218, in 
>>> parse_post_vars
>>>
>>>
>>> if len(dpost):
>>>   File "/usr/local/lib/python2.7/cgi.**py", line 599, in __len__
>>>
>>>
>>> return len(self.keys())
>>>
>>>
>>>   File "/usr/local/lib/python2.7/cgi.**py", line 582, in keys
>>>
>>>
>>> raise TypeError, "not indexable"
>>> TypeError: not indexable
>>>
>>>
>>> I tried a lot of things... but without success...
>>>
>>>
>>> Help, please...
>>>
>>>
>>> Thanks!
>>>
>>>  -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: web2py binary contest

2013-10-16 Thread Niphlod
there are (ATM) no packagers being able to produce binaries for all 
platforms using a single platform (i.e., you can't build a win binary on 
linux).
BTW, you can easily redistribute the official binaries with your 
application in it, and I really don't see why your requirement needs to be 
able to build from sources web2py.

Il giorno martedì 15 ottobre 2013 10:16:53 UTC+2, Joe Barnhart ha scritto:
>
> Is the new process cross-platform?  I looked it up on the Python site and 
> it didn't say anything specific about OSX except it's compatible with "unix 
> like" operating systems.
>
> Or course, I have the weirdest requirement of all -- I'd like to automate 
> the build of a website (with data) on a Linux server and download it for 
> either Windows or Mac to run locally.  I know, not your usual requirement. 
>  My idea is to customize a site that gets downloaded by a user and run 
> locally on his laptop.
>
> -- Joe B.
>
> On Monday, October 14, 2013 12:04:31 PM UTC-7, Niphlod wrote:
>>
>> bump (@moderators, this is just to keep it in the first posts in this 
>> week)
>>
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message 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] appadmin/graph_model for other databases?

2013-10-16 Thread hiro
I store user and password information (the default config) in the default 
sqlite db but all my other data in an external PostgreSQL server.

Is it possible to create the graph created by the appadmin/graph_model 
controller for my external db?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Scheduler on Ubuntu Worker name

2013-10-16 Thread Tushar

Ubuntu 12.04
i use the command
python web2py.py -K appName

On Wednesday 16 October 2013 05:53 PM, Niphlod wrote:

a) what ubuntu ?
b) how do you start the scheduler ?



Il giorno mercoledě 16 ottobre 2013 14:06:41 UTC+2, Tushar Tuteja ha 
scritto:


Hey I am using web2py on ubuntu.
I am trying to use the scheduler but there is not workers name
that is coming .
and the task is always queued and it never runs.
I followed the video on Vimeo on scheduler.
it runs on mac but not on ubuntu.
apparently my app is hosted on a ubuntu server.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the 
Google Groups "web2py-users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/web2py/Zs7NODudXSE/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.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Scheduler on Ubuntu Worker name

2013-10-16 Thread Niphlod
ok. start it with 
python web2py.py -K appName -D 0 
that sets to DEBUG the logging level

Il giorno mercoledì 16 ottobre 2013 14:46:53 UTC+2, Tushar Tuteja ha 
scritto:
>
>  Ubuntu 12.04 
> i use the command
> python web2py.py -K appName
>
> On Wednesday 16 October 2013 05:53 PM, Niphlod wrote:
>  
> a) what ubuntu ? 
> b) how do you start the scheduler ?
>
>  
>
> Il giorno mercoledì 16 ottobre 2013 14:06:41 UTC+2, Tushar Tuteja ha 
> scritto: 
>>
>> Hey I am using web2py on ubuntu. 
>> I am trying to use the scheduler but there is not workers name that is 
>> coming .
>> and the task is always queued and it never runs.
>> I followed the video on Vimeo on scheduler.
>> it runs on mac but not on ubuntu.
>> apparently my app is hosted on a ubuntu server.
>>
>>-- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/web2py/Zs7NODudXSE/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.
>
>
> 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] can't create table on mysql when auth_user have reference field to another table

2013-10-16 Thread 黄祥
hi,

i create table from scratch on mysql using web2py 2.7.4. on windows 7 but 
return an error :

InternalError: (1005, u"Can't create table 'testingmysql.company' (errno: 150)")

when test the same code using sqlite, no errors occured

my root cause analysis is auth_user have reference field to another table.
*
*
*code :*
*### error*
models/db.py
db = DAL('mysql://root:@localhost/testingmysqlweb2py', pool_size=1, 
check_reserved=['all'], migrate=True)

db.define_table('company',
Field('name', notnull=True),
Field('home', 'text', notnull=True),
Field('about_us', 'text', notnull=True),
Field('website', notnull=True),
Field('trademark', 'upload', uploadfield = 'trademark_file', 
notnull=True),
Field('trademark_file', 'blob', notnull=True),
format='%(name)s')

db.define_table('branch',
Field('address', 'text', notnull=True),
Field('zip_code', notnull=True),
Field('city', notnull=True),
Field('country', notnull=True),
Field('phone', 'list:string', notnull=True),
Field('fax', 'list:string'),
Field('email', 'list:string', notnull=True),
Field('company', 'reference company', notnull=True),
format='%(address)s')

auth.settings.extra_fields['auth_user']=[
Field('gender', notnull=True),
Field('address', 'text', notnull=True),
Field('zip_code', notnull=True),
Field('city', notnull=True),
Field('country', notnull=True),
Field('phone', 'list:string', notnull=True),
*Field('branch', 'reference branch', notnull=True)] # root cause*

*### not error*
models/db.py
db = DAL('mysql://root:@localhost/testingmysqlweb2py', pool_size=1, 
check_reserved=['all'], migrate=True)

auth.settings.extra_fields['auth_user']=[
Field('gender', notnull=True),
Field('address', 'text', notnull=True),
Field('zip_code', notnull=True),
Field('city', notnull=True),
Field('country', notnull=True),
Field('phone', 'list:string', notnull=True)]

db.define_table('company',
Field('name', notnull=True),
Field('home', 'text', notnull=True),
Field('about_us', 'text', notnull=True),
Field('website', notnull=True),
Field('trademark', 'upload', uploadfield = 'trademark_file', 
notnull=True),
Field('trademark_file', 'blob', notnull=True),
format='%(name)s')

db.define_table('branch',
Field('address', 'text', notnull=True),
Field('zip_code', notnull=True),
Field('city', notnull=True),
Field('country', notnull=True),
Field('phone', 'list:string', notnull=True),
Field('fax', 'list:string'),
Field('email', 'list:string', notnull=True),
Field('company', 'reference company', notnull=True),
format='%(address)s')

my question is :
how can i create table on mysql when auth_user have reference field to 
another table?

thanks and best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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] updating web2py app code

2013-10-16 Thread BlueShadow
Since my original app was build with web2py 1.8.something. without any 
version control or anything like that I was wondering if there is a good 
tutorial how to set an app up with all the current features. Or if you 
think it's not worth it and never change a running system.
One thing I would love to change is to add a version control to my system. 
Is there a tutorial for that?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: TypeError: not indexable

2013-10-16 Thread __pyslan__ - Ayslan Jenken
I'll check again...


On Wed, Oct 16, 2013 at 9:25 AM, Niphlod  wrote:

> you are not using 2.7.4
> Line 218 in trunk doesn't match your traceback.
>
> https://github.com/web2py/web2py/blob/master/gluon/globals.py#L218
>
> Il giorno mercoledì 16 ottobre 2013 13:45:53 UTC+2, __pyslan__ ha scritto:
>>
>> I'm using the last version, the 2.7.4...  In version 2.7.2 the same thing
>> happened
>>
>>
>> On Wed, Oct 16, 2013 at 3:36 AM, Niphlod  wrote:
>>
>>> upgrade web2py, it's a known bug.
>>>
>>> Il giorno mercoledì 16 ottobre 2013 01:46:08 UTC+2, __pyslan__ ha
>>> scritto:
>>>
 Hello!

 I'm trying update a field (total_treated) with ajax. I'm using a
 SQLFORM.grid.

 In the index.html:

 {{extend 'masterpage.html'}}
 
 $(document).ready(function(){
 window.setInterval(function() {
 var objs = $("[name^='t_']");
  for(var i = 0; i < objs.length; i++)
 {
 var l = objs[i].getAttribute("id");
  ajax('total_treated?l=' + l, ['id'], l);
 # doesn't work:
 # ajax('{{URL('total_treated')}}', ['id'], 'id');
  }
 }, 1);
 });
 


 In the lists.py:

 @auth.requires_login()
 def total_treated():
 print request.vars


 ERROR:

 ...

   File "/opt/web-apps/web2py/gluon/**gl**obals.py", line 218, in 
 parse_post_vars


 if len(dpost):
   File "/usr/local/lib/python2.7/cgi.py", line 599, in __len__


 return len(self.keys())


   File "/usr/local/lib/python2.7/cgi.py", line 582, in keys


 raise TypeError, "not indexable"
 TypeError: not indexable


 I tried a lot of things... but without success...


 Help, please...


 Thanks!

  --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/**web2py 
>>> (Source code)
>>> - 
>>> https://code.google.com/p/**web2py/issues/list(Report
>>>  Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@**googlegroups.com.
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>
>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: admin page is not working in web2py 2.7.4

2013-10-16 Thread frasse
I am using apache-wsgi-web2py . Should I   config static  file in apache 
config files  for all app in web2py applications ? 

/frasse

Den onsdagen den 16:e oktober 2013 kl. 11:28:17 UTC+2 skrev Niphlod:
>
> did you configure your webserver to allow the static files to be served 
> with folder versioning ?
>
> as a quick way to restore things as they were is to remove this line
>
>
> https://github.com/web2py/web2py/blob/master/applications/admin/models/0.py#L84
>
> from the file.
> But, you'll be missing quite an important feature.
>
> Il giorno mercoledì 16 ottobre 2013 11:21:50 UTC+2, frasse ha scritto:
>>
>> HI 
>> I upgrade web2py to 2.7.4 from 2.7.3. admin page is not working any more 
>> please see the attach file.
>> do you have any idea ?
>>
>> Regards
>> Frasse
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: anchor ends up under black menu bar

2013-10-16 Thread Paolo Caruccio
A classic solution applied in such cases is to assign a css class (named 
for example 'hashlinked') to the target element. The related css rule is 
the following:

.hashlinked:before { 
  display: block; 
  content: " "; 
  height: 40px; /* the height of the element that hides the target */

  visibility: hidden;
}

Put the above snippet in your custom css file or in the 

[web2py] Re: admin page is not working in web2py 2.7.4

2013-10-16 Thread frasse

Hi 
here is how my config look lik. is it what you think it should be. it is 
not working . But it works for older version. 
Thanx
/F

  AliasMatch ^/([^/]+)/static/(.*) \
   /var/web2py/applications/$1/static/$2
  
Order Allow,Deny
Allow from all
  





Den onsdagen den 16:e oktober 2013 kl. 11:28:17 UTC+2 skrev Niphlod:
>
> did you configure your webserver to allow the static files to be served 
> with folder versioning ?
>
> as a quick way to restore things as they were is to remove this line
>
>
> https://github.com/web2py/web2py/blob/master/applications/admin/models/0.py#L84
>
> from the file.
> But, you'll be missing quite an important feature.
>
> Il giorno mercoledì 16 ottobre 2013 11:21:50 UTC+2, frasse ha scritto:
>>
>> HI 
>> I upgrade web2py to 2.7.4 from 2.7.3. admin page is not working any more 
>> please see the attach file.
>> do you have any idea ?
>>
>> Regards
>> Frasse
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] changing client side caching headers expires or cache-control value

2013-10-16 Thread molhokwai
Hi,

I've tried changing client side caching headers expires or cache-control 
value (from 10mns by default?), running the code below from the 
corresponding controller, but the values are unaffected.

import datetime
expires = datetime.datetime.now()+datetime.timedelta(0,365*24*3600)
# ex: Fri, 01 Jan 1990 00:00:00 GMT
response.headers['Expires'] = expires.strftime("%a, %d %b %Y 
%H:%M:%S GMT")
response.headers['Cache-Control'] = 
'public,max-age:%i,must-revalidate' % (365*24*3600)


How should this be done?

Thanks
-molhokwai

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Integrated IDE does not color javascript code

2013-10-16 Thread António Ramos
hello,
javascript is not colored in the integrated ide of web2py

Is it possible to activate some type of colors?

Thank you

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Change name of file inserted via upload field at download time

2013-10-16 Thread Jordan Ladora
Hi Anthony,

Thanks for the help.

The download_path variable doesn't change regardless of whether the 
download() function includes, or is passed, the 'download_filename' arg. 
Indeed, the file downloads successfully when the download function is the 
default, ie -

def download():
return response.download(request, db)

..and when download() is called with just this one arg -

{{=A('Download', _href=URL('default', 'download', 
args=download_path))}}   


When I added the second parameter to the call to download()-

{{=A('Download w title', _href=URL('default', 'download', 
args=[download_path, 'new_title']))}}   

..I changed the download() function in the default controller to this-

def download():
return response.download(request, db, attachment=True, 
download_filename=request.args(1))


The db field from the model looks like this-
Field('file', 'upload', length=128, autodelete=True, 
requires=IS_NOT_EMPTY()), 


It might be most telling to show the links that are generated in the view.. 
the [working] link for -
{{=A('Download', _href=URL('default', 'download', 
args=download_path))}}   

..looks like:
http://127.0.0.1:8000/test_app/default/download/main_db.file.b36e427143f2c727.64633532346236612d373033622d343235352d383330302d616362613637366136396262.txt


And the link for -
{{=A('Download w title', _href=URL('default', 'download', 
args=[download_path, 'new_title']))}}   

..looks like:
http://127.0.0.1:8000/test_app/default/download/main_db.file.b36e427143f2c727.64633532346236612d373033622d343235352d383330302d616362613637366136396262.txt/new_title


The latter generates the 404 error. As you can see, when I add the 
'download_filename' arg, a new path is generated with the desired filename 
appended to the path, which doesn't seem to make sense.

Thanks again for your help. Let me know if there is any more info I can 
provide.

Cheers,
jl
 




On Tuesday, October 15, 2013 8:21:42 PM UTC-7, Anthony wrote:
>
> We need to see more code -- maybe your model and the code that generates 
> the value of download_path. response.download() will return a 404 if the 
> filename is not of the right format, it can't find the table/field, or it 
> can't retrieve the file.
>
> Anthony
>
> On Tuesday, October 15, 2013 10:06:45 PM UTC-4, Jordan Ladora wrote:
>>
>> Ha! Thanks for that.. I upgraded to 2.7.4. but get 404 not found when I 
>> use Anthony's code..
>>
>> in the view-
>>
>> {{=A('Download', _href=URL('default', 'download', 
>> args=download_path))}}   
>> {{=A('Download w title', _href=URL('default', 'download', 
>> args=[download_path, 'new_title']))}}   
>>
>>
>> in default.py-
>>
>> @auth.requires_login()
>> def download():
>> """
>> allows downloading of uploaded files
>> http:///[app]/default/download/[filename]
>> """
>> ##response.download(self, request, db, chunk_size=DEFAULT_CHUNK_SIZE, 
>> attachment=True, download_filename=None):
>> return response.download(request, db, 
>> download_filename=request.args(1))
>>
>>
>> ...hopefully there is something else silly that i am doing wrong here...?
>>
>> Thanks,
>> jl
>>
>>
>> On Tuesday, October 15, 2013 3:01:49 PM UTC-7, Niphlod wrote:
>>>
>>> You're using an old version of web2py :D
>>>
>>> On Tuesday, October 15, 2013 11:40:55 PM UTC+2, Jordan Ladora wrote:

 Err.. I get an unknown parameter error for the 'download_filename' .. 
 looking into globals.py I see 

 def download(self, request, db, chunk_size=DEFAULT_CHUNK_SIZE, 
 attachment=True):

 so I'm not sure about where this parameter goes(?)

 Thanks,
 -j

>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Change name of file inserted via upload field at download time

2013-10-16 Thread Anthony
Sorry, turns out the filename stored in the db must be the *last* URL 
argument, not the first -- so the order of the URL args should be reversed. 
Actually, there are some limitations regarding characters allowed in URL 
args, so it might be a better idea to put the new filename in the query 
string (i.e., a URL variable):

URL('default', 'download', args=download_path, vars=dict(filename=
'new_title'))

The download function would then be:

def download():
return response.download(request, db, download_filename=request.vars.
filename)

And yes, the new file name will appear in the URL -- that's how it is 
communicated to the download function.

Anthony

On Wednesday, October 16, 2013 11:31:49 AM UTC-4, Jordan Ladora wrote:
>
> Hi Anthony,
>
> Thanks for the help.
>
> The download_path variable doesn't change regardless of whether the 
> download() function includes, or is passed, the 'download_filename' arg. 
> Indeed, the file downloads successfully when the download function is the 
> default, ie -
>
> def download():
> return response.download(request, db)
>
> ..and when download() is called with just this one arg -
>
> {{=A('Download', _href=URL('default', 'download', 
> args=download_path))}}   
>
>
> When I added the second parameter to the call to download()-
>
> {{=A('Download w title', _href=URL('default', 'download', 
> args=[download_path, 'new_title']))}}   
>
> ..I changed the download() function in the default controller to this-
>
> def download():
> return response.download(request, db, attachment=True, 
> download_filename=request.args(1))
>
>
> The db field from the model looks like this-
> Field('file', 'upload', length=128, autodelete=True, 
> requires=IS_NOT_EMPTY()), 
>
>
> It might be most telling to show the links that are generated in the 
> view.. the [working] link for -
> {{=A('Download', _href=URL('default', 'download', 
> args=download_path))}}   
>
> ..looks like:
>
> http://127.0.0.1:8000/test_app/default/download/main_db.file.b36e427143f2c727.64633532346236612d373033622d343235352d383330302d616362613637366136396262.txt
>
>
> And the link for -
> {{=A('Download w title', _href=URL('default', 'download', 
> args=[download_path, 'new_title']))}}   
>
> ..looks like:
>
> http://127.0.0.1:8000/test_app/default/download/main_db.file.b36e427143f2c727.64633532346236612d373033622d343235352d383330302d616362613637366136396262.txt/new_title
>
>
> The latter generates the 404 error. As you can see, when I add the 
> 'download_filename' arg, a new path is generated with the desired filename 
> appended to the path, which doesn't seem to make sense.
>
> Thanks again for your help. Let me know if there is any more info I can 
> provide.
>
> Cheers,
> jl
>  
>
>
>
>
> On Tuesday, October 15, 2013 8:21:42 PM UTC-7, Anthony wrote:
>>
>> We need to see more code -- maybe your model and the code that generates 
>> the value of download_path. response.download() will return a 404 if the 
>> filename is not of the right format, it can't find the table/field, or it 
>> can't retrieve the file.
>>
>> Anthony
>>
>> On Tuesday, October 15, 2013 10:06:45 PM UTC-4, Jordan Ladora wrote:
>>>
>>> Ha! Thanks for that.. I upgraded to 2.7.4. but get 404 not found when I 
>>> use Anthony's code..
>>>
>>> in the view-
>>>
>>> {{=A('Download', _href=URL('default', 'download', 
>>> args=download_path))}}   
>>> {{=A('Download w title', _href=URL('default', 'download', 
>>> args=[download_path, 'new_title']))}}   
>>>
>>>
>>> in default.py-
>>>
>>> @auth.requires_login()
>>> def download():
>>> """
>>> allows downloading of uploaded files
>>> http:///[app]/default/download/[filename]
>>> """
>>> ##response.download(self, request, db, 
>>> chunk_size=DEFAULT_CHUNK_SIZE, attachment=True, download_filename=None):
>>> return response.download(request, db, 
>>> download_filename=request.args(1))
>>>
>>>
>>> ...hopefully there is something else silly that i am doing wrong here...?
>>>
>>> Thanks,
>>> jl
>>>
>>>
>>> On Tuesday, October 15, 2013 3:01:49 PM UTC-7, Niphlod wrote:

 You're using an old version of web2py :D

 On Tuesday, October 15, 2013 11:40:55 PM UTC+2, Jordan Ladora wrote:
>
> Err.. I get an unknown parameter error for the 'download_filename' .. 
> looking into globals.py I see 
>
> def download(self, request, db, chunk_size=DEFAULT_CHUNK_SIZE, 
> attachment=True):
>
> so I'm not sure about where this parameter goes(?)
>
> Thanks,
> -j
>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https:/

[web2py] one to many relationship DB structure

2013-10-16 Thread raferbop
db.define_table(
'auth_user',
Field('id'),
Field('first_name', type='string',
label=T('First Name')),
Field('last_name', type='string',
label=T('Last Name')), 
Field('email', type='string',
label=T('Email')),  
Field('password', type='password',
readable=False,
label=T('Password')))

db.define_table(
'sale',
Field('id', db.auth_user, default=auth.user_id),
Field('start_date', 'date', requires=IS_DATE()),
Field('end_date', 'date', requires=IS_DATE()),
Field('start_time', 'time', requires = IS_TIME()),
Field('end_time', 'time', requires = IS_TIME()))

db.define_table(
'product',
Field('sale_id', db.sale),
Field('name', requires = IS_NOT_EMPTY()),
Field('price', 'double', default=0.00),
Field('description','text'),
Field('image', 'upload', default=''),
format = '%(name)s %(price)s')



def sale():
form = SQLFORM(db.sale)
if form.process().accepted:
response.flash = 'Auction Created'
redirect(URL('properties'))
return dict(form=form)

In the above code, I have 3 db tables in the db.py file (user, sale and 
product). In addition, I have defined the 'sale' function in the default.py 
file in the controller. The issue that I am experiencing is that when I 
create a new sale, the user id shows up in the sales form, but when I 
submit the sales form and redirect to the product form, the sale id field 
is blank. I thought the "Field('sale_id', db.sale)," would have reference 
the sale id in the product form. What am I missing? 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: updating web2py app code

2013-10-16 Thread 黄祥
imho, you should use version control (git, subversion, mercurial, etc) to 
take control for your code . and for change a running system, imho, u 
should upgrade to the latest version (for bug fixing purpose, security 
hole, etc), but test it carefully first before you upgrade your system (in 
testing environment). for tutorial, what kind of version control do you 
want to use? every version control have it's own way. e.g. git versioning 
way is different with subversion or mercurial, please refer to the manual 
on their website and documentation.

best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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: one to many relationship DB structure

2013-10-16 Thread 黄祥
yeah, my pov is because your product never save the sale id. imho, i think 
your code should be :
db.define_table(
'sale',
Field('product_id', 'reference product'),
Field('user_id', db.auth_user, default=auth.user_id),
Field('start_date', 'date', requires=IS_DATE()),
Field('end_date', 'date', requires=IS_DATE()),
Field('start_time', 'time', requires = IS_TIME()),
Field('end_time', 'time', requires = IS_TIME()))

db.define_table(
'product',
Field('name', requires = IS_NOT_EMPTY()),
Field('price', 'double', default=0.00),
Field('description','text'),
Field('image', 'upload', default=''),
format = '%(name)s %(price)s')

because 1 sale has many product and each product belongs to sale, isn't it?
1 more thing please don't use id as your field name, because by default 
web2py use it as a primary key.
taken from book :

   - Each table must have a unique auto-increment integer field called "id"
   - Records must be referenced exclusively using the "id" field.

ref:
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Legacy-databases-and-keyed-tables

best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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: Using common_filter to restrict access by groups

2013-10-16 Thread 黄祥
i think you can achieve it using access control. please read the book about 
access control in authorization.
ref:
http://web2py.com/books/default/chapter/29/09/access-control#Authorization

best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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: anchor ends up under black menu bar

2013-10-16 Thread Carlos Hanson
Thanks. That works quite well. While I realize that I can use make the 
target element be anything I want like the H1 tag in this example, the 
anchor is created by a web text editor called CKEditor. I'll have to see 
what I can do to add the class when the anchor is created.

Thanks again.

On Wednesday, October 16, 2013 7:08:06 AM UTC-7, Paolo Caruccio wrote:
>
> A classic solution applied in such cases is to assign a css class (named 
> for example 'hashlinked') to the target element. The related css rule is 
> the following:
>
> .hashlinked:before { 
>   display: block; 
>   content: " "; 
>   height: 40px; /* the height of the element that hides the target */
>   margin-top: -40px; /* the negative value as above */
>   visibility: hidden;
> }
>
> Put the above snippet in your custom css file or in the 

[web2py] Re: one to many relationship DB structure

2013-10-16 Thread raferbop
Thanks Stifan, 

But that doesn't work either, because the product_id now displays in the 
sale form. I need to generate the sale_id first, and then have sow in the 
product table/form. Right now, it just shows up blank. 

On Wednesday, October 16, 2013 11:08:58 AM UTC-5, 黄祥 wrote:
>
> yeah, my pov is because your product never save the sale id. imho, i think 
> your code should be :
> db.define_table(
> 'sale',
> Field('product_id', 'reference product'),
> Field('user_id', db.auth_user, default=auth.user_id),
> Field('start_date', 'date', requires=IS_DATE()),
> Field('end_date', 'date', requires=IS_DATE()),
> Field('start_time', 'time', requires = IS_TIME()),
> Field('end_time', 'time', requires = IS_TIME()))
>
> db.define_table(
> 'product',
> Field('name', requires = IS_NOT_EMPTY()),
> Field('price', 'double', default=0.00),
> Field('description','text'),
> Field('image', 'upload', default=''),
> format = '%(name)s %(price)s')
>
> because 1 sale has many product and each product belongs to sale, isn't it?
> 1 more thing please don't use id as your field name, because by default 
> web2py use it as a primary key.
> taken from book :
>
>- Each table must have a unique auto-increment integer field called 
>"id"
>- Records must be referenced exclusively using the "id" field.
>
> ref:
>
> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Legacy-databases-and-keyed-tables
>
> best regards,
> stifan
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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] Cassandra Support

2013-10-16 Thread Amit Saharana
Hi, just for information, does web2py support Cassandra Database. I didn't 
get any specific information about it through search engines.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] SQLFORM.grid prints output to console

2013-10-16 Thread Hadi Sunyoto
I just check the newest version 2.7.4 in windows, when i display the data 
grid with 10 columns, it will print each row to console 10 times. Is this 
correct behavior or someone forget to turn off the "print" statement during 
debugging?

As for 2.7.4, the virtual columns works, and i don't have to specify the 
fields again. Thanks

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: web2py 2.7.4 is OUT

2013-10-16 Thread Róbert Bárdonicsek
Hi!

I have many error :(

https://localhost/admin/static/_2.7.3/js/jquery.js

_2.7.3 directory doesn't.

what's wrong?

2013. október 14., hétfő 17:35:17 UTC+2 időpontban Massimo Di Pierro a 
következőt írta:
>
> there is no new changelog. It is mostly bug fixes.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to 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.7.4 is OUT

2013-10-16 Thread Róbert Bárdonicsek
admin interface is wrong.

Many error :

https://localhost/admin/static/_2.7.3/css/bootstrap_essentials.css


2013. október 14., hétfő 17:35:17 UTC+2 időpontban Massimo Di Pierro a 
következőt írta:
>
> there is no new changelog. It is mostly bug fixes.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to 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] web2py vs webapp2 for bootstrap+gae combo

2013-10-16 Thread Saisha D
Hi,

 I'm trying to quickly set up a website w/o prior experience. Pretty 
familiar with Python and hence leaning towards web2py 
since I heard good things and am impressed by the support/community around 
it.

I am going to use AppEngine for backend store with NDB API, and am 
considering Twitter boostrap for UI as well since my friend who'll work 
with me knows bootstrap decently.

This is the other one I'm considering, 
https://github.com/coto/gae-boilerplate
It has a bunch of things set up that I need (gae ndb, twitter bootstrap, 
login support etc)
but my main worry is that there does not seem to be as much 
traction/support around it as web2py.

Am I going along the right path?
Is the integration with GAE and twitter bootstrap easy and tried before so 
that I can focus on building my app?  (sorry my search so far in this group 
did not throw up anything obvious)

many thanks in advance!!

S


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] gae boilerplate vs web2py

2013-10-16 Thread Saisha D
Hi All, 
 Apologies if this is a repost, my last post did not go through for many 
hours, posting again.

I'm a newbie to web development, but quite familiar with python (use it at 
work), I'm trying to quickly prototype some ideas for a startup website.
My goal is to deploy it initially with app engine, I also heard that 
twitter bootstrap is very helpful for UI.

I found https://github.com/coto/gae-boilerplate after googling, and almost 
settled on it since it had
gae ndb support, webapp2, federated login, twitter bootstrap and all this 
hooked together.

but my friend pointed to me that web2py is a better option and it's much 
better supported (as I can see from this user group).

My question for you folks:
Am I making the right decision to go towards web2py?
Is twitter bootstrap built into web2py or some form of it, or can it be 
hooked into it, 
Can I use NDB for google app engine(free account)?

Please point me to any prior posts/articles on this topic if all this has 
been answered 

Thanks in advance
Saisha

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: web2py 2.7.4 is OUT

2013-10-16 Thread Richard Vézina
If it user response.static_version, maybe the proper version haven't been
set at the level of repository can't say, but I guess so.

Have a look at the version file of web2py...

Richard


On Wed, Oct 16, 2013 at 3:13 AM, Róbert Bárdonicsek wrote:

> Hi!
>
> I have many error :(
>
> https://localhost/admin/static/_2.7.3/js/jquery.js
>
> _2.7.3 directory doesn't.
>
> what's wrong?
>
>
> 2013. október 14., hétfő 17:35:17 UTC+2 időpontban Massimo Di Pierro a
> következőt írta:
>
>> there is no new changelog. It is mostly bug fixes.
>>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to 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.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: web2py 2.7.4 is OUT

2013-10-16 Thread Richard Vézina
Or the version file have not been updated according to the flagged version
of the repo.

Richard


On Wed, Oct 16, 2013 at 1:42 PM, Richard Vézina  wrote:

> If it user response.static_version, maybe the proper version haven't been
> set at the level of repository can't say, but I guess so.
>
> Have a look at the version file of web2py...
>
> Richard
>
>
> On Wed, Oct 16, 2013 at 3:13 AM, Róbert Bárdonicsek wrote:
>
>> Hi!
>>
>> I have many error :(
>>
>> https://localhost/admin/static/_2.7.3/js/jquery.js
>>
>> _2.7.3 directory doesn't.
>>
>> what's wrong?
>>
>>
>> 2013. október 14., hétfő 17:35:17 UTC+2 időpontban Massimo Di Pierro a
>> következőt írta:
>>
>>> there is no new changelog. It is mostly bug fixes.
>>>
>>  --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to 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.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Change name of file inserted via upload field at download time

2013-10-16 Thread Jordan Ladora
This is great - works perfectly. 

Thanks again for all the help!
j

On Wednesday, October 16, 2013 8:46:46 AM UTC-7, Anthony wrote:
>
> Sorry, turns out the filename stored in the db must be the *last* URL 
> argument, not the first -- so the order of the URL args should be reversed. 
> Actually, there are some limitations regarding characters allowed in URL 
> args, so it might be a better idea to put the new filename in the query 
> string (i.e., a URL variable):
>
> URL('default', 'download', args=download_path, vars=dict(filename=
> 'new_title'))
>
> The download function would then be:
>
> def download():
> return response.download(request, db, download_filename=request.vars.
> filename)
>
> And yes, the new file name will appear in the URL -- that's how it is 
> communicated to the download function.
>
> Anthony
>
> On Wednesday, October 16, 2013 11:31:49 AM UTC-4, Jordan Ladora wrote:
>>
>> Hi Anthony,
>>
>> Thanks for the help.
>>
>> The download_path variable doesn't change regardless of whether the 
>> download() function includes, or is passed, the 'download_filename' arg. 
>> Indeed, the file downloads successfully when the download function is the 
>> default, ie -
>>
>> def download():
>> return response.download(request, db)
>>
>> ..and when download() is called with just this one arg -
>>
>> {{=A('Download', _href=URL('default', 'download', 
>> args=download_path))}}   
>>
>>
>> When I added the second parameter to the call to download()-
>>
>> {{=A('Download w title', _href=URL('default', 'download', 
>> args=[download_path, 'new_title']))}}   
>>
>> ..I changed the download() function in the default controller to this-
>>
>> def download():
>> return response.download(request, db, attachment=True, 
>> download_filename=request.args(1))
>>
>>
>> The db field from the model looks like this-
>> Field('file', 'upload', length=128, autodelete=True, 
>> requires=IS_NOT_EMPTY()), 
>>
>>
>> It might be most telling to show the links that are generated in the 
>> view.. the [working] link for -
>> {{=A('Download', _href=URL('default', 'download', 
>> args=download_path))}}   
>>
>> ..looks like:
>>
>> http://127.0.0.1:8000/test_app/default/download/main_db.file.b36e427143f2c727.64633532346236612d373033622d343235352d383330302d616362613637366136396262.txt
>>
>>
>> And the link for -
>> {{=A('Download w title', _href=URL('default', 'download', 
>> args=[download_path, 'new_title']))}}   
>>
>> ..looks like:
>>
>> http://127.0.0.1:8000/test_app/default/download/main_db.file.b36e427143f2c727.64633532346236612d373033622d343235352d383330302d616362613637366136396262.txt/new_title
>>
>>
>> The latter generates the 404 error. As you can see, when I add the 
>> 'download_filename' arg, a new path is generated with the desired filename 
>> appended to the path, which doesn't seem to make sense.
>>
>> Thanks again for your help. Let me know if there is any more info I can 
>> provide.
>>
>> Cheers,
>> jl
>>  
>>
>>
>>
>>
>> On Tuesday, October 15, 2013 8:21:42 PM UTC-7, Anthony wrote:
>>>
>>> We need to see more code -- maybe your model and the code that generates 
>>> the value of download_path. response.download() will return a 404 if the 
>>> filename is not of the right format, it can't find the table/field, or it 
>>> can't retrieve the file.
>>>
>>> Anthony
>>>
>>> On Tuesday, October 15, 2013 10:06:45 PM UTC-4, Jordan Ladora wrote:

 Ha! Thanks for that.. I upgraded to 2.7.4. but get 404 not found when I 
 use Anthony's code..

 in the view-

 {{=A('Download', _href=URL('default', 'download', 
 args=download_path))}}   
 {{=A('Download w title', _href=URL('default', 'download', 
 args=[download_path, 'new_title']))}}   


 in default.py-

 @auth.requires_login()
 def download():
 """
 allows downloading of uploaded files
 http:///[app]/default/download/[filename]
 """
 ##response.download(self, request, db, 
 chunk_size=DEFAULT_CHUNK_SIZE, attachment=True, download_filename=None):
 return response.download(request, db, 
 download_filename=request.args(1))


 ...hopefully there is something else silly that i am doing wrong 
 here...?

 Thanks,
 jl


 On Tuesday, October 15, 2013 3:01:49 PM UTC-7, Niphlod wrote:
>
> You're using an old version of web2py :D
>
> On Tuesday, October 15, 2013 11:40:55 PM UTC+2, Jordan Ladora wrote:
>>
>> Err.. I get an unknown parameter error for the 'download_filename' .. 
>> looking into globals.py I see 
>>
>> def download(self, request, db, chunk_size=DEFAULT_CHUNK_SIZE, 
>> attachment=True):
>>
>> so I'm not sure about where this parameter goes(?)
>>
>> Thanks,
>> -j
>>
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://

Re: [web2py] changing client side caching headers expires or cache-control value

2013-10-16 Thread molhokwai
Well...
It doesn't seem to work on  local dev_appserver, but it actually works,
when deployed on appspot.com...
So, anyway, problem solved...

Thanks



On Wed, Oct 16, 2013 at 4:14 PM, molhokwai  wrote:

> Hi,
>
> I've tried changing client side caching headers expires or cache-control
> value (from 10mns by default?), running the code below from the
> corresponding controller, but the values are unaffected.
>
> import datetime
> expires = datetime.datetime.now()+datetime.timedelta(0,365*24*3600
> )
> # ex: Fri, 01 Jan 1990 00:00:00 GMT
> response.headers['Expires'] = expires.strftime("%a, %d %b %Y
> %H:%M:%S GMT")
> response.headers['Cache-Control'] =
> 'public,max-age:%i,must-revalidate' % (365*24*3600)
>
>
> How should this be done?
>
> Thanks
> -molhokwai
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/BMxhOL_X2y8/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.
>



-- 
-
*M*T, *M*olhokwai
*+32 489 33 71 51, molhok...@gmail.com, chat/voip(gtalk):molhokwai*
*
*
Don DeLillo: Underworld |  Don DeLillo: Cosmopolis | The Matrix: The
Architect | Brandford Marsalis: Mr J.C.
(Live) | Ursula K. LeGuin: The Dispossessed | Annares | Robert Zemeckis:
Contact |  What the *bleep* do we
know... | E.J. Strickland: In this Day | Jeff Buckley: Grace | Qawalis
| Genesis: FoxTrot | XXX | Artémise &
Mausole | XXX | Le Taj Mahal | Slow | Infinity | Khalasa | Google
| Coltrane | X-Men III: The Phoenix | RATM |
Jean D'ormesson: Le Juif Errant | Les Quatre Incommensurables | Edgar Allan
Poe: Ms found in a bottle | 7 |
Georges Clooney: Confession of a dangerous Mind | The hand of God |
Dreaming Bear Kanaan |
Implementing change | Amin Maalouf: Le Rocher de Tanios | 9 | The Grand
Cycle | The Beyonder | The
Venus Project | Patrick Suskind: Le Parfum | Ethan & Lucas Vorly | Khaili
Gibran: On Love |
Urbanfarming.org | Planck's Constant | Gemineye: Poetic bloodline |
Moving-planet.org | 350.org | Bree
Olson | Jacques Audiard: Sur mes lèvres | Raymond Devos | Terrence Mc Kenna
| Alan Watts | Mindwalk:
 Liv Ullman's Sophia Hoffman | ...

*Let's talk*

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Calling a function while adding an entry to auth_user table

2013-10-16 Thread ranjith
Hi,

I want to add a membership to a user when a new user is added to the 
auth_user table. It is possible when the user registers via the front end 
through the callback auth.settings.register_onaccept.

But in my case, I am adding the bulk entries to the auth_user table using 
the script. So, now, while entries getting added to the auth_user, how to 
add the permission for the different set of users?

Please help

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Scheduler on Ubuntu Worker name

2013-10-16 Thread Tushar

I started with that only, but it is still now working.
SO I'll tell you what I did.
I made a file sched.py
*# coding: utf8**
**def fun():**
**import time**
**print 'selecting mails'**
**rows = db(db.queue.status=='pending').select()**
**for row in rows:**
**print 'sending mails'**
**if mail.send(to=row.email,**
**subject=row.subject,**
**message=row.message_body):**
**row.update_record(status='sent')**
**else:**
**row.update_record(status='failed')**
**db.commit()**

**from gluon.scheduler import Scheduler**
**Scheduler(db,dict(func=fun))*

then I edited the table scheduler_task
these are my values
scheduler_task.id 	scheduler_task.application_name 
scheduler_task.task_name 	scheduler_task.group_name 
scheduler_task.status 	scheduler_task.function_name 
scheduler_task.uuid 	scheduler_task.args 	scheduler_task.vars 
scheduler_task.enabled 	scheduler_task.start_time 
scheduler_task.next_run_time 	scheduler_task.stop_time 
scheduler_task.repeats 	scheduler_task.retry_failed 
scheduler_task.period 	scheduler_task.timeout 
scheduler_task.sync_output 	scheduler_task.times_run 
scheduler_task.times_failed 	scheduler_task.last_run_time 
scheduler_task.assigned_worker_name
2 	b/appadmin 	mail 	main 	QUEUED 	func 
85ebf3d6-35f8-4c6a-ac08-6477ee2af6b7 	[] 	{} 	True 	2013-10-16 
17:26:38 	2013-10-16 17:26:38 	 	3 	0 	10 	60 	0 	3 	0 	 
tushar-VPCEB26FG#26573




and then I used this command
python web2py.py -K appName -D 0


it is still not sending mails and I get this in the console
"DEBUG:web2py.scheduler.tushar-VPCEB26FG#26573:looping...
INFO:web2py.scheduler.tushar-VPCEB26FG#26573:nothing to do
DEBUG:web2py.scheduler.tushar-VPCEB26FG#26573:sleeping...
DEBUG:web2py.scheduler.tushar-VPCEB26FG#26573:recording 
heartbeat (ACTIVE)

DEBUG:web2py.scheduler.tushar-VPCEB26FG#26573:looping...
INFO:web2py.scheduler.tushar-VPCEB26FG#26573:nothing to do
DEBUG:web2py.scheduler.tushar-VPCEB26FG#26573:sleeping...
DEBUG:web2py.scheduler.tushar-VPCEB26FG#26573:recording 
heartbeat (ACTIVE)

DEBUG:web2py.scheduler.tushar-VPCEB26FG#26573:looping...
INFO:web2py.scheduler.tushar-VPCEB26FG#26573:nothing to do
DEBUG:web2py.scheduler.tushar-VPCEB26FG#26573:sleeping...
DEBUG:web2py.scheduler.tushar-VPCEB26FG#26573:recording 
heartbeat (ACTIVE)



thanks,

regards,

Tushar Tuteja
"
On Wednesday 16 October 2013 06:34 PM, Niphlod wrote:

ok. start it with
python web2py.py -K appName -D 0
that sets to DEBUG the logging level

Il giorno mercoledě 16 ottobre 2013 14:46:53 UTC+2, Tushar Tuteja ha 
scritto:


Ubuntu 12.04
i use the command
python web2py.py -K appName

On Wednesday 16 October 2013 05:53 PM, Niphlod wrote:

a) what ubuntu ?
b) how do you start the scheduler ?



Il giorno mercoledě 16 ottobre 2013 14:06:41 UTC+2, Tushar Tuteja
ha scritto:

Hey I am using web2py on ubuntu.
I am trying to use the scheduler but there is not workers
name that is coming .
and the task is always queued and it never runs.
I followed the video on Vimeo on scheduler.
it runs on mac but not on ubuntu.
apparently my app is hosted on a ubuntu server.

-- 
Resources:

- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py
 (Source code)
- https://code.google.com/p/web2py/issues/list
 (Report Issues)
---
You received this message because you are subscribed to a topic
in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/web2py/Zs7NODudXSE/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
.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the 
Google Groups "web2py-users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/web2py/Zs7NODudXSE/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.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and

[web2py] Experience With TKL Web2Py? - Changing Web2Py defaults to TKL Web2Py defaults.

2013-10-16 Thread james c.


The development defaults for a Web2Py App are Rocket Server and SQL Light. 
I've deployed my application through the TKL hub and have kept the Web2Py 
default configuration. My app runs fast on the local development system and 
very slow on a small instance EC2 deployed through the TKL hub.

I expect the first steps to improve performance is to change my apps 
defaults to use TKL appliance defaults MySQL and Apache. Also, I have not 
yet turned on TKL backup and migration.

1) I expect if I turn on TKL backup and migration, then after changing to 
MySQL I will be able to restore the SQLLight data to MySQL. *Is this true?*

2) When I first deployed through TKL, I found some TKL documentation, on 
changing db connection strings within the Web2Py app to point to the TKL 
deployed MySQL and documentation to replace RocketServer with Apache. I've 
searched and having trouble locating this information. *Can someone please 
point me to the deployment documentation for MySQL and Apache using TKL 
Web2Py?*

thanks in advance for any help, James

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Experience With TKL Web2Py? - Changing Web2Py defaults to TKL Web2Py defaults.

2013-10-16 Thread Niphlod
is TKL turnkey Linux ? If yes, who is the maintainer of that distribution ? 
He's the man to contact for such info
Running web2py with rocket and sqlite is something that should really 
happen only on your pc while you develop.
Your production env should use a real backend (mysql is fine, but 
postgresql has less troubles) and a real webserver (apache is fine but for 
some time is NOT the fastest NOR the easier to configure).
SQLite to MySQL transition of data may be smooth of incur in some problems: 
it all depends on how complicated your data model is. 
For point 2), really, you need to contact whoever packaged that image. 

On Wednesday, October 16, 2013 8:31:06 PM UTC+2, james c. wrote:
>
> The development defaults for a Web2Py App are Rocket Server and SQL Light. 
> I've deployed my application through the TKL hub and have kept the Web2Py 
> default configuration. My app runs fast on the local development system and 
> very slow on a small instance EC2 deployed through the TKL hub.
>
> I expect the first steps to improve performance is to change my apps 
> defaults to use TKL appliance defaults MySQL and Apache. Also, I have not 
> yet turned on TKL backup and migration.
>
> 1) I expect if I turn on TKL backup and migration, then after changing to 
> MySQL I will be able to restore the SQLLight data to MySQL. *Is this true?
> *
>
> 2) When I first deployed through TKL, I found some TKL documentation, on 
> changing db connection strings within the Web2Py app to point to the TKL 
> deployed MySQL and documentation to replace RocketServer with Apache. I've 
> searched and having trouble locating this information. *Can someone 
> please point me to the deployment documentation for MySQL and Apache using 
> TKL Web2Py?*
>
> thanks in advance for any help, James
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Scheduler on Ubuntu Worker name

2013-10-16 Thread Niphlod
the scheduler is running fine.
In the data you pasted here there's the reason why the scheduler isn't 
picking up any new task.
times_run is 3 and repeats is set to 3, so the task got executed 3 times 
already.

Sidenote: append a "return 1" to your function, so you'll get scheduler_run 
records holding more details about the executions, until you figure out the 
issues you're having on what to choose when you queue the task.

Also, please do

sched = Scheduler(db, dict(fun=func))

sched.queue_task('func', uuid='test_insert', repeats=3, period=10)

without any worker running, so you can see what is inserted into the 
scheduler_task table correctly.
Execute the sched.queue_task just one time only (if you put that in models, 
it will be executed at every request and that would be inefficient)


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Calling a function while adding an entry to auth_user table

2013-10-16 Thread Niphlod
use DAL callbacks if you need "mass inserts" to work in the same way. 

http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#before-and-after-callbacks

On Wednesday, October 16, 2013 8:07:06 PM UTC+2, ranjith wrote:
>
> Hi,
>
> I want to add a membership to a user when a new user is added to the 
> auth_user table. It is possible when the user registers via the front end 
> through the callback auth.settings.register_onaccept.
>
> But in my case, I am adding the bulk entries to the auth_user table using 
> the script. So, now, while entries getting added to the auth_user, how to 
> add the permission for the different set of users?
>
> Please help
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Scheduler on Ubuntu Worker name

2013-10-16 Thread Tushar Tuteja
thanks a ton,
I ll try this and what would be appropriate place to insert the file , so
that it is not efficient.

thanks,

regards,

Tushar Tuteja


On 17 October 2013 00:22, Niphlod  wrote:

> the scheduler is running fine.
> In the data you pasted here there's the reason why the scheduler isn't
> picking up any new task.
> times_run is 3 and repeats is set to 3, so the task got executed 3 times
> already.
>
> Sidenote: append a "return 1" to your function, so you'll get
> scheduler_run records holding more details about the executions, until you
> figure out the issues you're having on what to choose when you queue the
> task.
>
> Also, please do
>
> sched = Scheduler(db, dict(fun=func))
>
> sched.queue_task('func', uuid='test_insert', repeats=3, period=10)
>
> without any worker running, so you can see what is inserted into the
> scheduler_task table correctly.
> Execute the sched.queue_task just one time only (if you put that in
> models, it will be executed at every request and that would be inefficient)
>
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/Zs7NODudXSE/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.
>



-- 
Tushar Tuteja
Undergraduate Student(Fourth Year)
Civil Engineering
IIT Delhi
+919953061943
ttut...@gmail.com 
ce1090...@civil.iitd.ernet.in
"The question isn't who is going to let me; its who is going to stop me!" -
Howard Roark

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: web2py 2.7.4 is OUT

2013-10-16 Thread Niphlod
it's not an error, it's a feature we enabled for admin (at last) in 
combination with your webserver setup lagging behind. 

web2py.com/books/default/chapter/29/04/the-core#Static-asset-management

BTW, we have static_version roughly since Oct 2012.

On Wednesday, October 16, 2013 7:43:30 PM UTC+2, Richard wrote:
>
> Or the version file have not been updated according to the flagged version 
> of the repo.
>
> Richard
>
>
> On Wed, Oct 16, 2013 at 1:42 PM, Richard Vézina 
> 
> > wrote:
>
>> If it user response.static_version, maybe the proper version haven't been 
>> set at the level of repository can't say, but I guess so.
>>
>> Have a look at the version file of web2py...
>>
>> Richard
>>
>>
>> On Wed, Oct 16, 2013 at 3:13 AM, Róbert Bárdonicsek 
>> 
>> > wrote:
>>
>>> Hi!
>>>
>>> I have many error :(
>>>
>>> https://localhost/admin/static/_2.7.3/js/jquery.js
>>>
>>> _2.7.3 directory doesn't.
>>>
>>> what's wrong?
>>>
>>>
>>> 2013. október 14., hétfő 17:35:17 UTC+2 időpontban Massimo Di Pierro a 
>>> következőt írta:
>>>
 there is no new changelog. It is mostly bug fixes.

>>>  -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to 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.
>>>
>>
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: admin page is not working in web2py 2.7.4

2013-10-16 Thread Niphlod
you should use another syntax to have static files served with 
static_version enabled.

https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-ubuntu.sh#L110

For the ones not really accustomed with regexes, all we're trying to do is 
the following
We have a file  
/appname/static/abc.css

we want to serve it as 
/appname/static/abc.css
AND as
/appname/static/_1.2.3/abc.css
OR
/appname/static/_2.3.1/abc.css
etc etc

so

AliasMatch 
^/([^/]+)/static/*(?:_[\d]+.[\d]+.[\d]+/)?*(.*)/home/www-data/web2py/applications/
$1/static/$2

The *bold red *part is what has been "added" to web2py's scripts to make 
apache serve the same file if there is a _number.number.number "prefix" 
just right after "static".

On Wednesday, October 16, 2013 4:54:42 PM UTC+2, frasse wrote:
>
>
> Hi 
> here is how my config look lik. is it what you think it should be. it is 
> not working . But it works for older version. 
> Thanx
> /F
>
>   AliasMatch ^/([^/]+)/static/(.*) \
>/var/web2py/applications/$1/static/$2
>   
> Order Allow,Deny
> Allow from all
>   
>
>
>
>
>
> Den onsdagen den 16:e oktober 2013 kl. 11:28:17 UTC+2 skrev Niphlod:
>>
>> did you configure your webserver to allow the static files to be served 
>> with folder versioning ?
>>
>> as a quick way to restore things as they were is to remove this line
>>
>>
>> https://github.com/web2py/web2py/blob/master/applications/admin/models/0.py#L84
>>
>> from the file.
>> But, you'll be missing quite an important feature.
>>
>> Il giorno mercoledì 16 ottobre 2013 11:21:50 UTC+2, frasse ha scritto:
>>>
>>> HI 
>>> I upgrade web2py to 2.7.4 from 2.7.3. admin page is not working any more 
>>> please see the attach file.
>>> do you have any idea ?
>>>
>>> Regards
>>> Frasse
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: web2py 2.7.4 is OUT

2013-10-16 Thread Niphlod
Similar thread with explanations

https://groups.google.com/d/msg/web2py/ZOJwVZFavFw/V_TP_94qiS8J

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] LOAD() not working after upgrading to 2.7.4

2013-10-16 Thread lesssugar
Just upgraded to 2.7.4. My LOAD() based component is not displaying, 
although it worked in the older version of web2py (2.4.7).

I copied web2py.js from the newest welcome application to my app/static/js/ 
folder.

What can be wrong?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: web2py 2.7.4 is OUT

2013-10-16 Thread Richard Vézina
Yes but he seems to experiment some kind of problem caused by
response.static_version that have been enabled...

Richard


On Wed, Oct 16, 2013 at 3:08 PM, Niphlod  wrote:

> Similar thread with explanations
>
> https://groups.google.com/d/msg/web2py/ZOJwVZFavFw/V_TP_94qiS8J
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Scheduler on Ubuntu Worker name

2013-10-16 Thread Niphlod
the main point is not that is not inefficient by itself. It's just that you 
need to make sure you don't use that in a model because in web2py models 
are executed at **every** request, and you don't seem to want to queue a 
task for every request that comes in :-P

On Wednesday, October 16, 2013 8:55:34 PM UTC+2, Tushar Tuteja wrote:
>
> thanks a ton,
> I ll try this and what would be appropriate place to insert the file , so 
> that it is not efficient.
>
> thanks,
>
> regards,
>
> Tushar Tuteja
>
>
> On 17 October 2013 00:22, Niphlod > wrote:
>
>> the scheduler is running fine.
>> In the data you pasted here there's the reason why the scheduler isn't 
>> picking up any new task.
>> times_run is 3 and repeats is set to 3, so the task got executed 3 times 
>> already.
>>
>> Sidenote: append a "return 1" to your function, so you'll get 
>> scheduler_run records holding more details about the executions, until you 
>> figure out the issues you're having on what to choose when you queue the 
>> task.
>>
>> Also, please do
>>
>> sched = Scheduler(db, dict(fun=func))
>>
>> sched.queue_task('func', uuid='test_insert', repeats=3, period=10)
>>
>> without any worker running, so you can see what is inserted into the 
>> scheduler_task table correctly.
>> Execute the sched.queue_task just one time only (if you put that in 
>> models, it will be executed at every request and that would be inefficient)
>>
>>
>>  -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/Zs7NODudXSE/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.
>>
>
>
>
> -- 
> Tushar Tuteja
> Undergraduate Student(Fourth Year)
> Civil Engineering
> IIT Delhi
> +919953061943
> ttu...@gmail.com 
> ce10...@civil.iitd.ernet.in 
> "The question isn't who is going to let me; its who is going to stop me!" 
> - Howard Roark
>  

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: web2py 2.7.4 is OUT

2013-10-16 Thread Niphlod
Of course he has. admin files are now using static_version. If you're not 
using web2py to serve static files, you need to have the configuration of 
the webserver serving static files that follows the same logic. 

On Wednesday, October 16, 2013 9:15:08 PM UTC+2, Richard wrote:
>
> Yes but he seems to experiment some kind of problem caused by 
> response.static_version that have been enabled...
>
> Richard
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: LOAD() not working after upgrading to 2.7.4

2013-10-16 Thread Niphlod
to make it short, it should work, and usually peoples reporting this bug 
quickly realize that they didn't copy the new web2py.js or that they have 
the browser's cached version working. Make sure that your page fetches the 
correct web2py.js, then post a simple app to reproduce the issue if the 
problem isn't solved.

On Wednesday, October 16, 2013 9:11:14 PM UTC+2, lesssugar wrote:
>
> Just upgraded to 2.7.4. My LOAD() based component is not displaying, 
> although it worked in the older version of web2py (2.4.7).
>
> I copied web2py.js from the newest welcome application to my 
> app/static/js/ folder.
>
> What can be wrong?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: LOAD() not working after upgrading to 2.7.4

2013-10-16 Thread lesssugar
Sh*t, it was the cache indeed

Sorry guys. And thanks Niphlod.

On Wednesday, October 16, 2013 9:19:01 PM UTC+2, Niphlod wrote:
>
> to make it short, it should work, and usually peoples reporting this bug 
> quickly realize that they didn't copy the new web2py.js or that they have 
> the browser's cached version working. Make sure that your page fetches the 
> correct web2py.js, then post a simple app to reproduce the issue if the 
> problem isn't solved.
>
> On Wednesday, October 16, 2013 9:11:14 PM UTC+2, lesssugar wrote:
>>
>> Just upgraded to 2.7.4. My LOAD() based component is not displaying, 
>> although it worked in the older version of web2py (2.4.7).
>>
>> I copied web2py.js from the newest welcome application to my 
>> app/static/js/ folder.
>>
>> What can be wrong?
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: web2py 2.7.4 is OUT

2013-10-16 Thread Richard Vézina
Yeah I see an other post, it should be that, let see ;)

Richard


On Wed, Oct 16, 2013 at 3:16 PM, Niphlod  wrote:

> Of course he has. admin files are now using static_version. If you're not
> using web2py to serve static files, you need to have the configuration of
> the webserver serving static files that follows the same logic.
>
> On Wednesday, October 16, 2013 9:15:08 PM UTC+2, Richard wrote:
>>
>> Yes but he seems to experiment some kind of problem caused by
>> response.static_version that have been enabled...
>>
>> Richard
>>
>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Scheduler on Ubuntu Worker name

2013-10-16 Thread Tushar
I got your point. It is that I made the whole project, its running 
except for sending mails I need to run the mail_queue file manually , I 
want it to run ever hour or so , so that the mails are being received.
so wanted to schedule the sending of mails once every hour and if the 
load increases , I would have reduced the time.

but I am unable to get the scheduler to work for this :p

Is there a way a parallel task is called as soon as a mail is inserted 
into the queue. it runs the file mail_queue but completes the request so 
that user doesn't have to wait.
because right now it takes 5 seconds if I use mail.send for the request 
to be completed. If I insert in the queue it complete the request in a 
minute.


thanks,

regards,

Tushar Tuteja

PS: web2py is really great and easy to learn and you guys are providing 
amazing support for this.
Me with my college mates at IIT Delhi (India) are actually promoting it 
and we have a small community among ourselves now :)



On Thursday 17 October 2013 12:45 AM, Niphlod wrote:
the main point is not that is not inefficient by itself. It's just 
that you need to make sure you don't use that in a model because in 
web2py models are executed at **every** request, and you don't seem to 
want to queue a task for every request that comes in :-P


On Wednesday, October 16, 2013 8:55:34 PM UTC+2, Tushar Tuteja wrote:

thanks a ton,
I ll try this and what would be appropriate place to insert the
file , so that it is not efficient.

thanks,

regards,

Tushar Tuteja


On 17 October 2013 00:22, Niphlod >
wrote:

the scheduler is running fine.
In the data you pasted here there's the reason why the
scheduler isn't picking up any new task.
times_run is 3 and repeats is set to 3, so the task got
executed 3 times already.

Sidenote: append a "return 1" to your function, so you'll get
scheduler_run records holding more details about the
executions, until you figure out the issues you're having on
what to choose when you queue the task.

Also, please do

sched = Scheduler(db, dict(fun=func))

sched.queue_task('func', uuid='test_insert', repeats=3, period=10)

without any worker running, so you can see what is inserted
into the scheduler_task table correctly.
Execute the sched.queue_task just one time only (if you put
that in models, it will be executed at every request and that
would be inefficient)


-- 
Resources:

- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py
 (Source code)
- https://code.google.com/p/web2py/issues/list
 (Report Issues)
---
You received this message because you are subscribed to a
topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/web2py/Zs7NODudXSE/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
.




-- 
Tushar Tuteja

Undergraduate Student(Fourth Year)
Civil Engineering
IIT Delhi
+919953061943
ttu...@gmail.com 
ce10...@civil.iitd.ernet.in 
"The question isn't who is going to let me; its who is going to
stop me!" - Howard Roark

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the 
Google Groups "web2py-users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/web2py/Zs7NODudXSE/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.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Scheduler on Ubuntu Worker name

2013-10-16 Thread Tushar

complete the request in a second if I insert in queue. and not a minute*

On Thursday 17 October 2013 12:45 AM, Niphlod wrote:
the main point is not that is not inefficient by itself. It's just 
that you need to make sure you don't use that in a model because in 
web2py models are executed at **every** request, and you don't seem to 
want to queue a task for every request that comes in :-P


On Wednesday, October 16, 2013 8:55:34 PM UTC+2, Tushar Tuteja wrote:

thanks a ton,
I ll try this and what would be appropriate place to insert the
file , so that it is not efficient.

thanks,

regards,

Tushar Tuteja


On 17 October 2013 00:22, Niphlod >
wrote:

the scheduler is running fine.
In the data you pasted here there's the reason why the
scheduler isn't picking up any new task.
times_run is 3 and repeats is set to 3, so the task got
executed 3 times already.

Sidenote: append a "return 1" to your function, so you'll get
scheduler_run records holding more details about the
executions, until you figure out the issues you're having on
what to choose when you queue the task.

Also, please do

sched = Scheduler(db, dict(fun=func))

sched.queue_task('func', uuid='test_insert', repeats=3, period=10)

without any worker running, so you can see what is inserted
into the scheduler_task table correctly.
Execute the sched.queue_task just one time only (if you put
that in models, it will be executed at every request and that
would be inefficient)


-- 
Resources:

- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py
 (Source code)
- https://code.google.com/p/web2py/issues/list
 (Report Issues)
---
You received this message because you are subscribed to a
topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/web2py/Zs7NODudXSE/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
.




-- 
Tushar Tuteja

Undergraduate Student(Fourth Year)
Civil Engineering
IIT Delhi
+919953061943
ttu...@gmail.com 
ce10...@civil.iitd.ernet.in 
"The question isn't who is going to let me; its who is going to
stop me!" - Howard Roark

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the 
Google Groups "web2py-users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/web2py/Zs7NODudXSE/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.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Scheduler on Ubuntu Worker name

2013-10-16 Thread Niphlod
the mail-sending usecase is one of the most clearer to show why a web app 
might need an "outside processor" to do the work, and keep the webapp 
snappy.
You can choose whatever method you like to schedule the task, all it needs 
is a record inserted into the scheduler_task table, with correct values.

On Wednesday, October 16, 2013 9:33:40 PM UTC+2, Tushar Tuteja wrote:
>
>  complete the request in a second if I insert in queue. and not a minute*
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: LOAD() not working after upgrading to 2.7.4

2013-10-16 Thread Niphlod
Since it's getting a quite popular "issue", please look into enabling 
response.static_version to avoid this happening again and again :-P
http://web2py.com/books/default/chapter/29/04/the-core#Static-asset-management

On Wednesday, October 16, 2013 9:24:40 PM UTC+2, lesssugar wrote:
>
> Sh*t, it was the cache indeed
>
> Sorry guys. And thanks Niphlod.
>
> On Wednesday, October 16, 2013 9:19:01 PM UTC+2, Niphlod wrote:
>>
>> to make it short, it should work, and usually peoples reporting this bug 
>> quickly realize that they didn't copy the new web2py.js or that they have 
>> the browser's cached version working. Make sure that your page fetches the 
>> correct web2py.js, then post a simple app to reproduce the issue if the 
>> problem isn't solved.
>>
>> On Wednesday, October 16, 2013 9:11:14 PM UTC+2, lesssugar wrote:
>>>
>>> Just upgraded to 2.7.4. My LOAD() based component is not displaying, 
>>> although it worked in the older version of web2py (2.4.7).
>>>
>>> I copied web2py.js from the newest welcome application to my 
>>> app/static/js/ folder.
>>>
>>> What can be wrong?
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: LOAD() not working after upgrading to 2.7.4

2013-10-16 Thread lesssugar
TODO :)

On Wednesday, October 16, 2013 9:43:42 PM UTC+2, Niphlod wrote:
>
> Since it's getting a quite popular "issue", please look into enabling 
> response.static_version to avoid this happening again and again :-P
>
> http://web2py.com/books/default/chapter/29/04/the-core#Static-asset-management
>
> On Wednesday, October 16, 2013 9:24:40 PM UTC+2, lesssugar wrote:
>>
>> Sh*t, it was the cache indeed
>>
>> Sorry guys. And thanks Niphlod.
>>
>> On Wednesday, October 16, 2013 9:19:01 PM UTC+2, Niphlod wrote:
>>>
>>> to make it short, it should work, and usually peoples reporting this bug 
>>> quickly realize that they didn't copy the new web2py.js or that they have 
>>> the browser's cached version working. Make sure that your page fetches the 
>>> correct web2py.js, then post a simple app to reproduce the issue if the 
>>> problem isn't solved.
>>>
>>> On Wednesday, October 16, 2013 9:11:14 PM UTC+2, lesssugar wrote:

 Just upgraded to 2.7.4. My LOAD() based component is not displaying, 
 although it worked in the older version of web2py (2.4.7).

 I copied web2py.js from the newest welcome application to my 
 app/static/js/ folder.

 What can be wrong?

>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] smartgrid IS_IN_SET() members not available in search widget?

2013-10-16 Thread Cliff Kachinske
Here is an excerpt from my model:

db.define_table('product',
 # [fields]
 Field('make_buy',
 requires=IS_IN_SET(['Make', 'Buy','Both'], zero='Selection 
Required',),
 comment='Choose "Make", "Buy" or "Both".',
 label = 'Make/Buy'
 ),
 # [more fields]
)

When I use form = SQLFORM.smartgrid(db.product, ...), the make_buy field 
does not appear in the search widget's field list.

Should I be doing something different, or is this the expected behavior?

Thanks,
Cliff Kachinske

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] New feature: admin plugin download

2013-10-16 Thread Alan Etkin
There's a new experimental feature for the admin app in trunk. When you 
visit an app's design page, the plugin download button at the bottom links 
to a page with a list of available contributed plugin packages that will be 
automagically downloaded and installed for you.

The list of available plugins is provided by the web2pyslices.com article 
search api. Warning: The current list is very small and some of the links 
will not work since the plugin package slice is required to post a direct 
.w2p archive dowload url.

Note to web2pyslices users: Please update your plugin posts so they specify 
a link to a .w2p file at the download field. Note also that if you are 
using Google code as project hosting, they have dropped support for archive 
downloads.

I think there are lots of missing plugins which were not posted at 
web2pyslices.com, so, please, if you want your web2py plugin in the list, 
fill the following form

https://www.web2pyslices.com/slice/new/Package

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: updating web2py app code

2013-10-16 Thread Dave S


On Wednesday, October 16, 2013 8:59:18 AM UTC-7, 黄祥 wrote:
>
> imho, you should use version control (git, subversion, mercurial, etc) to 
> take control for your code . and for change a running system, imho, u 
> should upgrade to the latest version (for bug fixing purpose, security 
> hole, etc), but test it carefully first before you upgrade your system (in 
> testing environment). for tutorial, what kind of version control do you 
> want to use? every version control have it's own way. e.g. git versioning 
> way is different with subversion or mercurial, please refer to the manual 
> on their website and documentation.
>

Note that web2py comes with mercurial ("hg") pre-installed and accessible 
from the admin app.  Mercurial is pretty simple to use, and web2py wraps 
that for you so you don't have to much more than provide a description of 
your changeset and press a button.  It's already installed in the current 
versions (my experience only goes back to 2.5.1).

Mercurial is also a very capable VCS, so you can be sophisticated in your 
use of it.  I am somewhat in-between ... what you  might call an "everyday 
power user", using simple branching and tagging, and not yet into rebasing.

I'd recommend that you have a backup repository (which is simple to do) on 
another machine.  But just doing an xcopy/rsynch of your web2py directory 
will provide one copy, and you already do backup your web2py directory

/dps



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: one to many relationship DB structure

2013-10-16 Thread Cliff Kachinske
This is a problem:

db.define_table(
'sale',
Field('id', db.auth_user, default=auth.user_id),

How about this instead:
db.define_table(
'sale',
Field('user_id', db.auth_user, requires=IS_IN_DB( # See "Forms and 
Validators in the Fine Manual

Also do this:
db.define_table(
'product',
Field('sale_id', db.sale, requires=IS_IN_DB( # See "Forms and 
Validators in the Fine Manual

Also I would not use the double data type for currency. Use instead Python 
decimal which works as you expect decimal numbers to work. Or you could 
store the, for example, US currency as pennies and put in the decimal 
marker when you display the value and strip it out when you work with it on 
the back end.

Whatever comes in on request.post_vars and ends up in form.vars is a 
string.  Your database adapter takes care of conversions.




On Wednesday, October 16, 2013 1:36:53 PM UTC-4, raferbop wrote:
>
> Thanks Stifan, 
>
> But that doesn't work either, because the product_id now displays in the 
> sale form. I need to generate the sale_id first, and then have sow in the 
> product table/form. Right now, it just shows up blank. 
>
> On Wednesday, October 16, 2013 11:08:58 AM UTC-5, 黄祥 wrote:
>>
>> yeah, my pov is because your product never save the sale id. imho, i 
>> think your code should be :
>> db.define_table(
>> 'sale',
>> Field('product_id', 'reference product'),
>> Field('user_id', db.auth_user, default=auth.user_id),
>> Field('start_date', 'date', requires=IS_DATE()),
>> Field('end_date', 'date', requires=IS_DATE()),
>> Field('start_time', 'time', requires = IS_TIME()),
>> Field('end_time', 'time', requires = IS_TIME()))
>>
>> db.define_table(
>> 'product',
>> Field('name', requires = IS_NOT_EMPTY()),
>> Field('price', 'double', default=0.00),
>> Field('description','text'),
>> Field('image', 'upload', default=''),
>> format = '%(name)s %(price)s')
>>
>> because 1 sale has many product and each product belongs to sale, isn't 
>> it?
>> 1 more thing please don't use id as your field name, because by default 
>> web2py use it as a primary key.
>> taken from book :
>>
>>- Each table must have a unique auto-increment integer field called 
>>"id"
>>- Records must be referenced exclusively using the "id" field.
>>
>> ref:
>>
>> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Legacy-databases-and-keyed-tables
>>
>> best regards,
>> stifan
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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: updating web2py app code

2013-10-16 Thread Dave S


On Wednesday, October 16, 2013 6:19:35 AM UTC-7, BlueShadow wrote:
>
> Since my original app was build with web2py 1.8.something. without any 
> version control or anything like that I was wondering if there is a good 
> tutorial how to set an app up with all the current features. Or if you 
> think it's not worth it and never change a running system.
>

You should be able to use your existing app in the current version.  You 
may need to copy some files around (handler for your webserver if you 
aren't using Rocket, some of the static files); that's discussed in this 
forum in the announcement of 2.6.1 back in September.  To use new features, 
I'd go to the book (on-line at web2py.com, but I have hard-copy) and look 
at the samples in chapter 3; you should be able to breeze through the first 
couple and then go back and forth to the fresh meat.  The DAL chapter is 
probably the 2nd place on your reading itinerary.
 

> One thing I would love to change is to add a version control to my system. 
> Is there a tutorial for that?
>

For just archiving and retrieving changes in a linear history, the web2py 
IDE provides an interface to mercurial  that is just button pushing. 
 Mercurial is pretty easy to install, and is also written in Python.

/dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: updating web2py app code

2013-10-16 Thread Dave S


On Wednesday, October 16, 2013 2:10:58 PM UTC-7, Dave S wrote:
>
>
>
> On Wednesday, October 16, 2013 8:59:18 AM UTC-7, 黄祥 wrote:
>>
>> imho, you should use version control (git, subversion, mercurial, etc) to 
>> take control for your code . and for change a running system, imho, u 
>> should upgrade to the latest version (for bug fixing purpose, security 
>> hole, etc), but test it carefully first before you upgrade your system (in 
>> testing environment). for tutorial, what kind of version control do you 
>> want to use? every version control have it's own way. e.g. git versioning 
>> way is different with subversion or mercurial, please refer to the manual 
>> on their website and documentation.
>>
>
> Note that web2py comes with mercurial ("hg") pre-installed and accessible 
> from the admin app.  Mercurial is pretty simple to use, and web2py wraps 
> that for you so you don't have to much more than provide a description of 
> your changeset and press a button.  It's already installed in the current 
> versions (my experience only goes back to 2.5.1).
>

Oops, just the wrapper is in the current version.  I happened to have it 
already installed on my Fedora 16 (yeah, I know) system.

>
> Mercurial is also a very capable VCS, so you can be sophisticated in your 
> use of it.  I am somewhat in-between ... what you  might call an "everyday 
> power user", using simple branching and tagging, and not yet into rebasing.
>
> I'd recommend that you have a backup repository (which is simple to do) on 
> another machine.  But just doing an xcopy/rsynch of your web2py directory 
> will provide one copy, and you already do backup your web2py directory
>

/dps
 

>  
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: updating web2py app code

2013-10-16 Thread Cliff Kachinske
On my production boxes, every upgrade of any kind starts like so:

mkdir rollback/
In the admin app, clean the application

sudo apache2ctl stop
tar -cvzf rollback//current_version.tar.gz 
/home/www-data/web2py/
sudo apache2ctl start



On Wednesday, October 16, 2013 5:10:58 PM UTC-4, Dave S wrote:
>
>
>
> On Wednesday, October 16, 2013 8:59:18 AM UTC-7, 黄祥 wrote:
>>
>> imho, you should use version control (git, subversion, mercurial, etc) to 
>> take control for your code . and for change a running system, imho, u 
>> should upgrade to the latest version (for bug fixing purpose, security 
>> hole, etc), but test it carefully first before you upgrade your system (in 
>> testing environment). for tutorial, what kind of version control do you 
>> want to use? every version control have it's own way. e.g. git versioning 
>> way is different with subversion or mercurial, please refer to the manual 
>> on their website and documentation.
>>
>
> Note that web2py comes with mercurial ("hg") pre-installed and accessible 
> from the admin app.  Mercurial is pretty simple to use, and web2py wraps 
> that for you so you don't have to much more than provide a description of 
> your changeset and press a button.  It's already installed in the current 
> versions (my experience only goes back to 2.5.1).
>
> Mercurial is also a very capable VCS, so you can be sophisticated in your 
> use of it.  I am somewhat in-between ... what you  might call an "everyday 
> power user", using simple branching and tagging, and not yet into rebasing.
>
> I'd recommend that you have a backup repository (which is simple to do) on 
> another machine.  But just doing an xcopy/rsynch of your web2py directory 
> will provide one copy, and you already do backup your web2py directory
>
> /dps
>
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: New feature: admin plugin download

2013-10-16 Thread Niphlod
will do on the weekend.

On Wednesday, October 16, 2013 11:08:40 PM UTC+2, Alan Etkin wrote:
>
> There's a new experimental feature for the admin app in trunk. When you 
> visit an app's design page, the plugin download button at the bottom links 
> to a page with a list of available contributed plugin packages that will be 
> automagically downloaded and installed for you.
>
> The list of available plugins is provided by the web2pyslices.com article 
> search api. Warning: The current list is very small and some of the links 
> will not work since the plugin package slice is required to post a direct 
> .w2p archive dowload url.
>
> Note to web2pyslices users: Please update your plugin posts so they 
> specify a link to a .w2p file at the download field. Note also that if you 
> are using Google code as project hosting, they have dropped support for 
> archive downloads.
>
> I think there are lots of missing plugins which were not posted at 
> web2pyslices.com, so, please, if you want your web2py plugin in the list, 
> fill the following form
>
> https://www.web2pyslices.com/slice/new/Package
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Cassandra Support

2013-10-16 Thread Derek
It looks like a No. Check the dal.py in source.

On Wednesday, October 16, 2013 10:38:43 AM UTC-7, Amit Saharana wrote:
>
> Hi, just for information, does web2py support Cassandra Database. I didn't 
> get any specific information about it through search engines.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: one to many relationship DB structure

2013-10-16 Thread raferbop
db.define_table(
'sale',
Field('user_id', db.auth_user),
Field('start_date', 'date', requires=IS_DATE()),
Field('end_date', 'date', requires=IS_DATE()),
Field('start_time', 'time', requires = IS_TIME()),
Field('end_time', 'time', requires = IS_TIME()))

db.sale.user_id.requires = IS_IN_DB(db, 'auth_user.id')


db.define_table(
'product',
Field('sale_id', db.sale),
Field('name', requires = IS_NOT_EMPTY()),
Field('price'),
Field('description','text'),
Field('image', 'upload', default=''),
format = '%(name)s %(price)s')

db.product.sale_id.requires = IS_IN_DB(db, 'sale.id')


Thanks Cliff,

This is an improvement on what I had. But I am not sure if I applied the 
code correctly because the 'user_id' and 'sale_id' have been converted into 
a drop-down list, as opposed to being automatically populated.


On Wednesday, October 16, 2013 4:18:52 PM UTC-5, Cliff Kachinske wrote:
>
> This is a problem:
>
> db.define_table(
> 'sale',
> Field('id', db.auth_user, default=auth.user_id),
>
> How about this instead:
> db.define_table(
> 'sale',
> Field('user_id', db.auth_user, requires=IS_IN_DB( # See "Forms and 
> Validators in the Fine Manual
>
> Also do this:
> db.define_table(
> 'product',
> Field('sale_id', db.sale, requires=IS_IN_DB( # See "Forms and 
> Validators in the Fine Manual
>
> Also I would not use the double data type for currency. Use instead Python 
> decimal which works as you expect decimal numbers to work. Or you could 
> store the, for example, US currency as pennies and put in the decimal 
> marker when you display the value and strip it out when you work with it on 
> the back end.
>
> Whatever comes in on request.post_vars and ends up in form.vars is a 
> string.  Your database adapter takes care of conversions.
>
>
>
>
> On Wednesday, October 16, 2013 1:36:53 PM UTC-4, raferbop wrote:
>>
>> Thanks Stifan, 
>>
>> But that doesn't work either, because the product_id now displays in the 
>> sale form. I need to generate the sale_id first, and then have sow in the 
>> product table/form. Right now, it just shows up blank. 
>>
>> On Wednesday, October 16, 2013 11:08:58 AM UTC-5, 黄祥 wrote:
>>>
>>> yeah, my pov is because your product never save the sale id. imho, i 
>>> think your code should be :
>>> db.define_table(
>>> 'sale',
>>> Field('product_id', 'reference product'),
>>> Field('user_id', db.auth_user, default=auth.user_id),
>>> Field('start_date', 'date', requires=IS_DATE()),
>>> Field('end_date', 'date', requires=IS_DATE()),
>>> Field('start_time', 'time', requires = IS_TIME()),
>>> Field('end_time', 'time', requires = IS_TIME()))
>>>
>>> db.define_table(
>>> 'product',
>>> Field('name', requires = IS_NOT_EMPTY()),
>>> Field('price', 'double', default=0.00),
>>> Field('description','text'),
>>> Field('image', 'upload', default=''),
>>> format = '%(name)s %(price)s')
>>>
>>> because 1 sale has many product and each product belongs to sale, isn't 
>>> it?
>>> 1 more thing please don't use id as your field name, because by default 
>>> web2py use it as a primary key.
>>> taken from book :
>>>
>>>- Each table must have a unique auto-increment integer field called 
>>>"id"
>>>- Records must be referenced exclusively using the "id" field.
>>>
>>> ref:
>>>
>>> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Legacy-databases-and-keyed-tables
>>>
>>> best regards,
>>> stifan
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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: one to many relationship DB structure

2013-10-16 Thread Anthony

>
> db.sale.user_id.requires = IS_IN_DB(db, 'auth_user.id')
>

The above line is unnecessary, as you get the IS_IN_DB validator 
automatically by default.
 

> This is an improvement on what I had. But I am not sure if I applied the 
> code correctly because the 'user_id' and 'sale_id' have been converted into 
> a drop-down list, as opposed to being automatically populated.
>

The values won't be populated automatically unless you specify an actual 
value (you can do so via the "default" argument).

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Calling a function while adding an entry to auth_user table

2013-10-16 Thread 黄祥
other way i think you can add auth.add_permission on your script, something 
like :

# add group
auth.add_group('Manager', 'Manager')
auth.add_group('Admin', 'Admin')
# add user
db.auth_user.bulk_insert([{'first_name' : 'Manager', 'last_name' : 
'Manager', 
   'email' : 'a...@a.com', 'username' : 'manager', 
   'password' : db.auth_user.password.validate('passmeplease')[0]}, 
  {'first_name' : 'Admin', 'last_name' : 'Admin', 
   'email' : 'b...@b.com', 'username' : 'admin', 
   'password' : db.auth_user.password.validate('passmeplease')[0]}])

# add permission
auth.add_permission(1, 'read', db.whatever)
auth.add_permission(1, 'create', db.whatever)
auth.add_permission(1, 'select', db.whatever)

ref:
http://web2py.com/books/default/chapter/29/09/access-control

best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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: one to many relationship DB structure

2013-10-16 Thread raferbop
Thanks Anthony, the default argument, which I am assuming is 
"default=auth.user_id", 
inserts the user id into the sales table. But what argument should I use to 
insert the sale_id into the products table, very much in the same way the  
default=auth.user_id inserst the user id in the db.sale. 

On Wednesday, October 16, 2013 6:22:12 PM UTC-5, Anthony wrote:
>
> db.sale.user_id.requires = IS_IN_DB(db, 'auth_user.id')
>>
>
> The above line is unnecessary, as you get the IS_IN_DB validator 
> automatically by default.
>  
>
>> This is an improvement on what I had. But I am not sure if I applied the 
>> code correctly because the 'user_id' and 'sale_id' have been converted into 
>> a drop-down list, as opposed to being automatically populated.
>>
>
> The values won't be populated automatically unless you specify an actual 
> value (you can do so via the "default" argument).
>
> Anthony
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: one to many relationship DB structure

2013-10-16 Thread Anthony
Actually, I'm not sure this is the right data model. Presumably the product 
table should include just one record per product, so you don't want to 
store a sale id in the product table. If each sale can include only one 
product, then you want a product reference field in the sale table. If each 
sale can include multiple products, then you probably want a separate 
"items" table where each record references a sale and a product (i.e., for 
a many-to-many relationship between products and sales). Another option 
would be to include a list:reference field in the sale table to store a 
list of references to multiple products (this is a simpler model but can 
make it less efficient to do various types of aggregate analyses, such as 
calculating number of sales per product).

Anthony

On Wednesday, October 16, 2013 8:03:14 PM UTC-4, raferbop wrote:
>
> Thanks Anthony, the default argument, which I am assuming is "default=auth
> .user_id", inserts the user id into the sales table. But what argument 
> should I use to insert the sale_id into the products table, very much in 
> the same way the  default=auth.user_id inserst the user id in the 
> db.sale. 
>
> On Wednesday, October 16, 2013 6:22:12 PM UTC-5, Anthony wrote:
>>
>> db.sale.user_id.requires = IS_IN_DB(db, 'auth_user.id')
>>>
>>
>> The above line is unnecessary, as you get the IS_IN_DB validator 
>> automatically by default.
>>  
>>
>>> This is an improvement on what I had. But I am not sure if I applied the 
>>> code correctly because the 'user_id' and 'sale_id' have been converted into 
>>> a drop-down list, as opposed to being automatically populated.
>>>
>>
>> The values won't be populated automatically unless you specify an actual 
>> value (you can do so via the "default" argument).
>>
>> Anthony
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] changing client side caching headers expires or cache-control value

2013-10-16 Thread Dave S


On Wednesday, October 16, 2013 11:06:23 AM UTC-7, molhokwai wrote:
>
> Well...
> It doesn't seem to work on  local dev_appserver, but it actually works, 
> when deployed on appspot.com...
> So, anyway, problem solved...
>
>
Different IP or domain name?

If your browser's cache wasn't cleared, the old copies would be retained 
until the original expiration had passed, so you wouldn't see the new 
copies.  By changing "machines", you may have been unrecognized as "already 
cached".

I learned a little about this stuff in connection with the Web2Py IDE 
("blank screen in editor")
 
 /dps

On Wed, Oct 16, 2013 at 4:14 PM, molhokwai >wrote:
>
>> Hi,
>>
>> I've tried changing client side caching headers expires or cache-control 
>> value (from 10mns by default?), running the code below from the 
>> corresponding controller, but the values are unaffected.
>>
>> import datetime
>> expires = datetime.datetime.now()+datetime.timedelta(0,365*24*
>> 3600)
>> # ex: Fri, 01 Jan 1990 00:00:00 GMT
>> response.headers['Expires'] = expires.strftime("%a, %d %b %Y 
>> %H:%M:%S GMT")
>> response.headers['Cache-Control'] = 
>> 'public,max-age:%i,must-revalidate' % (365*24*3600)
>>
>>
>> How should this be done?
>>
>> Thanks
>> -molhokwai
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/BMxhOL_X2y8/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.
>>
>
>
>
> -- 
>
> -
> *M*T, *M*olhokwai
> *+32 489 33 71 51, molh...@gmail.com , 
> chat/voip(gtalk):molhokwai*
> *
> *
> Don DeLillo: Underworld |  Don DeLillo: Cosmopolis | The Matrix: The 
> Architect | Brandford Marsalis: Mr J.C. 
> (Live) | Ursula K. LeGuin: The Dispossessed | Annares | Robert Zemeckis: 
> Contact |  What the *bleep* do we 
> know... | E.J. Strickland: In this Day | Jeff Buckley: Grace | Qawalis 
> | Genesis: FoxTrot | XXX | Artémise & 
> Mausole | XXX | Le Taj Mahal | Slow | Infinity | Khalasa | Google 
> | Coltrane | X-Men III: The Phoenix | RATM | 
> Jean D'ormesson: Le Juif Errant | Les Quatre Incommensurables | Edgar 
> Allan Poe: Ms found in a bottle | 7 | 
> Georges Clooney: Confession of a dangerous Mind | The hand of God | 
> Dreaming Bear Kanaan | 
> Implementing change | Amin Maalouf: Le Rocher de Tanios | 9 | The Grand 
> Cycle | The Beyonder | The 
> Venus Project | Patrick Suskind: Le Parfum | Ethan & Lucas Vorly | Khaili 
> Gibran: On Love | 
> Urbanfarming.org | Planck's Constant | Gemineye: Poetic bloodline | 
> Moving-planet.org | 350.org | Bree 
> Olson | Jacques Audiard: Sur mes lèvres | Raymond Devos | Terrence Mc 
> Kenna | Alan Watts | Mindwalk:
>  Liv Ullman's Sophia Hoffman | ...
>
> *Let's talk*
>
> 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: one to many relationship DB structure

2013-10-16 Thread raferbop
I am going to give it a go right now.

On Wednesday, October 16, 2013 7:18:33 PM UTC-5, Anthony wrote:
>
> Actually, I'm not sure this is the right data model. Presumably the 
> product table should include just one record per product, so you don't want 
> to store a sale id in the product table. If each sale can include only one 
> product, then you want a product reference field in the sale table. If each 
> sale can include multiple products, then you probably want a separate 
> "items" table where each record references a sale and a product (i.e., for 
> a many-to-many relationship between products and sales). Another option 
> would be to include a list:reference field in the sale table to store a 
> list of references to multiple products (this is a simpler model but can 
> make it less efficient to do various types of aggregate analyses, such as 
> calculating number of sales per product).
>
> Anthony
>
> On Wednesday, October 16, 2013 8:03:14 PM UTC-4, raferbop wrote:
>>
>> Thanks Anthony, the default argument, which I am assuming is "default=
>> auth.user_id", inserts the user id into the sales table. But what 
>> argument should I use to insert the sale_id into the products table, very 
>> much in the same way the  default=auth.user_id inserst the user id in 
>> the db.sale. 
>>
>> On Wednesday, October 16, 2013 6:22:12 PM UTC-5, Anthony wrote:
>>>
>>> db.sale.user_id.requires = IS_IN_DB(db, 'auth_user.id')

>>>
>>> The above line is unnecessary, as you get the IS_IN_DB validator 
>>> automatically by default.
>>>  
>>>
 This is an improvement on what I had. But I am not sure if I applied 
 the code correctly because the 'user_id' and 'sale_id' have been converted 
 into a drop-down list, as opposed to being automatically populated.

>>>
>>> The values won't be populated automatically unless you specify an actual 
>>> value (you can do so via the "default" argument).
>>>
>>> Anthony
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] SQLFORM.grid oncreate Issue

2013-10-16 Thread Christian Espinoza
Hi guys, 
I'm using 2.6.4-stable+timestamp.2013.09.22.01.43.37 and I trying to log at 
db every new record
created with SQLFORM.grid:

My controller:

def bodies(): 
grid = SQLFORM.grid(db.bodies, orderby=~db.bodies.id, oncreate=
log_action('System','Created new body'))
return dict(grid=grid)



my function log_action:

def log_action(origin, description):
db.auth_event.insert(time_stamp=request.now, 
client_ip=request.env.remote_addr,
user_id=auth.user.id, 
origin=origin, 
description=description)



It's worked, but not as expected, I get four logs(four new records at 
auth_event) when I add a only new record..
where is the problem?
Thanks

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] web2py and tag-manager/typeahead

2013-10-16 Thread NeelSheyal
Hi, 
   I am trying to hook the tags manager (lldonethings.com/tags/manager/v3) 
with  web2py ajax functionality. Tags manager uses Twitter typeahead.js to 
prefetch data. 
Here is what I am doing: 

View: 
 =

   1. var tagApi = jQuery("#your_pretty_id").tagsManager({
   2. prefilled: ["Angola", "Laos", "Nepal"]
   3. });
   4.  
   5. jQuery("#your_pretty_id").typeahead({
   6. name: 'countries',
   7. limit: 15,
   8. prefetch: "{{=URL('default', 'getTags')}}"
   9. }).on('typeahead:selected', function (e, d) {
   10.  
   11. tagApi.tagsManager("pushTag", d.value);
   12.  
   13. });


Controller/default.py

def getTags():
months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 
'August', 'September' ,'October', 'November', 'December'] return 
response.json(months)
 

However, I the controller function is not getting triggered and the drop 
down menu is not appearing. Can someone please provide some guidance? 

Thanks,
Neel 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: gae boilerplate vs web2py

2013-10-16 Thread Scott Hunter
Bootstrap is included w/ web2py, and the provided scaffolding detects if 
you are running in GAE and sets up the DAL accordingly.  Which means you 
can develop running web2py "natively" and switch to GAE w/o having to 
change any code.

The section of the book on deployment recipes goes into more detail about 
running under GAE.

I've done it myself, and been pretty impressed.  But that's not unusual for 
web2py.

- Scott

On Wednesday, October 16, 2013 2:02:11 AM UTC-4, Saisha D wrote:
>
> Hi All, 
>  Apologies if this is a repost, my last post did not go through for many 
> hours, posting again.
>
> I'm a newbie to web development, but quite familiar with python (use it at 
> work), I'm trying to quickly prototype some ideas for a startup website.
> My goal is to deploy it initially with app engine, I also heard that 
> twitter bootstrap is very helpful for UI.
>
> I found https://github.com/coto/gae-boilerplate after googling, and 
> almost settled on it since it had
> gae ndb support, webapp2, federated login, twitter bootstrap and all this 
> hooked together.
>
> but my friend pointed to me that web2py is a better option and it's much 
> better supported (as I can see from this user group).
>
> My question for you folks:
> Am I making the right decision to go towards web2py?
> Is twitter bootstrap built into web2py or some form of it, or can it be 
> hooked into it, 
> Can I use NDB for google app engine(free account)?
>
> Please point me to any prior posts/articles on this topic if all this has 
> been answered 
>
> Thanks in advance
> Saisha
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: html2canvas to db

2013-10-16 Thread IVINH

Try it:

model:
define_table("YOURTABLE",Field(data,"text"))

controller:
def update():
return db.*YOURTABLE*.insert(data = request.vars.data)



Vào 17:27:14 UTC+7 Thứ bảy, ngày 12 tháng mười năm 2013, Ruud Schroen đã 
viết:
>
> I keep getting this error: GET 
> http://localhost:8000/ezwireframes/wireframe/update/1?data=data%3Aimage%2Fp…BQpYBSsMrLbtEECBAgQIAAAQIECBAgQIAAAQI1C%2FwGTQp2HFGzKI0ASUVORK5CYII%3D500
>  (INTERNAL SERVER ERROR) 
>
> On Saturday, October 12, 2013 3:48:33 AM UTC+2, IVINH wrote:
>>
>> You can try it:
>>
>> in view:
>>
>>
>> function update() {
>> var url = '{{=URL(f="update",args=request.args,vars=request.vars)}}';
>> var data = document.getElementById('drawcomment').toDataURL("image/png");
>> $.ajax({
>> url: url,
>> type: "GET",
>> data: {'data':data},
>> success: function (html) {
>> $('#results').html(html);
>> }
>> });
>> return false; 
>> }
>>
>> in controller:
>>
>>
>> def update():
>> return db().insert(data = request.vars.data)
>>
>>
>> Vào 04:32:53 UTC+7 Thứ bảy, ngày 12 tháng mười năm 2013, Ruud Schroen đã 
>> viết:
>>>
>>> Hi,
>>>
>>> I am creating a app which uses html2canvas to create a screenshot of all 
>>> content inside a specific div. It generates a canvas which acts as the 
>>> screenshot. Now it is also possible to generate a image which you can 
>>> download directly.
>>>
>>> This is the javascript code which will be used:
>>>
>>>
>>>1. html2canvas(document.div, {
>>>2.  onrendered: function(canvas) {
>>>3./* Do something*/
>>>4.  }
>>>5. });
>>>
>>>
>>> Is it possible to save this canvas as a image to a db record?
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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

2013-10-16 Thread Andrew W
Apparently MSSQL ODBC does an implicit DEALLOCATE for cursors, whereas 
Teradata doesn't.I'm testing a new close() method for the Teradata 
Adapter that does a self.connection.cursor.close() as well.  So far so 
good.   No reason why this couldn't be done in general (explicit close for 
each open)  but I'll get it working for Teradata for now.
 
Thanks
 
 

On Wednesday, October 16, 2013 5:43:09 PM UTC+11, Niphlod wrote:

> on mssql I don't see anything like that, even raising to 15 pool_size and 
> flooding the poor rocket webserver there are at most 15 connections to 
> the backend.
>
> Il giorno mercoledì 16 ottobre 2013 00:30:37 UTC+2, Andrew W ha scritto: 
>>
>> P.S.   This may be an issue for all pyodbc databases MSSQL, DB2.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] sqlite strange behaviour with boolean

2013-10-16 Thread Tim Richardson
This is web2py 2.7.4, on Windows, python 2.7.5

I have rows in an sqlite table with a boolean field. Currently all rows 
have this field set to 0 (via an update query in an sqlite console)

When the table is defined in the web2py model as boolean, this query 
returns no rows:

   query_rows = db(db.order_status.sent_order_rcvd_email == False).select()

but if the table definition changes the field type to integer,
the query works. 

Seems a bit weird. I thought I would have run into this problem earlier 
unless it is recent behaviour. 




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: sqlite strange behaviour with boolean

2013-10-16 Thread Tim Richardson


On Thursday, 17 October 2013 14:29:17 UTC+11, Tim Richardson wrote:
>
> This is web2py 2.7.4, on Windows, python 2.7.5
>
> I have rows in an sqlite table with a boolean field. Currently all rows 
> have this field set to 0 (via an update query in an sqlite console)
>
> When the table is defined in the web2py model as boolean, this query 
> returns no rows:
>
>query_rows = db(db.order_status.sent_order_rcvd_email == False).select()
>
> but if the table definition changes the field type to integer,
> the query works. 
>
> Seems a bit weird. I thought I would have run into this problem earlier 
> unless it is recent behaviour. 
>
>
Ah. A bit of a gotcha perhaps. sqlite defines boolean as an integer value 
(0 or 1) but web2py uses a 1 char 'T' or 'F'. 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: admin page is not working in web2py 2.7.4

2013-10-16 Thread Mark Abajian
Thank you for the explanation, Niphlod.  I've updated my AliasMatch, and 
that is working for me.

Mark Abajian

On Wednesday, October 16, 2013 12:07:53 PM UTC-7, Niphlod wrote:
>
>
> AliasMatch 
> ^/([^/]+)/static/*(?:_[\d]+.[\d]+.[\d]+/)?*(.*)/home/www-data/web2py/applications/
> $1/static/$2
>
> The *bold red *part is what has been "added" to web2py's scripts to make 
> apache serve the same file if there is a _number.number.number "prefix" 
> just right after "static".
> Frasse
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Calling a function while adding an entry to auth_user table

2013-10-16 Thread ranjith2041
Thanks for the reply.


On Thu, Oct 17, 2013 at 5:15 AM, 黄祥  wrote:

> other way i think you can add auth.add_permission on your script,
> something like :
>
> # add group
> auth.add_group('Manager', 'Manager')
> auth.add_group('Admin', 'Admin')
> # add user
> db.auth_user.bulk_insert([{'first_name' : 'Manager', 'last_name' :
> 'Manager',
>'email' : 'a...@a.com', 'username' : 'manager',
>'password' : db.auth_user.password.validate('passmeplease')[0]},
>   {'first_name' : 'Admin', 'last_name' : 'Admin',
>'email' : 'b...@b.com', 'username' : 'admin',
>'password' : db.auth_user.password.validate('passmeplease')[0]}])
>
> # add permission
> auth.add_permission(1, 'read', db.whatever)
> auth.add_permission(1, 'create', db.whatever)
> auth.add_permission(1, 'select', db.whatever)
>
> ref:
> http://web2py.com/books/default/chapter/29/09/access-control
>
> best regards,
> stifan
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> 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/_gvWtKM7NPY/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.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] changing client side caching headers expires or cache-control value

2013-10-16 Thread molhokwai
Cleared the cache to be sure and retried...
Getting '304 Not Modified' status code for local static items to be cached
But '200 (from cache)' for remote items...

So seems like this has to do with localhost requesting local resources...
Client side caching works perfectly online, so not an issue, but good to
know...

Thanks
-molhokwai

On Thu, Oct 17, 2013 at 1:25 AM, Dave S  wrote:

>
>
> On Wednesday, October 16, 2013 11:06:23 AM UTC-7, molhokwai wrote:
>>
>> Well...
>> It doesn't seem to work on  local dev_appserver, but it actually works,
>> when deployed on appspot.com...
>> So, anyway, problem solved...
>>
>>
> Different IP or domain name?
>
> If your browser's cache wasn't cleared, the old copies would be retained
> until the original expiration had passed, so you wouldn't see the new
> copies.  By changing "machines", you may have been unrecognized as "already
> cached".
>
> I learned a little about this stuff in connection with the Web2Py IDE
> ("blank screen in editor")
>
>  /dps
>
> On Wed, Oct 16, 2013 at 4:14 PM, molhokwai  wrote:
>>
>>> Hi,
>>>
>>> I've tried changing client side caching headers expires or cache-control
>>> value (from 10mns by default?), running the code below from the
>>> corresponding controller, but the values are unaffected.
>>>
>>> import datetime
>>> expires = datetime.datetime.now()+datetime.timedelta(0,365*24*
>>> 3600)
>>> # ex: Fri, 01 Jan 1990 00:00:00 GMT
>>> response.headers['Expires'] = expires.strftime("%a, %d %b %Y
>>> %H:%M:%S GMT")
>>> response.headers['Cache-Control'] =
>>> 'public,max-age:%i,must-revalidate' % (365*24*3600)
>>>
>>>
>>> How should this be done?
>>>
>>> Thanks
>>> -molhokwai
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/web2py/BMxhOL_X2y8/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.
>>>
>>
>>
>>
>> --
>>
>> -
>> *M*T, *M*olhokwai
>> *+32 489 33 71 51, molh...@gmail.com, chat/voip(gtalk):molhokwai*
>>  *
>> *
>> Don DeLillo: Underworld |  Don DeLillo: Cosmopolis | The Matrix: The
>> Architect | Brandford Marsalis: Mr J.C.
>> (Live) | Ursula K. LeGuin: The Dispossessed | Annares | Robert Zemeckis:
>> Contact |  What the *bleep* do we
>> know... | E.J. Strickland: In this Day | Jeff Buckley: Grace | Qawalis
>> | Genesis: FoxTrot | XXX | Artémise &
>> Mausole | XXX | Le Taj Mahal | Slow | Infinity | Khalasa | Google
>> | Coltrane | X-Men III: The Phoenix | RATM |
>> Jean D'ormesson: Le Juif Errant | Les Quatre Incommensurables | Edgar
>> Allan Poe: Ms found in a bottle | 7 |
>> Georges Clooney: Confession of a dangerous Mind | The hand of God |
>> Dreaming Bear Kanaan |
>> Implementing change | Amin Maalouf: Le Rocher de Tanios | 9 | The Grand
>> Cycle | The Beyonder | The
>> Venus Project | Patrick Suskind: Le Parfum | Ethan & Lucas Vorly |
>> Khaili Gibran: On Love |
>> Urbanfarming.org | Planck's Constant | Gemineye: Poetic bloodline |
>> Moving-planet.org | 350.org | Bree
>> Olson | Jacques Audiard: Sur mes lèvres | Raymond Devos | Terrence Mc
>> Kenna | Alan Watts | Mindwalk:
>>  Liv Ullman's Sophia Hoffman | ...
>>
>> *Let's talk*
>>
>>   --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/BMxhOL_X2y8/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.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Calling a function while adding an entry to auth_user table

2013-10-16 Thread ranjith
Thanks for the information. I hope so now I can proceed with that.

Also, is there any callbacks for the table creation?? I have a table which 
will have the three static entries added to it only one time. Now, I am 
manually inserting the records into the table once the table is created. I 
want to do it automatically, so that once the table is created, those 
entries should be inserted into that table. Is there a way to achieve this?

On Thursday, 17 October 2013 10:51:36 UTC+5:30, ranjith wrote:
>
> Thanks for the reply. 
>
>
> On Thu, Oct 17, 2013 at 5:15 AM, 黄祥  wrote:
>
>> other way i think you can add auth.add_permission on your script, 
>> something like :
>>
>> # add group
>> auth.add_group('Manager', 'Manager')
>> auth.add_group('Admin', 'Admin')
>> # add user
>> db.auth_user.bulk_insert([{'first_name' : 'Manager', 'last_name' : 
>> 'Manager', 
>>'email' : 'a...@a.com', 'username' : 'manager', 
>>'password' : db.auth_user.password.validate('passmeplease')[0]}, 
>>   {'first_name' : 'Admin', 'last_name' : 'Admin', 
>>'email' : 'b...@b.com', 'username' : 'admin', 
>>'password' : db.auth_user.password.validate('passmeplease')[0]}])
>>
>> # add permission
>> auth.add_permission(1, 'read', db.whatever)
>> auth.add_permission(1, 'create', db.whatever)
>> auth.add_permission(1, 'select', db.whatever)
>>
>> ref:
>> http://web2py.com/books/default/chapter/29/09/access-control
>>
>> best regards,
>> stifan
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> 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/_gvWtKM7NPY/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.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.