[web2py] How to generate URLs for each user similar to twitter?

2013-11-13 Thread Noah
I understand that Web2Py's urls work like this: 
127.0.0.1:9292///

I'm building an app that has user logins and I want to have a sort of 
profile page for each user that has an easy to remember URL. Similar to on 
twitter where to go to a user's page you just navigate to 
twitter.com/. How does one achieve this using Web2Py?

Currently I have it working so that the Username is a GET parameter and the 
URL looks like: 
127.0.0.1:9292//Users/Wall?UserName=Thomas1 
Where 'Users' is the Controller and 'Wall' is the function.
  
I want it to be: 127.0.0.1:9292//Users/Thomas1

Thanks for your 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.


[web2py] Error uploading 60 character named .pptx file

2013-11-13 Thread Rahul
Hi All,
  I get an error like below when I upload a file (.pptx [could be with 
other extensions too not tested]) in latest web2py - downloaded from trunk 
yesterday as below. I am on Win7 and IE9 .The file name looks insanely huge 
as highlighted below. I am able to upload pptx files prior to this file 
albeit short names. This file has approximately sixty characters like 
[Toney Catters expose Spouscold data to Int Locount list view].pptx. Is 
there a limit on file name specification when attaching files in web2py 
(note - I haven't specified any in the app)?

*Error Description: *
 [Errno 2] No such file or directory: 
'D:\\Web2py\\web2py\\applications\\BBOnline\\databases\\..\\uploads
\\issues.attach_file.8ddd3149b14cb8e9.4d6f6e6579204d617474657273206578706f7365205072696d6172792041647669736f722066726f6d20436f6e7461637420746f20496e76204163636f756e74207669657720616e642064796e616d6963207265706f7274732e70707478.pptx'
Versionweb2py™Version 2.7.4-stable+timestamp.2013.10.27.19.58.30PythonPython 
2.7.5: C:\Python27\python.exe (prefix: C:\Python27)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.

Traceback (most recent call last):
  File "D:\Web2py\web2py\gluon\restricted.py", line 217, in restricted
exec ccode in environment
  File "D:/Web2py/web2py/applications/BBOnline/controllers/default.py" 
, line 7774, in 
  File "D:\Web2py\web2py\gluon\globals.py", line 372, in 
self._caller = lambda f: f()
  File "D:/Web2py/web2py/applications/BBOnline/controllers/default.py" 
, line 2699, in 
update_issues
if form.accepts(request.vars,session):
  File "D:\Web2py\web2py\gluon\sqlhtml.py", line 1505, in accepts
field.uploadfolder)
  File "D:\Web2py\web2py\gluon\dal.py", line 9681, in store
dest_file = open(pathfilename, 'wb')
IOError: [Errno 2] No such file or directory: 
'D:\\Web2py\\web2py\\applications\\BBOnline\\databases\\..\\uploads\\issues.attach_file.8ddd3149b14cb8e9.4d6f6e6579204d617474657273206578706f7365205072696d6172792041647669736f722066726f6d20436f6e7461637420746f20496e76204163636f756e74207669657720616e642064796e616d6963207265706f7274732e70707478.pptx

Sincerley, Rahul D.

-- 
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: Error uploading 60 character named .pptx file

2013-11-13 Thread Rahul
All,
  To correct the file has 89 character and not 60. That was a typo in my 
earlier post. a sixty character file works fine for upload. By character I 
mean name of the file - something like
[Toney Catters expose Primary divisor from Fontect to Int Focount view and 
enyamic seaport.pptx]

Regards, Rahul


On Wednesday, November 13, 2013 3:30:11 PM UTC+5:30, Rahul wrote:
>
> Hi All,
>   I get an error like below when I upload a file (.pptx [could be with 
> other extensions too not tested]) in latest web2py - downloaded from trunk 
> yesterday as below. I am on Win7 and IE9 .The file name looks insanely huge 
> as highlighted below. I am able to upload pptx files prior to this file 
> albeit short names. This file has approximately sixty characters like 
> [Toney Catters expose Spouscold data to Int Locount list view].pptx. Is 
> there a limit on file name specification when attaching files in web2py 
> (note - I haven't specified any in the app)?
>
> *Error Description: *
>  [Errno 2] No such file or directory: 
> 'D:\\Web2py\\web2py\\applications\\BBOnline\\databases\\..\\uploads
> \\issues.attach_file.8ddd3149b14cb8e9.4d6f6e6579204d617474657273206578706f7365205072696d6172792041647669736f722066726f6d20436f6e7461637420746f20496e76204163636f756e74207669657720616e642064796e616d6963207265706f7274732e70707478.pptx'
> Versionweb2py™Version 2.7.4-stable+timestamp.2013.10.27.19.58.30PythonPython 
> 2.7.5: C:\Python27\python.exe (prefix: C:\Python27)Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
>
> Traceback (most recent call last):
>   File "D:\Web2py\web2py\gluon\restricted.py", line 217, in restricted
> exec ccode in environment
>   File "D:/Web2py/web2py/applications/BBOnline/controllers/default.py" 
> , line 7774, in 
> 
>   File "D:\Web2py\web2py\gluon\globals.py", line 372, in 
> self._caller = lambda f: f()
>   File "D:/Web2py/web2py/applications/BBOnline/controllers/default.py" 
> , line 2699, in 
> update_issues
> if form.accepts(request.vars,session):
>   File "D:\Web2py\web2py\gluon\sqlhtml.py", line 1505, in accepts
> field.uploadfolder)
>   File "D:\Web2py\web2py\gluon\dal.py", line 9681, in store
> dest_file = open(pathfilename, 'wb')
> IOError: [Errno 2] No such file or directory: 
> 'D:\\Web2py\\web2py\\applications\\BBOnline\\databases\\..\\uploads\\issues.attach_file.8ddd3149b14cb8e9.4d6f6e6579204d617474657273206578706f7365205072696d6172792041647669736f722066726f6d20436f6e7461637420746f20496e76204163636f756e74207669657720616e642064796e616d6963207265706f7274732e70707478.pptx
>
> Sincerley, Rahul D.
>

-- 
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: Google charts plugin added

2013-11-13 Thread Sarbjit
Thanks Tim,

I have a question:

In your example, data is present in controller itself, how can I store the 
data effectively in database and then use that data for plotting graphs?

Can you please provide an example of how this can be stored/retrieved from 
db? I searched the net and found people suggesting pickle/json for 
storing/retrieving from db, but I'm not having any experience with both. 
Can you please help.

def plugin_return_data():
data = 
[['Year','Sales','Expenses'],["2004",1000,400],["2005",1100,440],["2006",1200,600],
["2007",1500,800],["2008",1600,850],["2009",1800,900]]
return dict(data=data)

-Sarbjit

-- 
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: Google charts plugin added

2013-11-13 Thread Tim Richardson
All you need to do is return data as an array. That's all the controller 
does.
So you need to learn how to retrieve data using the DAL, and put it into an 
array.
For example, you can get rows from a query, and iterate over the returned 
rows, building up the array. 





On Wednesday, November 13, 2013 9:42:39 PM UTC+11, Sarbjit wrote:
>
> Thanks Tim,
>
> I have a question:
>
> In your example, data is present in controller itself, how can I store the 
> data effectively in database and then use that data for plotting graphs?
>
> Can you please provide an example of how this can be stored/retrieved from 
> db? I searched the net and found people suggesting pickle/json for 
> storing/retrieving from db, but I'm not having any experience with both. 
> Can you please help.
>
> def plugin_return_data():
> data = 
> [['Year','Sales','Expenses'],["2004",1000,400],["2005",1100,440],["2006",1200,600],
> ["2007",1500,800],["2008",1600,850],["2009",1800,900]]
> return dict(data=data)
>
> -Sarbjit
>

-- 
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] Error uploading 60 character named .pptx file

2013-11-13 Thread Ricardo Pedroso
On Wed, Nov 13, 2013 at 10:00 AM, Rahul  wrote:

> Hi All,
>   I get an error like below when I upload a file (.pptx [could be with
> other extensions too not tested]) in latest web2py - downloaded from trunk
> yesterday as below. I am on Win7 and IE9 .The file name looks insanely huge
> as highlighted below. I am able to upload pptx files prior to this file
> albeit short names. This file has approximately sixty characters like
> [Toney Catters expose Spouscold data to Int Locount list view].pptx. Is
> there a limit on file name specification when attaching files in web2py
> (note - I haven't specified any in the app)?
>
> *Error Description: *
>  [Errno 2] No such file or directory:
> 'D:\\Web2py\\web2py\\applications\\BBOnline\\databases\\..\\uploads
> \\issues.attach_file.8ddd3149b14cb8e9.4d6f6e6579204d617474657273206578706f7365205072696d6172792041647669736f722066726f6d20436f6e7461637420746f20496e76204163636f756e74207669657720616e642064796e616d6963207265706f7274732e70707478.pptx'
>

You may be hitting a windows limit:
http://msdn.microsoft.com/en-us/library/aa365247.aspx#maxpath

-- 
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] Web Framework Benchmarks

2013-11-13 Thread Mirko
http://www.techempower.com/benchmarks/
A lot of web frameworks but no web2py in this list... :(

-- 
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] SQLFORM.grid to view and using groupby clause

2013-11-13 Thread Johann Spies
Why not use the 'group by' in the creation of the view and then you can
just view the view using the grid with no need to group by again in the
grid?

Regards
Johann


On 13 November 2013 03:06, Meir  wrote:

>
> Hello,
>
> I have the following problem: I have created a view in the legacy database.
> In this view created a field ID of type integer and unique.
>
> I used SQLFORM.grid using fields = [...] to specify the fields that wanted
> and used the groupby = ... to perform clustering.
> But it returns an error stating that the database must specify the ID in
> the group by clause 
> Do not understand the reason for the error. If I put the ID in the groupby
> clause SQLFORM.grid, there does not generate the error, but my grid is not
> grouped because the ID is unique  :/
>
> Anyone have any ideas?
>
> --
> 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.
>



-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

-- 
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] SQLFORM.grid to view and using groupby clause

2013-11-13 Thread Meir

Hello Johann,

It's why I created this view with the concept of cube to BI. I carry a lot 
of information forlater summarize according to the parameters of the users, 
but this I do in web2py.
I'm working with web2py like my small BI ...
Then the assembly is accomplished in various ways as defined by the user.

Thanks for your time!

Em quarta-feira, 13 de novembro de 2013 10h51min52s UTC-2, 
>
>
>> Hello,
>>
>> I have the following problem: I have created a view in the legacy 
>> database.
>> In this view created a field ID of type integer and unique.
>>
>> I used SQLFORM.grid using fields = [...] to specify the fields that 
>> wanted and used the groupby = ... to perform clustering.
>> But it returns an error stating that the database must specify the ID in 
>> the group by clause 
>> Do not understand the reason for the error. If I put the ID in the 
>> groupby clause SQLFORM.grid, there does not generate the error, but my grid 
>> is not grouped because the ID is unique  :/
>>
>> Anyone have any ideas?
>>
>> -- 
>> 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.
>>
>
>
>
> -- 
> Because experiencing your loyal love is better than life itself, 
> my lips will praise you.  (Psalm 63:3)
>  

-- 
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: development server slow

2013-11-13 Thread Vinicius Assef
I changed to chrome and it's working ok.

The problem persists with Firefox. I already tried some configs
changes, but with no success.

Fortunately, It's not a rocket problem.


On Sat, Nov 9, 2013 at 11:53 PM, Vinicius Assef  wrote:
> On Sat, Nov 9, 2013 at 10:52 AM, Niphlod  wrote:
>>
>> @vinicius: did you try loading static files with e.g. curl to see if it's a
>> browser culprit or rocket's (default webserver in web2py) fault ?
>
> Good point, Simone.
>
> As this is an intermittent problem, I'll try working in a different browser.

-- 
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] How to generate URLs for each user similar to twitter?

2013-11-13 Thread Jonathan Lundell
On 13 Nov 2013, at 1:44 AM, Noah  wrote:

> I understand that Web2Py's urls work like this: 
> 127.0.0.1:9292///
> 
> I'm building an app that has user logins and I want to have a sort of profile 
> page for each user that has an easy to remember URL. Similar to on twitter 
> where to go to a user's page you just navigate totwitter.com/. How 
> does one achieve this using Web2Py?
> 
> Currently I have it working so that the Username is a GET parameter and the 
> URL looks like: 
> 127.0.0.1:9292//Users/Wall?UserName=Thomas1 
> Where 'Users' is the Controller and 'Wall' is the function.
>   
> I want it to be: 127.0.0.1:9292//Users/Thomas1

The parametric router should be able to help you out. 

Define a router for your app that includes something like this. I'll call the 
app 'Noah'.

routers = dict(

# base router
BASE=dict(
default_application='Noah',
),

Noah=dict(
default_controller = 'YouPick',   # this *could* be 'Users', of course, 
if you want to leave it out of your URLs: http://mydomain.com/Thomas1.
default_function = dict(
Users='Wall',
...
),
   functions = dict(
Users=['Wall', 'Index', 'Whatever'],
...
   ),
),
)

By making default_function a dictionary, you can specify a different default 
function per controller. If that's not important to you, you can just make it a 
string and give each controller the same default function.

Listing functions per controller gives the router enough information that it 
can recognize that 'Thomas1' in your example is not a function name. You might 
want to name functions in Users such that you'd never encounter a user by that 
name (or reserve those names in your registration process).

The general idea is that you have to give the router enough information that it 
can unambiguously parse your incoming URLs.

-- 
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] SQLFORM.grid to view and using groupby clause

2013-11-13 Thread Meir
Hello Johann,

It's why I created this view with the concept of cube to BI. I carry a lot 
of information forlater summarize according to the parameters of the users, 
but this I do in web2py.
I'm working with web2py like my small BI ...
Then the assembly is accomplished in various ways as defined by the user.

Thanks for your time!

Em quarta-feira, 13 de novembro de 2013 10h51min52s UTC-2, Johann Spies 
escreveu:
>
> Why not use the 'group by' in the creation of the view and then you can 
> just view the view using the grid with no need to group by again in the 
> grid?
>
> Regards
> Johann
>
>
> On 13 November 2013 03:06, Meir >wrote:
>
>>
>> Hello,
>>
>> I have the following problem: I have created a view in the legacy 
>> database.
>> In this view created a field ID of type integer and unique.
>>
>> I used SQLFORM.grid using fields = [...] to specify the fields that 
>> wanted and used the groupby = ... to perform clustering.
>> But it returns an error stating that the database must specify the ID in 
>> the group by clause 
>> Do not understand the reason for the error. If I put the ID in the 
>> groupby clause SQLFORM.grid, there does not generate the error, but my grid 
>> is not grouped because the ID is unique  :/
>>
>> Anyone have any ideas?
>>
>> -- 
>> 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.
>>
>
>
>
> -- 
> Because experiencing your loyal love is better than life itself, 
> my lips will praise you.  (Psalm 63:3)
>  

-- 
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 url rewrting problem

2013-11-13 Thread Naitik patel
Hi

Everyone,


I have done project in web2py .I want to do url rewriting  in web2py.
means some url like */app/controller/function* like this type.
but I want to  change that url as per my requirement.
what are the setting I have to do ?
please help me for that?


Regards,
Naitik patel

-- 
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] Problems upgrading from 2.7.2 to 2.7.4 on Mac OS X 10.9 (Mavericks)

2013-11-13 Thread TC
I attempted using the auto upgrade package.  The Welcome web site page came 
up but all the links give an Internal Error ticket number which I can't see 
without Admin and the admin interface gives another Internal Error.  I 
completely removed the 2.7.2 version for a totally fresh install of 2.7.4. 
 All attempts at downloading the Mac version gives a Application is DAMAGED 
and should be removed.  It will not launch.  I tried the stable version and 
the test version.  Both give the application is damaged message when 
attempting to launch.  I'm running Mac OS X 10.9.   I have no web2py at all 
now.  Any suggestions on how to get running again? 

-- 
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] orderby variable, uknown column

2013-11-13 Thread Noah Corradin
can someone explain to me why the following does not perform the way i 
thought it would

This works:
results=db(db.allstats.ptype==ptype).select(db.allstats.ALL, 
orderby=db.allstats.attack)

But this does not:

statA = request.vars.stat1
order='db.allstats.'+statA

results = db(db.allstats.ptype==ptype).select(db.allstats.ALL, 
orderby=order)

i receive: uknown column 'db.allstats.attack'

i've built selects using variables but i cant build orderby with variables? 
any tips would be awesome.

-- 
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] Using MEMDB with Scheduler

2013-11-13 Thread Joel Rathgaber
Hey all, 

I was attempting to set up a scheduler using a memcache backed MEMDB as the 
store, but I keep getting this error.

 int() argument must be a string or a number, 
not 'MemcacheClientObj'
Traceback:

Traceback (most recent call last):
  File "/usr/home/jrathgaber/bunnyhugdev/web2py/gluon/restricted.py", line 217, 
in restricted
exec ccode in environment
  File 
"/usr/home/jrathgaber/bunnyhugdev/web2py/applications/test_memdb_scheduler/models/scheduler.py"
 
,
 line 7, in 
scheduler = Scheduler(db)
  File "/usr/home/jrathgaber/bunnyhugdev/web2py/gluon/scheduler.py", line 458, 
in __init__
self.define_tables(db, migrate=migrate)
  File "/usr/home/jrathgaber/bunnyhugdev/web2py/gluon/scheduler.py", line 533, 
in define_tables
migrate=self.__get_migrate('scheduler_run', migrate)
  File "/usr/home/jrathgaber/bunnyhugdev/web2py/gluon/contrib/memdb.py", line 
163, in define_table
t._create()
  File "/usr/home/jrathgaber/bunnyhugdev/web2py/gluon/contrib/memdb.py", line 
230, in _create
self._db[referenced]._tableobj)
TypeError: int() argument must be a string or a number, not 'MemcacheClientObj'

The line of code that seems to be causing the issue is this:

ftype = \   
 self._db._translator[field.type[:9]](  
 
 self._db[referenced]._tableobj)

The field.type in question is a 'reference' which corresponds to a _translator 
value of int.  

_db[referenced] is 'scheduler_task' and is of type gluon.contrib.memdb.Table 
and _tableobj is the MemcacheClient instance, as the error points out.

What's going on here? Am I doing something wrong?

I set up my scheduler like this

import gluon.contrib.memcache 
from gluon import current 
from gluon.contrib.memdb import MEMDB 
memcache_servers = ['127.0.0.1:11211'] 
cache.memcache = gluon.contrib.memcache.MemcacheClient( 
request,memcache_servers 
) 
current.cache = cache db = MEMDB(cache.memcache)  
from gluon.scheduler import Scheduler 
scheduler = Scheduler(db) 


Thanks in advance.

Cheers,

--Joel.





-- 
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] ValueError in local_import when trying to use a constant defined above in the file

2013-11-13 Thread Pascal Polleunus
Hi,
In models/db.py, I do this settings = local_import("settings")

In modules/settings.py, there's the following lines:

FOO = "abc"
BAR = "{}def".format(FOO)


When I execute this command on my server (WebFaction):

web2py.py --no-banner -S app_name -M -N -R 
applications/app_name/cron/jobs.py

there's a error:

  File "applications/app_name/modules/settings.py", line 2, in 
BAR = "{}def".format(FOO)
ValueError: zero length field name in format


On my local environment it works fine.

Any idea why?

Thanks in advance,
Pascal

-- 
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: comma in html filename causing invalid request

2013-11-13 Thread John Felps
Why? RFC 1738 states "Thus, only alphanumerics, the special characters 
"$-_.+!*'(),", and reserved characters used for their reserved purposes may 
be used unencoded within a URL." A comma is a valid 'special character'. 
The system I'm working with uses special characters to delineate special 
meaning. Hyphens and underscores are routed correctly. I can change it to 
use something else, a period perhaps, but seems kind of non-standard or 
unorthodox to not support the RFC.  

On Monday, November 11, 2013 11:15:23 AM UTC-7, Leonel Câmara wrote:
>
> It is sort of unorthodox to have commas in the path section of your URL 
> unless you have code to specially deal with it and you're using it as a 
> separator for something.
>

> So I'm guessing the regex in the examples doesn't consider the comma and 
> you have to change it.
>
> So change something like this: 
> routes_in=( (r'/static/(?P[\w./-]+)', r'/init/static/\g') )
> to: routes_in=( (r'/static/(?P[\w,./-]+)', r'/init/static/\g') 
> )
>
>
> My suggestion would be **not to do this**, and change the names of the 
> files to have no commas, static files are not user uploads, and should be 
> controlled by you.
>
>
> Segunda-feira, 11 de Novembro de 2013 15:29:34 UTC, John Felps escreveu:
>>
>> I have edited routes.parametric.example.py and saved as web2py/routes.py 
>> with the default application as myapp. I have some html files in static 
>> that now can be accessed as 
>>
>>
>> http://ip/myapp/static/dir/test.html or 
>> http://ip/static/dir/test.html
>> however, a couple of files have commas in the filename. They work when 
>> using 
>>
>> http://ip/myapp/static/dir/test,name.html
>>
>> but not with 
>>
>> http://ip/static/dir/test,name.html
>>
>> They return "Invalid Request" in this case. 
>>
>

-- 
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] query from drop down menu

2013-11-13 Thread Noah Corradin
Thank you very much for the reply. i was able to figure it out but ill look 
into this method as well.


On Tuesday, November 5, 2013 9:04:57 PM UTC-8, Kiran Subbaraman wrote:
>
> I would use the ajax+callback mechanism that exists in web2py to do 
> this. Look at the simple wiki example, and *search*code there: 
> http://web2py.com/books/default/chapter/29/03/overview#A-simple-wiki. 
>
>  
> Kiran Subbaraman 
> http://subbaraman.wordpress.com/about/ 
>
> On 11/6/2013 7:22 AM, Noah Corradin wrote: 
> > I am trying to execute a query based on the values of 3 drop down 
> > menus.  I have the following for drop down menus but i am unsure on 
> > how to turn the selected values into queries. 
> > Is this the proper way to do it in web2py? 
> > 
> > {{extend 'layout.html'}} 
> > 
> > {{rows = db().select(db.stats.ALL)}}  {{for row in 
> > rows:}}{{=row.name}}{{pass}}  
> > {{rows = db().select(db.stats.ALL)}}  {{for row in 
> > rows:}}{{=row.name}}{{pass}}  
> > 
> > any pointers would be great 
> > 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] Looking for advice for implementing a form to order multiple items

2013-11-13 Thread Vincent Borghi
Hello,

I'm thinking about implementing a form for ordering parts, and before 
starting this work I'd like to have some advice.  Here is the base 
functionality wanted:

- The form would include multiple similar lines made of 3 fields, to hold a 
"part_reference", a "part_description" and a "quantity".

- A simple implementation would prepare a basic form with a fixed number of 
lines, say 5, and the user would fill only the lines that he would need. 
But it would be nicer to have an "add part/line to order" button that would 
add a line to the form. And also a "remove part/line from order" button for 
each individual  part/line.

- The user could be assisted in entering the  "part_reference" value by an 
autocomplete/suggest functionality that would query my "parts" database, 
but it would be possible to enter a reference not in the db. When a 
reference entered is found in the db, the "part_description" field would be 
automatically populated with the associated information coming from the db. 
(The description could be shown during the autocompletion/suggest process, 
also). The description could be made editable, as this is useful in the 
case the part is not found in the DB.
The autocomplete/suggest feature can either be a special dedicated utility 
e.g. above the form, or this could be integrated in each individual 
"part_reference" input field.

- The "quantity" field could be enhanced with a clickable +/- quantity 
incrementer/decrementer

- Once the user clicks the button "submit", the form contents would be 
processed by a web2py controller that would loop on each part specified in 
the form (ignoring lines that do not have a part number or whose quantity 
is 1). Only the part_reference and the quantity are used (part_description 
is of no use here). Is there some web2py example of such form processing 
with looping on multiple similar input line?

Well, I'm interested if you have examples and advice (or even ready to use 
code!), snippets of code (jquery/javascript and web2py as well)...

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] Ajax function

2013-11-13 Thread Luca Dalla Palma

Hello,
this is my *view*


on the *controller *I build a function containing the folowing code:

pippone='ciao'
stringa.append("jQuery('#paginatore').html('%s');" % pippone())
print pippone
return stringa

The console says
ciao
(the HTML generated appears to be right)

When the function returns, I expect the new anchor to appear in the 
"paginatore" div, but it doesn't. Anybody can suggest me why?

-- 
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: parent child tree query logic

2013-11-13 Thread 黄祥
a, sorry, my fault, didn't notice that the id field is none. thanks for 
show me my own mistake. is there a way to arrange the result for that?
e.g. expected result :
root
- child 1
- child 2

thanks and best regards,
stifan

p.s.
i've change the code into :
*models/db_wizard.py*
# coding: utf8

from gluon.dal import Table

class TreeProxy(object):
skeleton = Table(None, 'tree',
 Field('ileft', 'integer'),
 Field('iright', 'integer'))

def __init__(self, table):
self.table = table

def ancestors(self, node):
db = self.table._db
return db(self.table.ileft <= node.ileft)(self.table.iright > node.iright)

def descendants(self, node):
db = self.table._db
return db(self.table.ileft >= node.ileft)(self.table.iright < node.iright)

def add_leaf(self, parent_id = None, **fields):
if not parent_id:
nrecords = self.table._db(self.table).count()
fields.update(dict(ileft = nrecords, iright = nrecords))
else:
node = self.table(parent_id)
fields.update(dict(ileft = node.iright, iright = node.iright))
node.update_record(iright = node.iright + 1)
ancestors = self.ancestors(node).select()
for ancestor in ancestors:
ancestor.update_record(iright = ancestor.iright + 1)
ancestors = self.ancestors(node).select()
for ancestor in ancestors:
ancestor.update_record(iright = ancestor.iright + 1)
return self.table.insert(**fields)

def del_node(self, node):
delta = node.iright - node.ileft
deleted = self.descendants(node).delete()
db = self.table._db
db(self.table.iright > node.iright).update(iright = self.table.iright - 
delta)
del self.table[node.id]
return deleted + 1

treeproxy = TreeProxy(db.define_table('mytree', Field('name'), 
TreeProxy.skeleton))

if db(db.mytree).isempty():
id = treeproxy.add_leaf(name = "root")
treeproxy.add_leaf(parent_id = id, name = "child1")
treeproxy.add_leaf(parent_id = id, name = "child2")

*controllers/default.py*
def test():
all_rows = db(db.mytree.id > 0).select()
return dict(all_rows = all_rows)

*views/default/test.html*
{{extend 'layout.html'}}

{{for all_row in all_rows:}}
{{for node_ancestor in 
treeproxy.ancestors(db.mytree(all_row.id)).select():}}
{{=DIV('ID : ', all_row.id)}}
{{=BR()}}
{{=DIV('Ancestor : ', node_ancestor.name)}}
{{=BR()}}
{{pass}}
{{for node_descendant in 
treeproxy.descendants(db.mytree(all_row.id)).select():}}
{{=DIV('ID : ', all_row.id)}}
{{=BR()}}
{{=DIV('Descendant : ', node_descendant.name)}}
{{=BR()}}
{{pass}}
{{pass}}

-- 
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: comma in html filename causing invalid request

2013-11-13 Thread Richard Vézina
I thougth you were having trouble with filename... I just remember the old
not written rules... You do what you want...


On Tue, Nov 12, 2013 at 9:34 AM, John Felps wrote:

> Why? RFC 1738 states "Thus, only alphanumerics, the special characters
> "$-_.+!*'(),", and reserved characters used for their reserved purposes may
> be used unencoded within a URL." A comma is a valid 'special character'.
> The system I'm working with uses special characters to delineate special
> meaning. Hyphens and underscores are routed correctly. I can change it to
> use something else, a period perhaps, but seems kind of non-standard or
> unorthodox to not support the RFC.
>
> On Monday, November 11, 2013 11:15:23 AM UTC-7, Leonel Câmara wrote:
>>
>> It is sort of unorthodox to have commas in the path section of your URL
>> unless you have code to specially deal with it and you're using it as a
>> separator for something.
>>
>
>> So I'm guessing the regex in the examples doesn't consider the comma and
>> you have to change it.
>>
>> So change something like this:
>> routes_in=( (r'/static/(?P[\w./-]+)', r'/init/static/\g') )
>> to: routes_in=( (r'/static/(?P[\w,./-]+)',
>> r'/init/static/\g') )
>>
>>
>> My suggestion would be **not to do this**, and change the names of the
>> files to have no commas, static files are not user uploads, and should be
>> controlled by you.
>>
>>
>> Segunda-feira, 11 de Novembro de 2013 15:29:34 UTC, John Felps escreveu:
>>>
>>> I have edited routes.parametric.example.py and saved as
>>> web2py/routes.py with the default application as myapp. I have some html
>>> files in static that now can be accessed as
>>>
>>>
>>> http://ip/myapp/static/dir/test.html or
>>> http://ip/static/dir/test.html
>>> however, a couple of files have commas in the filename. They work when
>>> using
>>>
>>> http://ip/myapp/static/dir/test,name.html
>>>
>>> but not with
>>>
>>> http://ip/static/dir/test,name.html
>>>
>>> They return "Invalid Request" in this case.
>>>
>>  --
> 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: Looking for advice for implementing a form to order multiple items

2013-11-13 Thread 黄祥
i think you can achieve it using session for store the items after that 
checkout and then submit it (like online shopping cart method)
ref:
https://github.com/mdipierro/web2py-appliances/tree/master/PosOnlineStore

or if you want grid solution (create the header first and then you can add, 
edit, delete the detail items for the header created)
ref:
http://www.web2pyslices.com/slice/show/1658/invoice2py

if you want to use autocomplete/suggest in form field, please take a look 
at book :
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Autocomplete-widget

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: rocket, windows server, bad file descriptor error due to gluon debug message

2013-11-13 Thread Rob Paire
For what it's worth, I worked through a series of apparently random 
connection errors when I was using MSSQL database. Searching the net it 
appeared to be a problem with MSSQL and not web2py DAL. I decided to change 
the database to Postgres. There were some challenges getting Postgres 
installed on windows, namely due to security rights on the install folder. 

It's been a week now with no connection issues, I still have my fingers 
crossed. 

I was running from source because these errors were crashing web2py 
service, here are the type of errors I was getting:

DEBUG: connect attempt 0, connection error:
Traceback (most recent call last):
  File "C:\web2py\gluon\dal.py", line 7610, in __init__
self._adapter = ADAPTERS[self._dbname](**kwargs)
  File "C:\web2py\gluon\dal.py", line 3323, in __init__
if do_connect: self.reconnect()
  File "C:\web2py\gluon\dal.py", line 627, in reconnect
self.connection = f()
  File "C:\web2py\gluon\dal.py", line 3321, in connector
return self.driver.connect(cnxn,**driver_args)
OperationalError: ('HYT00', '[HYT00] [Microsoft][ODBC SQL Server 
Driver]Timeout expired (0) (SQLDriverConnect); [01S00] [Microsoft][ODBC SQL 
Server Driver]Invalid connection string attribute (0)')



On Tuesday, November 12, 2013 11:54:59 PM UTC-5, Tim Richardson wrote:
>
>  Rocket running as a windows service possibly doesn't like attempts to 
> write to stderr. 
>
>
> Traceback (most recent call last):
>   File "d:\web2py_internet\gluon\restricted.py", line 217, in restricted
> exec ccode in environment
>   File "d:/web2py_internet/applications/patient_form/models/db.py" 
> , line 
> 132, in 
> db_ps_1BE = DAL('xxx', lazy_tables=True, pool_size=10, attempts=20)
>   File "d:\web2py_internet\gluon\dal.py", line 7537, in __init__
> sys.stderr.write('DEBUG: connect attempt %i, connection error:\n%s' % (k, 
> tb))
> IOError: [Errno 9] Bad file descriptor
>
>

-- 
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: Problems with mail.send()

2013-11-13 Thread Kariloy Markief
Well, sorry to bring this back from the grave but after some hours 
debugging I've come to realize that I'm having the same problem has 
Bernardo. So I was wondering, has by any chance 'sasl_method=PLAIN' have 
been enabled as a possibility since then? Because, if so it isn't being 
obvious to me.

Thank you. 

On Thursday, December 2, 2010 2:16:42 PM UTC, mdipierro wrote:
>
> No but I can add that. I will take a look. 
>
> On Dec 2, 4:35 am, Bernardo  wrote: 
> > Hi Massimo, 
> > 
> > I finally found where the problem is. It is something to do with the 
> > SASL CRAM-MD5 authentification at server side. Just to debug purposes, 
> > is there any way to use the 'sasl_method=PLAIN' when using 
> > mail.send()? 
> > 
> > thanks a lot, 
> > Bernardo 
> > 
> > On 1 dic, 23:38, Bernardo  wrote: 
> > 
> > > All right. It seems to load the certificate now. But... still not 
> > > sending the mail. Now web2py prints the following line: 
> > 
> > > WARNING:web2py:Mail.send failure:(535, '5.7.8 Error: authentication 
> > > failed: authentication failure') 
> > 
> > > The mail.log in the mail server shows the following lines: 
> > 
> > > Dec  1 22:35:11 mail postfix/smtpd[3398]: connect from MyIp 
> > > Dec  1 22:35:11 mail postfix/smtpd[3398]: setting up TLS connection 
> > > from MyIp 
> > > Dec  1 22:35:12 mail postfix/smtpd[3398]: Anonymous TLS connection 
> > > established from MyIp: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 
> > > bits) 
> > > Dec  1 22:35:12 mail postfix/smtpd[3398]: warning: SASL authentication 
> > > failure: no secret in database 
> > > Dec  1 22:35:12 mail postfix/smtpd[3398]: warning: MyIp: SASL CRAM-MD5 
> > > authentication failed: authentication failure 
> > > Dec  1 22:35:12 mail postfix/smtpd[3398]: lost connection after AUTH 
> > > from MyIp 
> > > Dec  1 22:35:12 mail postfix/smtpd[3398]: disconnect from MyIp 
> > 
> > > So, I guess that there must be a problem with the certificates? 
> > 
> > > On 1 dic, 23:27, mdipierro  wrote: 
> > 
> > > > You are using x509 signed emails. You set your certificates with: 
> > 
> > > > > mail.settings.x509_sign_keyfile = 'url_to_postfix.key' 
> > > > > mail.settings.x509_sign_certfile = 'url_to_postfix.cert' 
> > > > > mail.settings.x509_crypt_certfiles = 'url_to_postfix.cert' 
> > 
> > > > but they should not be urls, they should be full paths to 
> localfiles. 
> > 
> > > > On Dec 1, 4:07 pm, Bernardo  wrote: 
> > 
> > > > > More news Massimo, 
> > 
> > > > > After following the execution of send method from Mail class, I 
> found 
> > > > > where it throws the exception that makes it return False. Those 
> are my 
> > > > > new mail settings: 
> > > > > mail.settings.server = 'mydomain:25'  # your SMTP server 
> > > > > mail.settings.sender = 'berna...@mydomain.com' # your 
> email 
> > > > > mail.settings.login = 'bernardo@mydomain:mypass'  # your 
> > > > > credentials or None 
> > > > > mail.settings.cipher_type = 'x509' 
> > > > > mail.settings.sign = False 
> > > > > mail.settings.x509_sign_keyfile = 'url_to_postfix.key' 
> > > > > mail.settings.x509_sign_certfile = 'url_to_postfix.cert' 
> > > > > mail.settings.x509_crypt_certfiles = 'url_to_postfix.cert' 
> > 
> > > > > The exception is thrown in line 502 of gluon/tools.py 
> > > > >  500 # make an encryption cert's stack 
> > > > >  501 for x in x509_crypt_certfiles: 
> > > > >  502 sk.push(X509.load_cert(x)) 
> > > > >  503 s.set_x509_stack(sk) 
> > 
> > > > > My question, what is the difference between 
> > > > > mail.settings.x509_sign_certfile and 
> > > > > mail.settings.x509_crypt_certfiles 
> > 
> > > > > Does this info makes things clearer? 
> > 
> > > > > thanks a lot again and kind regards, 
> > > > > Bernardo 
> > 
> > > > > On 1 dic, 20:49, Bernardo  wrote: 
> > 
> > > > > > Ok Massimo, 
> > 
> > > > > > I'll post if I find something. 
> > 
> > > > > > thanks a lot!! 
> > > > > > Bernardo 
> > 
> > > > > > On 1 dic, 19:30, mdipierro  wrote: 
> > 
> > > > > > > web2py is failing to connect and send the email. Something is 
> wrong in 
> > > > > > > the settings. To debug, you can try add something some print 
> > > > > > > statements inside the class Mail send function. Sorry I do not 
> have a 
> > > > > > > better advice. 
> > 
> > > > > > > On Dec 1, 12:27 pm, Bernardo Botella Corbí  
> wrote: 
> > 
> > > > > > > > It prints 
> > 
> > > > > > > > False 
> > 
> > > > > > > > Bernardo 
> > 
> > > > > > > > 2010/12/1 mdipierro  
> > 
> > > > > > > > > try from the shell 
> > 
> > > > > > > > > python web2py.py -A yourapp -N -M 
> > 
> > > > > > > > > print mail.send(to="..@...", message="", 
> subject="...") 
> > 
> > > > > > > > > Massimo 
> > 
> > > > > > > > > On Dec 1, 11:55 am, Bernardo  wrote: 
> > > > > > > > > > Hi Massimo, 
> > 
> > > > > > > > > > thanks for your reply. I connected without problems 
> using telnet on 
> > > > > > > > > > port 25 
> > 
> > > > > >

Re: [web2py] SQLFORM.grid to view and using groupby clause

2013-11-13 Thread Niphlod
you can't have a column in the grid with a groupby that is not the groupby 
itself or an aggregate of another column, just like you can't in SQL.

-- 
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: Database insert of time field in web2py not working?

2013-11-13 Thread Niphlod
db.table.field.requires.append(what_you_need)

On Wednesday, November 13, 2013 6:43:38 AM UTC+1, User wrote:
>
> So since a time field automatically has an IS_TIME validator how would you 
> specify additional validators after the db.define_table statement?
>
> On Tuesday, November 12, 2013 3:51:12 AM UTC-5, Niphlod wrote:
>>
>> requires can be a list of validators.
>>
>> On Tuesday, November 12, 2013 9:32:27 AM UTC+1, User wrote:
>>>
>>> Just realized I added the following lines after my db.define_table 
>>> statement:
>>>  
>>> db.sometable.start_time.notnull = True
>>> db.sometable.start_time.requires = IS_NOT_EMPTY()
>>>
>>>  
>>> I'm thinking that my assignment of IS_NOT_EMPTY() overwrote the default 
>>> IS_TIME() validator associated with time fields.  Does this sound like what 
>>> the problem is?  If so, how do I get around it?
>>>
>>> On Tuesday, November 12, 2013 3:24:36 AM UTC-5, User wrote:
>>>
 I have some code that was working before but I can't quite pinpoint why 
 it's not working now.  In any case it's a time field in a table and when I 
 insert into this field the database shows '00:00:00' in the field (by 
 looking at the record in an SQLite admin tool)

 Field('start_time','time', default='2:00PM'),

 I have a form where this value is inserted along with other form 
 values.  The insert statement looks like:

  form.vars.id = db.sometable.insert(**db.sometable._filter_fields(form.
 vars))

  
 I have inspected form.vars in the debugger immediately before this 
 statement is executed and I can see form.vars.start_time has a string 
 value 
 such as '3:00PM'.  The insert statement executes with no error and the 
 record is inserted in the database but the time field shows as 
 00:00:00. This further causes an error when trying to view the database 
 record from web2py:
  
 ValueError: invalid literal for int() with base 10: '00PM'
  
  
 Any idea why the time is not inserting properly and how to fix it? Is 
 the time string in the wrong format?



-- 
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: ValueError in local_import when trying to use a constant defined above in the file

2013-11-13 Thread Niphlod
you have 2.7 while webfaction sits on 2.6 ?

On Wednesday, November 13, 2013 8:29:01 AM UTC+1, Pascal Polleunus wrote:
>
> Hi,
> In models/db.py, I do this settings = local_import("settings")
>
> In modules/settings.py, there's the following lines:
>
> FOO = "abc"
> BAR = "{}def".format(FOO)
>
>
> When I execute this command on my server (WebFaction):
>
> web2py.py --no-banner -S app_name -M -N -R 
> applications/app_name/cron/jobs.py
>
> there's a error:
>
>   File "applications/app_name/modules/settings.py", line 2, in 
> BAR = "{}def".format(FOO)
> ValueError: zero length field name in format
>
>
> On my local environment it works fine.
>
> Any idea why?
>
> Thanks in advance,
> Pascal
>

-- 
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 MEMDB with Scheduler

2013-11-13 Thread Niphlod
nice shot, but scheduler isn't supported in MEMDB.

On Wednesday, November 13, 2013 6:25:40 AM UTC+1, Joel Rathgaber wrote:
>
> Hey all, 
>
> I was attempting to set up a scheduler using a memcache backed MEMDB as 
> the store, but I keep getting this error.
>
>  int() argument must be a string or a number, 
> not 'MemcacheClientObj'
> Traceback:
>
> Traceback (most recent call last):
>   File "/usr/home/jrathgaber/bunnyhugdev/web2py/gluon/restricted.py", line 
> 217, in restricted
> exec ccode in environment
>   File 
> "/usr/home/jrathgaber/bunnyhugdev/web2py/applications/test_memdb_scheduler/models/scheduler.py"
>  
> ,
>  line 7, in 
> scheduler = Scheduler(db)
>   File "/usr/home/jrathgaber/bunnyhugdev/web2py/gluon/scheduler.py", line 
> 458, in __init__
> self.define_tables(db, migrate=migrate)
>   File "/usr/home/jrathgaber/bunnyhugdev/web2py/gluon/scheduler.py", line 
> 533, in define_tables
> migrate=self.__get_migrate('scheduler_run', migrate)
>   File "/usr/home/jrathgaber/bunnyhugdev/web2py/gluon/contrib/memdb.py", line 
> 163, in define_table
> t._create()
>   File "/usr/home/jrathgaber/bunnyhugdev/web2py/gluon/contrib/memdb.py", line 
> 230, in _create
> self._db[referenced]._tableobj)
> TypeError: int() argument must be a string or a number, not 
> 'MemcacheClientObj'
>
> The line of code that seems to be causing the issue is this:
>
> ftype = \   
>  self._db._translator[field.type[:9]](
>
>  self._db[referenced]._tableobj)
>
> The field.type in question is a 'reference' which corresponds to a 
> _translator value of int.  
>
> _db[referenced] is 'scheduler_task' and is of type gluon.contrib.memdb.Table 
> and _tableobj is the MemcacheClient instance, as the error points out.
>
> What's going on here? Am I doing something wrong?
>
> I set up my scheduler like this
>
> import gluon.contrib.memcache 
> from gluon import current 
> from gluon.contrib.memdb import MEMDB 
> memcache_servers = ['127.0.0.1:11211'] 
> cache.memcache = gluon.contrib.memcache.MemcacheClient( 
> request,memcache_servers 
> ) 
> current.cache = cache db = MEMDB(cache.memcache)  
> from gluon.scheduler import Scheduler 
> scheduler = Scheduler(db) 
>
>
> Thanks in advance.
>
> Cheers,
>
> --Joel.
>
>
>
>
>
>

-- 
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: orderby variable, uknown column

2013-11-13 Thread Niphlod
because db.table.field is NOT a string.

statA = request.vars.stat1
order='db.allstats.'+statA

should be

statA = request.vars.stat1
order=db.allstats[statA]

On Wednesday, November 13, 2013 3:32:20 AM UTC+1, Noah Corradin wrote:
>
> can someone explain to me why the following does not perform the way i 
> thought it would
>
> This works:
> results=db(db.allstats.ptype==ptype).select(db.allstats.ALL, 
> orderby=db.allstats.attack)
>
> But this does not:
>
> statA = request.vars.stat1
> order='db.allstats.'+statA
>
> results = db(db.allstats.ptype==ptype).select(db.allstats.ALL, 
> orderby=order)
>
> i receive: uknown column 'db.allstats.attack'
>
> i've built selects using variables but i cant build orderby with 
> variables? any tips would be awesome.
>

-- 
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: Problems upgrading from 2.7.2 to 2.7.4 on Mac OS X 10.9 (Mavericks)

2013-11-13 Thread Massimo Di Pierro
Does it unzip? I am trying it with OSX 10.7.3 and it works fine.

On Tuesday, 12 November 2013 20:24:30 UTC-6, TC wrote:
>
> I attempted using the auto upgrade package.  The Welcome web site page 
> came up but all the links give an Internal Error ticket number which I 
> can't see without Admin and the admin interface gives another Internal 
> Error.  I completely removed the 2.7.2 version for a totally fresh install 
> of 2.7.4.  All attempts at downloading the Mac version gives a Application 
> is DAMAGED and should be removed.  It will not launch.  I tried the stable 
> version and the test version.  Both give the application is damaged message 
> when attempting to launch.  I'm running Mac OS X 10.9.   I have no web2py 
> at all now.  Any suggestions on how to get running again? 
>

-- 
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 url rewrting problem

2013-11-13 Thread Massimo Di Pierro
http://web2py.com/books/default/chapter/29/04/the-core?search=routes.py#URL-rewrite

On Wednesday, 13 November 2013 01:13:46 UTC-6, Naitik patel wrote:
>
> Hi
>
> Everyone,
>
>
> I have done project in web2py .I want to do url rewriting  in web2py.
> means some url like */app/controller/function* like this type.
> but I want to  change that url as per my requirement.
> what are the setting I have to do ?
> please help me for that?
>
>
> Regards,
> Naitik patel
>
>

-- 
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 TIMEOUT

2013-11-13 Thread Niphlod


On Tuesday, November 12, 2013 11:23:25 PM UTC+1, LightOfMooN wrote:
>
> I don't want worker without timeout. I just want scheduler task not to be 
> stopped because of timeout from one of thousands records. Why scheduler 
> doesn't execute tasks with status=='TIMEOUT'?
>

because any task that times out is not a task that anyone should retry 
automatically.
 

>
> I have some function like:
>
> thing = db.executesql(db(db.things.id>0)._select(..., 
> orderby=db.things.up_date))[0]
> try:
> get url, parse, ...
> db.executesql(db(db.things.id==thing[0])._update(availability=True, 
> up_date=request.now))
> except:
> db.executesql(db(db.things.id==thing[0])._update(availability=False, 
> up_date=request.now))
>
> And one wrong URL or 404 break all update system because of timeout, which 
> stops all task.
>
>
it should, because you're wanting all of those to happen in a single 
transaction. 
If your app is consistent with a single "fetch", just do

foreach thing in things:
 .fetch()
 insert()
 .commit()
 mark thing as fetched
 
and if you want the "fetch" to have a timeout so you can actually control 
your task and not having it run away, set a timeout on the fetch, and a 
proportional timeout on the task.

Even better, make a single task that fetches the single url, so your 
timeoutted tasks will be only the ones that actually timed out.


@limedrop : me doesn't, given that is the most bad design choice a task 
processor can implement. If you want to shoot yourself in the foot, a 
single task that requeues timeoutted tasks is easy to accomplish, as 
@lightofmoon found 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] security concerns

2013-11-13 Thread sasogeek
A friend wants me to build a loaning system applocation for him. This raises a 
few flags considering that it deals with money and people's personal 
information. But I'm particularly concerned about the security of web2py... I 
want to be able to assure him that the system will be secure. I have no 
experience with security or cryptography. Can I go ahead and tell him that the 
system will be secure? Or there are some security measures I can take... Like 
automatically encrypting data?

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


Re: [web2py] Re: comma in html filename causing invalid request

2013-11-13 Thread John Felps
I substituted periods for commas and that seems to work. I'll have to find 
one of these unwritten rules manuals, although that sounds like a 
contradiction in terms. 

On Wednesday, November 13, 2013 8:25:37 AM UTC-7, Richard wrote:
>
> I thougth you were having trouble with filename... I just remember the old 
> not written rules... You do what you want...
>
>
> On Tue, Nov 12, 2013 at 9:34 AM, John Felps 
> > wrote:
>
>> Why? RFC 1738 states "Thus, only alphanumerics, the special characters 
>> "$-_.+!*'(),", and reserved characters used for their reserved purposes may 
>> be used unencoded within a URL." A comma is a valid 'special character'. 
>> The system I'm working with uses special characters to delineate special 
>> meaning. Hyphens and underscores are routed correctly. I can change it to 
>> use something else, a period perhaps, but seems kind of non-standard or 
>> unorthodox to not support the RFC.  
>>
>> On Monday, November 11, 2013 11:15:23 AM UTC-7, Leonel Câmara wrote:
>>>
>>> It is sort of unorthodox to have commas in the path section of your URL 
>>> unless you have code to specially deal with it and you're using it as a 
>>> separator for something.
>>>
>>
>>> So I'm guessing the regex in the examples doesn't consider the comma and 
>>> you have to change it.
>>>
>>> So change something like this: 
>>> routes_in=( (r'/static/(?P[\w./-]+)', r'/init/static/\g') )
>>> to: routes_in=( (r'/static/(?P[\w,./-]+)', 
>>> r'/init/static/\g') )
>>>
>>>
>>> My suggestion would be **not to do this**, and change the names of the 
>>> files to have no commas, static files are not user uploads, and should be 
>>> controlled by you.
>>>
>>>
>>> Segunda-feira, 11 de Novembro de 2013 15:29:34 UTC, John Felps escreveu:

 I have edited routes.parametric.example.py and saved as 
 web2py/routes.py with the default application as myapp. I have some html 
 files in static that now can be accessed as 


 http://ip/myapp/static/dir/test.html or 
 http://ip/static/dir/test.html
 however, a couple of files have commas in the filename. They work when 
 using 

 http://ip/myapp/static/dir/test,name.html

 but not with 

 http://ip/static/dir/test,name.html

 They return "Invalid Request" in this case. 

>>>  -- 
>> 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] Google App Engine NoSql geopoint field supported by DAL?

2013-11-13 Thread i . misc
Hello everyone, 

i just started my web2py carrier, and so far I am intrigued. Anyway I have 
the following question, as i could not really find it the docs. 
Does the DAL support the geopoint field of the google Big Table data store, 
and thus location based queries as described by in app engine docs?. 
And are there any best practices to deal with the geopoint when working in 
a local development environment so it can be ported to app engine,  but 
still be useful in a local environment? 

Thanks, 
cee 



-- 
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] security concerns

2013-11-13 Thread Richard Vézina
Do you know Rentila?? http://www.rentila.com/

I think it RoR, it is very worth to try before trying to implement
something...

What you want to do is not as easy as it seems to be, as you explained
there is many things to consider.

For a local deployment behind firewall you can trust web2py to be secure,
but for going on the big bad web, I would suggest you to hire an expert in
security...  So he could review web2py and your code too, that may
introduce security hole if you don't know what you do exactly...

That said, my biggest concern would be about the money though...

:)

Richard



On Wed, Nov 13, 2013 at 2:04 PM, sasogeek  wrote:

> A friend wants me to build a loaning system applocation for him. This
> raises a few flags considering that it deals with money and people's
> personal information. But I'm particularly concerned about the security of
> web2py... I want to be able to assure him that the system will be secure. I
> have no experience with security or cryptography. Can I go ahead and tell
> him that the system will be secure? Or there are some security measures I
> can take... Like automatically encrypting data?
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/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: security concerns

2013-11-13 Thread Derek
Well, if you don't know you are secure, then you should have a security 
audit. If you don't know anyone who does security audits, can't do it 
yourself, and can't pay anyone to do it, then you will just have to settle 
for being insecure. If security is paramount then you'd likely want to get 
software which has already proven to be secure. There are many ways to do 
things wrong in web2py, but the documented ways are usually secure.

On Wednesday, November 13, 2013 12:04:57 PM UTC-7, sasogeek wrote:
>
> A friend wants me to build a loaning system applocation for him. This 
> raises a few flags considering that it deals with money and people's 
> personal information. But I'm particularly concerned about the security of 
> web2py... I want to be able to assure him that the system will be secure. I 
> have no experience with security or cryptography. Can I go ahead and tell 
> him that the system will be secure? Or there are some security measures I 
> can take... Like automatically encrypting data?

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


[web2py] Re: Web Framework Benchmarks

2013-11-13 Thread Derek
You can submit a pull request, so go right ahead and do it.

On Wednesday, November 13, 2013 5:31:30 AM UTC-7, Mirko wrote:
>
> http://www.techempower.com/benchmarks/
> A lot of web frameworks but no web2py in this list... :(
>

-- 
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: mssql connection

2013-11-13 Thread Derek
Possible...

Microsoft OLE DB Provider for ODBC Drivers error '80004005' 
[Microsoft][ODBC Driver Manager]Data source name not found and no default 
driver specified. 
This usually happens in one of the following scenarios:
   
   - you referenced your connection incorrectly (e.g. spelled the DSN name, 
   or one of the DSN-less string components wrong);
   - you referenced a DSN that doesn't exist;
   - the user connecting to the DSN or DSN-less connection doesn't have 
   access to the information stored in the registry (see KB 
#306345
   );
   - you used an English or localized driver detail for your connection 
   string when your system is not set up in that language (see KB 
#174655); 
   or,
   - you are missing the connection string entirely (this can happen if you 
   maintain your connection string in a session variable, and your sessions 
   aren't working; see Article #2157
   ).

http://tutorials.aspfaq.com/8000x-errors/80004005-errors.html

On Tuesday, November 12, 2013 9:03:05 PM UTC-7, Cacpacific O wrote:
>
> Hello Tim,
>
> Thank you for sharing.
> I've try as your advice but it still return error message as follow, Is it 
> possible that there is something wrong with my odbc setup.
>
> :)
>
> db = DAL('mssql://UserName:passw...@203.xxx.xx. 
> xxx\SQLExpress/myDatabase', 
> lazy_tables=True, pool_size=10)
>
> RuntimeError: Failure to connect, tried 5 times:
>
> Traceback (most recent call last):
>
>  File "/home/www-data/web2py/gluon/dal.py", line 7562, in __init__
>
>self._adapter = ADAPTERS[self._dbname](**kwargs)
>
>  File "/home/www-data/web2py/gluon/dal.py", line 3279, in __init__
>
>if do_connect: self.reconnect()
>
>  File "/home/www-data/web2py/gluon/dal.py", line 627, in reconnect
>
>self.connection = f()
>
>  File "/home/www-data/web2py/gluon/dal.py", line 3277, in connector
>
>return self.driver.connect(cnxn,**driver_args)
>
> Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not 
> found, and no default driver specified (0) (SQLDriverConnect)')
>
>
>
>
> On Wednesday, November 13, 2013 5:27:55 AM UTC+7, Tim Richardson wrote:
>>
>> Here is a working example using server authentication on a server called 
>> win2003, with a sqlserver instance name hcnsql07 and connecting to a 
>> database called hcn using default ports
>>
>> (I've added a couple of other parameters for performance.
>>  Investigate lazy_tables, it makes a huge difference. )
>>
>>
>> db_ps_1TE = DAL('mssql://tim:password@win2003\hcnsql07/hcn', 
>> lazy_tables=True, pool_size=10)
>>
>> On Monday, 11 November 2013 07:10:43 UTC+11, Ariya Owam-aram wrote:
>>>
>>> Dear all,
>>>
>>> I have to connect mssql database which is locate on  another server by 
>>> using pyodbc.
>>>
>>> It working if connect by using 
>>>
>>> pyodbc.connect(DNS=dns;UID=user_name;PWD=password)
 

>>>
>>> But I can't connect with  DAL()
>>>
>>> db = 
 DAL("mssql://userName:passw...@203.xxx.xx.xxx\SQLExpress,1433/myDatabase")
>>>
>>>
>>> return error as follow
>>>
 Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name 
 not found, and no default driver specified (0) (SQLDriverConnect)')
>>>
>>>
>>> As searching from web2py google group, I also try:
>>>
>>> db = 
 DAL("mssql://userName:passw...@203.xxx.xx.xxx\SQLExpress,1433/myDatabase?Driver={FreeTDS}")
>>>
>>>
>>> return error as follow
>>>
>>> Error: ('08001', '[08001] [unixODBC][FreeTDS][SQL Server]Unable to 
>>> connect to data source (0) (SQLDriverConnect)')
>>>
>>> ---
>>> in my /etc/odbc.ini
>>>
>>> [TS]
 Description="ODBC Connection via FreeTDS"
 Driver=FreeTDS
 Server=203.xxx.xx.xxx
 port=1433
 Database=myDatabase
>>>
>>> ---
>>> in my /etc/odbcinst.ini
>>>
 [FreeTDS]
 Description=FreeTDS
 Driver=/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
 Setup=/usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
>>>
>>> ---
>>> in my /etc/freetds/freetds.conf
>>>
>>> ### Did not change anything ###
>>>
>>> ---
>>> in my /etc/freetds/tds.driver.template  
>>>
 [TDS]
 Description = FreeTDS Driver for Linux & MSSQL on Win32
 Driver  = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
 Setup   = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
>>>
>>> ---
>>> in my /etc/freetds/tds.dsn.template
>>>
>>> [DSN_NAME]
>>>
 Description = Descripton of you DSN connection.
 Driver  = TDS
 Trace   = No
 Database= myDatabase
 Server  = 203.xxx.xx.xxx
 Port= 1433
 TDS_Version = 8.0
>>>
>>>
>>>
>>>
>>> Thank you very much
>>> Ariya
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Sour

[web2py] Re: mssql connection

2013-11-13 Thread Niphlod
@derek: except that he's using unixodbc ^_^

Anyway, googling "[unixODBC][Driver Manager]Data source name not found" 
leads you to several hundreds blogposts on the matter. 

-- 
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: Ajax function

2013-11-13 Thread Derek
You're using eval, but are you returning executable javascript from your 
function 'paginatore' ?

On Tuesday, November 12, 2013 7:17:52 AM UTC-7, Luca Dalla Palma wrote:
>
>
> Hello,
> this is my *view*
> 
>
> on the *controller *I build a function containing the folowing code:
>
> pippone='ciao'
> stringa.append("jQuery('#paginatore').html('%s');" % pippone())
> print pippone
> return stringa
>
> The console says
>  href="#">ciao
> (the HTML generated appears to be right)
>
> When the function returns, I expect the new anchor to appear in the 
> "paginatore" div, but it doesn't. Anybody can suggest me why?
>

-- 
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: mssql connection

2013-11-13 Thread Derek
Regardless, it's the same message just a different driver manager. I'd say 
one of the settings being passed just won't work for mssql express, i'd 
guess 'pooling'.

On Wednesday, November 13, 2013 3:25:38 PM UTC-7, Niphlod wrote:
>
> @derek: except that he's using unixodbc ^_^
>
> Anyway, googling "[unixODBC][Driver Manager]Data source name not found" 
> leads you to several hundreds blogposts on the matter. 
>

-- 
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: How to make registrations invitation-only with Janrain login/registrations

2013-11-13 Thread Derek
Sure, there is a way to do that. Do you want to have users send out invite 
codes to their friends, or is this a beta test type thing where once codes 
are used up they can't use again, or is this for tracking sources?

On Friday, November 8, 2013 5:57:08 AM UTC-7, Dragan Matic wrote:
>
> When using web2py authentication I can check if user is logging in or 
> registering a new user and then I can check if it has proper invitation 
> code in and deny him registration. 
>
> But what if user is using Janrain? Login and registraton is then done 
> through an external app. Is there a way to intercept registration and check 
> for invitation code and deny it somehow if necessary?
>
>
>

-- 
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: Best practice when making downloads more private.

2013-11-13 Thread Derek
I think you could modify rocket to return a 404 for a request with an etag 
or if-not-modified request in that particular folder, that should probably 
do it, to prevent downloads from the same device. for downloads from 
different devices, the approach like niphlod said would work, set a 
timeframe to dowload the file.

On Sunday, November 10, 2013 1:10:54 PM UTC-7, Encompass solutions wrote:
>
> Great input!  I think I will try the following:
> Create a special directory to store the data.
> Setup a special controller with the needed permissions and conditions.
> Have fun and do a little dance.
> Does this sound sensible?
> BR,
> Jason
>
>
> On Sun, Nov 10, 2013 at 2:43 PM, Niphlod  >wrote:
>
>>
>>
>> On Sunday, November 10, 2013 7:49:00 AM UTC+1, Encompass solutions wrote:
>>>
>>> I need a way to make downloads private/one time for the user.
>>> What is the best practice for this?
>>> * Should I need a special download script? My guess is yes.
>>> * Should I have a special directory and how would I best do that?
>>>
>>  
>> unless stored under /static/, no. web2py has no knowledge (so, the 
>> end-user doesn't either) of files outside the /static/ dir except for 
>> uploads/, that you can however "restrict" in any way you want through the 
>> "normal" auth permission scheme.
>>  
>>
>>> * Is there a way to create one time downloads without authentication?  
>>> Some of my cases will need authentication and some not.
>>>
>>  
>> in that case you surely have to serve files with your own controller 
>> checking for custom authorizations and such. BTW, one time dowloads are 
>> either hard to achieve or (from the end-user perspective) hard to offer. 
>> Several browser's extension download files with multiple connections to 
>> speed up the retrieval and so you can't just rely on accepting only the 
>> first request coming from that particular file (or those tools will 
>> probably error out as soon as the second connection is initiated). Usually 
>> instead of one-time-only downloads sites serve expiring links (i.e. "you 
>> can download it only for the next two days") coupled with a sane amount of 
>> trials (let's say 10, if files are not huge).
>>  
>> -- 
>> 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/JtlqR-WWicQ/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] serious memdb issue

2013-11-13 Thread Massimo Di Pierro
A serious issue has been reported on web2y-developers. The issue has to do 
with the memdb module. You are using it if you use session in Memcache on 
Google App Engine. The bug affects systems on high load and creates 
duplicates sessions (occasionally two users get new session with the same 
id and get to share one session). This is a security issue. There is a 
possible fix in trunk that needs testing.

The issue only affects you if you use sessions in memcache. This is not the 
default behavior.

Massimo

-- 
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] count of reference usage

2013-11-13 Thread webpypy
Hi,

I have three tables ( emp , dept ) and (many to many).

How to get (for each dept), how many times each dept is referenced?

deptnumber of occurrences
--
.
.
.

Regards,

Ashraf

-- 
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: orderby variable, uknown column

2013-11-13 Thread Noah Corradin
Thank you so much!  was this covered in some documentation i may have 
missed?

On Wednesday, November 13, 2013 8:51:06 AM UTC-8, Niphlod wrote:
>
> because db.table.field is NOT a string.
>
> statA = request.vars.stat1
> order='db.allstats.'+statA
>
> should be
>
> statA = request.vars.stat1
> order=db.allstats[statA]
>
> On Wednesday, November 13, 2013 3:32:20 AM UTC+1, Noah Corradin wrote:
>>
>> can someone explain to me why the following does not perform the way i 
>> thought it would
>>
>> This works:
>> results=db(db.allstats.ptype==ptype).select(db.allstats.ALL, 
>> orderby=db.allstats.attack)
>>
>> But this does not:
>>
>> statA = request.vars.stat1
>> order='db.allstats.'+statA
>>
>> results = db(db.allstats.ptype==ptype).select(db.allstats.ALL, 
>> orderby=order)
>>
>> i receive: uknown column 'db.allstats.attack'
>>
>> i've built selects using variables but i cant build orderby with 
>> variables? any tips would be awesome.
>>
>

-- 
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: Problems with mail.send()

2013-11-13 Thread Massimo Di Pierro
No but open a ticket. Can you help make it happen?

On Wednesday, 13 November 2013 10:45:36 UTC-6, Kariloy Markief wrote:
>
> Well, sorry to bring this back from the grave but after some hours 
> debugging I've come to realize that I'm having the same problem has 
> Bernardo. So I was wondering, has by any chance 'sasl_method=PLAIN' have 
> been enabled as a possibility since then? Because, if so it isn't being 
> obvious to me.
>
> Thank you. 
>
> On Thursday, December 2, 2010 2:16:42 PM UTC, mdipierro wrote:
>>
>> No but I can add that. I will take a look. 
>>
>> On Dec 2, 4:35 am, Bernardo  wrote: 
>> > Hi Massimo, 
>> > 
>> > I finally found where the problem is. It is something to do with the 
>> > SASL CRAM-MD5 authentification at server side. Just to debug purposes, 
>> > is there any way to use the 'sasl_method=PLAIN' when using 
>> > mail.send()? 
>> > 
>> > thanks a lot, 
>> > Bernardo 
>> > 
>> > On 1 dic, 23:38, Bernardo  wrote: 
>> > 
>> > > All right. It seems to load the certificate now. But... still not 
>> > > sending the mail. Now web2py prints the following line: 
>> > 
>> > > WARNING:web2py:Mail.send failure:(535, '5.7.8 Error: authentication 
>> > > failed: authentication failure') 
>> > 
>> > > The mail.log in the mail server shows the following lines: 
>> > 
>> > > Dec  1 22:35:11 mail postfix/smtpd[3398]: connect from MyIp 
>> > > Dec  1 22:35:11 mail postfix/smtpd[3398]: setting up TLS connection 
>> > > from MyIp 
>> > > Dec  1 22:35:12 mail postfix/smtpd[3398]: Anonymous TLS connection 
>> > > established from MyIp: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 
>> > > bits) 
>> > > Dec  1 22:35:12 mail postfix/smtpd[3398]: warning: SASL 
>> authentication 
>> > > failure: no secret in database 
>> > > Dec  1 22:35:12 mail postfix/smtpd[3398]: warning: MyIp: SASL 
>> CRAM-MD5 
>> > > authentication failed: authentication failure 
>> > > Dec  1 22:35:12 mail postfix/smtpd[3398]: lost connection after AUTH 
>> > > from MyIp 
>> > > Dec  1 22:35:12 mail postfix/smtpd[3398]: disconnect from MyIp 
>> > 
>> > > So, I guess that there must be a problem with the certificates? 
>> > 
>> > > On 1 dic, 23:27, mdipierro  wrote: 
>> > 
>> > > > You are using x509 signed emails. You set your certificates with: 
>> > 
>> > > > > mail.settings.x509_sign_keyfile = 'url_to_postfix.key' 
>> > > > > mail.settings.x509_sign_certfile = 'url_to_postfix.cert' 
>> > > > > mail.settings.x509_crypt_certfiles = 'url_to_postfix.cert' 
>> > 
>> > > > but they should not be urls, they should be full paths to 
>> localfiles. 
>> > 
>> > > > On Dec 1, 4:07 pm, Bernardo  wrote: 
>> > 
>> > > > > More news Massimo, 
>> > 
>> > > > > After following the execution of send method from Mail class, I 
>> found 
>> > > > > where it throws the exception that makes it return False. Those 
>> are my 
>> > > > > new mail settings: 
>> > > > > mail.settings.server = 'mydomain:25'  # your SMTP server 
>> > > > > mail.settings.sender = 'berna...@mydomain.com' # your 
>> email 
>> > > > > mail.settings.login = 'bernardo@mydomain:mypass'  # your 
>> > > > > credentials or None 
>> > > > > mail.settings.cipher_type = 'x509' 
>> > > > > mail.settings.sign = False 
>> > > > > mail.settings.x509_sign_keyfile = 'url_to_postfix.key' 
>> > > > > mail.settings.x509_sign_certfile = 'url_to_postfix.cert' 
>> > > > > mail.settings.x509_crypt_certfiles = 'url_to_postfix.cert' 
>> > 
>> > > > > The exception is thrown in line 502 of gluon/tools.py 
>> > > > >  500 # make an encryption cert's stack 
>> > > > >  501 for x in x509_crypt_certfiles: 
>> > > > >  502 sk.push(X509.load_cert(x)) 
>> > > > >  503 s.set_x509_stack(sk) 
>> > 
>> > > > > My question, what is the difference between 
>> > > > > mail.settings.x509_sign_certfile and 
>> > > > > mail.settings.x509_crypt_certfiles 
>> > 
>> > > > > Does this info makes things clearer? 
>> > 
>> > > > > thanks a lot again and kind regards, 
>> > > > > Bernardo 
>> > 
>> > > > > On 1 dic, 20:49, Bernardo  wrote: 
>> > 
>> > > > > > Ok Massimo, 
>> > 
>> > > > > > I'll post if I find something. 
>> > 
>> > > > > > thanks a lot!! 
>> > > > > > Bernardo 
>> > 
>> > > > > > On 1 dic, 19:30, mdipierro  wrote: 
>> > 
>> > > > > > > web2py is failing to connect and send the email. Something is 
>> wrong in 
>> > > > > > > the settings. To debug, you can try add something some print 
>> > > > > > > statements inside the class Mail send function. Sorry I do 
>> not have a 
>> > > > > > > better advice. 
>> > 
>> > > > > > > On Dec 1, 12:27 pm, Bernardo Botella Corbí <
>> estem...@gmail.com> wrote: 
>> > 
>> > > > > > > > It prints 
>> > 
>> > > > > > > > False 
>> > 
>> > > > > > > > Bernardo 
>> > 
>> > > > > > > > 2010/12/1 mdipierro  
>> > 
>> > > > > > > > > try from the shell 
>> > 
>> > > > > > > > > python web2py.py -A yourapp -N -M 
>> > 
>> > > > > > > > > print mail.send(to="..@...", message="",

[web2py] Re: count of reference usage

2013-11-13 Thread Massimo Di Pierro
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=db.person.id.count%28%29

On Wednesday, 13 November 2013 19:21:31 UTC-6, webpypy wrote:
>
> Hi,
>
> I have three tables ( emp , dept ) and (many to many).
>
> How to get (for each dept), how many times each dept is referenced?
>
> deptnumber of occurrences
> --
> .
> .
> .
>
> Regards,
>
> Ashraf
>
>

-- 
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] SQLFORM update upload field - override 'file' anchor text

2013-11-13 Thread Jim Steil
Any takers?  Won't bother again if no response to this one...


-Jim


On Tue, Nov 12, 2013 at 1:36 PM, Jim S  wrote:

> I have a SQLFORM.grid on my page.  I have an upload field in the
> referenced table/query.  In edit mode on the SQLFORM.grid the upload field
> is displayed as a link with the text being 'file'.
>
> Is there a way to override this text?
>
> -Jim
>
> --
> 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/-ErAU2GkTUQ/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] Error uploading 60 character named .pptx file

2013-11-13 Thread Rahul
Hi Ricardo, 
 Thanks for the response, but I don't understand why it should be a 
windows limit. I have many files with much larger names in windows, never 
had such a problem. Besides this only occurs when we are uploading it in 
web2py. Could SQLite database be a constraint ? I am using sqlite for this 
app.  What might cause this, for now I have reduced the file name and it 
gets uploaded just fine. 

Sincerely, Rahul D.


On Wednesday, November 13, 2013 4:57:41 PM UTC+5:30, Ricardo Pedroso wrote:
>
>
>
>
> On Wed, Nov 13, 2013 at 10:00 AM, Rahul 
> > wrote:
>
>> Hi All,
>>   I get an error like below when I upload a file (.pptx [could be 
>> with other extensions too not tested]) in latest web2py - downloaded from 
>> trunk yesterday as below. I am on Win7 and IE9 .The file name looks 
>> insanely huge as highlighted below. I am able to upload pptx files prior to 
>> this file albeit short names. This file has approximately sixty characters 
>> like [Toney Catters expose Spouscold data to Int Locount list view].pptx. 
>> Is there a limit on file name specification when attaching files in web2py 
>> (note - I haven't specified any in the app)?
>>
>> *Error Description: *
>>  [Errno 2] No such file or directory: 
>> 'D:\\Web2py\\web2py\\applications\\BBOnline\\databases\\..\\uploads
>> \\issues.attach_file.8ddd3149b14cb8e9.4d6f6e6579204d617474657273206578706f7365205072696d6172792041647669736f722066726f6d20436f6e7461637420746f20496e76204163636f756e74207669657720616e642064796e616d6963207265706f7274732e70707478.pptx'
>>  
>>
>
> You may be hitting a windows limit:
> http://msdn.microsoft.com/en-us/library/aa365247.aspx#maxpath
>
>
>  

-- 
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: count of reference usage

2013-11-13 Thread webpypy

Thank you , Massimo.

Would please write down the statement for calculating the count of Things 
for every person?

 instead of 

>>> for row in persons_and_things.select():
print row.person.name, row.thing.name
Alex Boat
Alex Chair
Bob Shoes
Curt Boat


I would like to get


Alex 2
Bob 1
Curt 1


Regards,

Ashraf

-- 
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.