Re: [web2py] Re: bootstrap 3 - if you care help test trunk now

2014-11-24 Thread Gael Princivalle
Great job and thanks for sharing Jim.
I'll use it for my current project.

Il giorno lunedì 24 novembre 2014 18:58:05 UTC+1, Jim S ha scritto:
>
> For what it's worth, I have these modifications in my app to make 
> Bootstrap 3 work with SQLFORM.grid:
>
> In db.py:
>
> def my_formstyle(form, fields):
> col_sm_label_size = 4
> col_md_label_size = 3
> form.add_class('form-horizontal col-sm-9 col-md-7 col-lg-5')
> label_col_class = "col-sm-%d col-md-%d" % (col_sm_label_size, 
> col_md_label_size)
> col_class = "col-sm-%d col-md-%d" % ((12 - col_sm_label_size), (12 - 
> col_md_label_size))
> offset_class = "col-sm-offset-%d col-md-offset-%s" % (col_sm_label_size, 
> col_md_label_size)
> parent = CAT()
> for id, label, controls, help in fields:
> # wrappers
> _help = SPAN(help, _class='help-block')
> # embed _help into _controls
> _controls = DIV(controls, _help, _class=col_class)
> if isinstance(controls, INPUT):
> if controls['_type'] == 'submit':
> controls.add_class('btn btn-primary')
> _controls = DIV(controls, _class="%s %s" % (col_class, 
> offset_class))
> if controls['_type'] == 'button':
> controls.add_class('btn btn-default')
> elif controls['_type'] == 'file':
> controls.add_class('input-file')
> elif controls['_type'] == 'text':
> controls.add_class('form-control')
> elif controls['_type'] == 'email':
> controls.add_class('form-control')
> elif controls['_type'] == 'password':
> controls.add_class('form-control')
> elif controls['_type'] == 'checkbox':
> label['_for'] = None
> label.insert(0, controls)
> _controls = DIV(DIV(label, _help, _class="checkbox"),
> _class="%s %s" % (offset_class, col_class))
> label = ''
> elif isinstance(controls, SELECT):
> controls.add_class('form-control')
> elif isinstance(controls, TEXTAREA):
> controls.add_class('form-control')
>
> elif isinstance(controls, SPAN):
> _controls = P(controls.components, _class="form-control-static 
> %s" % col_class)
>
> if isinstance(label, LABEL):
> label['_class'] = 'control-label %s' % label_col_class
>
> parent.append(DIV(label, _controls, _class='form-group', _id=id))
> return parent
>
> grid_ui = dict(widget='',
>header='',
>content='',
>default='',
>cornerall='',
>cornertop='',
>cornerbottom='',
>button='btn btn-default button',
>buttontext='buttontext button',
>buttonadd='glyphicon glyphicon-plus space-after',
>buttonback='glyphicon glyphicon-arrow-left space-after',
>buttonexport='glyphicon glyphicon-download space-after',
>buttondelete='glyphicon glyphicon-trash space-after',
>buttonedit='glyphicon glyphicon-pencil space-after',
>buttontable='glyphicon glyphicon-arrow-right space-after',
>buttonview='glyphicon glyphicon-zoom-in space-after')
>
>
> Then I pass along to my SQLFORM.grid calls like this:
>
> In my controllers:
>
> grid = SQLFORM.grid(query, fields=fields, orderby=orderby,
> create=create, details=details,
> editable=editable, deletable=deletable,
> csv=False, search_widget=defaultSearch,
> paginate=15, maxtextlength=45,
> formstyle = my_formstyle, ui=grid_ui)
>
>
> This works well with my site, you may need to tweak it to get your site 
> looking nice.  By no means is this something that will work universally.
>
> -Jim
>
>
>
> On Mon, Nov 24, 2014 at 8:33 AM, Anthony > 
> wrote:
>
>> I think the relevant BS3 functionality is there. The only thing we don't 
>> have is a BS3 based scaffolding app, but if you're using a custom theme, 
>> the scaffolding app probably wouldn't help much anyway.
>>
>> Anthony
>>
>>
>> On Monday, November 24, 2014 2:39:58 AM UTC-5, Tom Øyvind Hogstad wrote:
>>>
>>> No particular problem. More of a wondering what happened to this 
>>> "project".
>>>
>>> Since this is my first web2py project, never used Bootstrap, I also had 
>>> almost zero knowledge of Python, never really used PostgreSQL and my VPSes 
>>> have always been Centos, but I felt for Debian on my latest VPS. 200+ hours 
>>> later I need to set aside some time to refactor stuff :-)
>>> Selling in projects without being proficient in any of the tech you 
>>> wan't to use, lead to loads of fun (And a bit on the low side considering 
>>> "real" hourly rate) :-)
>>>
>>> Mostly wan't to use BS3 trying to consolidate theming to BS3 for 

[web2py] Re: web2py and post data

2014-11-24 Thread dlypka
I believe you can use the restful decorator to accept only a POST
In the following example, 'mymethod' is not a real python method - it is 
just a logical concept for convenience.

Use this URL: /myapp/mycontroller/api/mymethod

"fields" will be a convenient dict of data converted from urlencoded 
name=value pairs that were sent in the POST.

mycontroller.py
---
@request.restful()
def api():
# Input data format (from browser):  headers: { 'Content-Type': 
'application/x-www-form-urlencoded' }

def POST(methodname, **fields):
if not (methodname in ['mymethod']): raise HTTP(400)
:
# your business logic here...

I trust I have explained this correctly...

On Monday, November 24, 2014 12:56:51 PM UTC-6, محمد رشاد wrote:
>
> Hi all
> Thank you for this helpful group
> I'm new in web2py and python, I have an application that has a function 
> called "ws"
> That function has an page called "check" which accepts user inputs by this 
> "token = request.vars.token", it works and accept the inputs that come 
> using POST and GET http methods.
> What I want is to accept the POST methods only and refuse the GET ones, 
> who to do that?
>
> Thank you
>
>

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


[web2py] Extra fields in auth using CAS

2014-11-24 Thread Rodrigo
Hi All!

Is it possible to include extra fields in auth when i'm 
using CAS?
I divided my app in some , so i'll use CAS to authenticate, but the user must 
have a field called "group" , because itens added for a user in one group must 
not been seen by users from other groups, i intend 
to add this field to auth so i can read it when i'll add
another record...

-- 
Rodrigo 

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


[web2py] Re: Java Client for web2py SOAP web service

2014-11-24 Thread Pengfei Yu
Hi Dave, 

Thanks very much for your reply! Could you give a more detailed example for 
an implementation for Java client? A block of java codes from your Java 
client talking to web2py service will be perfect. Even with the most simple 
example from the web2py's SOAP service document is good enough.

Thanks!

On Friday, November 21, 2014 6:16:45 PM UTC-5, Dave S wrote:
>
>
>
> On Thursday, November 20, 2014 6:49:18 AM UTC-8, Pengfei Yu wrote:
>>
>> Hi,
>>
>> I am using the SOAP service provided by web2py to create a simple web 
>> service for my web application. The document provide a example of using 
>> "pysimplesoap" to consume the created SOAP web service. The code is like 
>> below:
>>
>> >>> from gluon.contrib.pysimplesoap.client import SoapClient
>> >>> client = 
>> >>> SoapClient(wsdl="http://localhost:8000/app/default/call/soap?WSDL";)
>> >>> print client.MyAdd(a=1,b=2)
>> {'result': 3}
>>
>> My question is for this simple web service, can we use other languages 
>> like JAVA to consume it in the client side. Does the simple web service 
>> allow JAVA clients like JAX-WS or JAVA Axis to access it?
>> My cooperator want me to create a web service for my application and they 
>> are using JAVA.
>>
>>
> I have a Java client  talking to my Web2Py service.
>
> My imports include "javax.xml.soap.xml", and i instantiate using 
> SOAPConnectionFactory.
>
> I also have a Python client that talks to the same service using suds 
> rather than pysimplesoap, so I would expect any typical client library to 
> work.  Mariano seems to have a very good library for us to leverage.
>
> /dps
>
>
>

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


Re: [web2py] Re: Published my collection of plugins

2014-11-24 Thread Dennis Jacobs
Hi Richard,

First of all, thanks for your fast reply.
And I was able to implement this plugin by changing the line below.

form2 = SQLFORM.factory(Field("Members", type=
'list:reference(db.auth_group.role)', requires=IS_IN_SET(members1,multiple=
True), widget=rhmultiselect_widget))

With
db.auth_group.role.widget = rhmultiselect_widget
db.auth_group.role.requires = [IS_IN_SET(grouplist, multiple=True)]
form2 = hmultiselect_widgetUM(db.auth_group.role, members1)

By doing this, i was able to show the "form/grid", and select the proper 
values.

However, i'm still having some problems with adding some additional actions 
to the "register" and "delete"-button.
Cause at this moment, the plugin just moves the string from box 'A' to box 
'B' without any additional actions.
I assume this can be done by adding an URL()-call to the "onclick"-list.
But i'm not sure whether this is actualy the best approach for this. (Since 
i'm not very familier with jquery).
Am i still missing something?

With kind regards,
Jacobs Dennis.


On Monday, November 24, 2014 4:01:42 PM UTC+1, Richard wrote:

> Hello Jacobs,
>
> db.table.field.default = default
>
> Don't work?
>
> Richard
>
> On Thu, Nov 20, 2014 at 9:11 AM, Dennis Jacobs  > wrote:
>
>> Hi Kenji,
>>
>> First of all I wanted to thank you for submitting and maintaining your 
>> web2py plugins.
>> However I do have one small issue with the “multiselect_widget”, which 
>> could be due to the fact that I don’t know how to implement the plugin 
>> properly.
>>
>>  
>>
>> The problem I’m currently facing is the fact that I don’t know how to 
>> preselect values.
>>
>> For instance, I’m trying to create a page where a user’s membership can 
>> be rectified.
>> The administrator first have to select a username (based on a dropdown 
>> from), afterwards the 2 boxes(“member of” and “Not member of”) should 
>> display the memberships of that specific user.
>>
>> And this is the point where I’m stuck.
>> All the groups seem to end up in the same box, and I can’t figure out how 
>> to make the selection of “members” and “nomembers”.
>>
>> And I just wanted to make sure that I’m not doing something wrong, and 
>> I’m not forgetting something.
>>
>> The line I currently have to create this widget is the following.
>> The grouplist is actualy a list of the "db.auth_group.role"-field.
>> form = SQLFORM.factory(Field("Members", 
>> type='list:reference(db.auth_group.role)', 
>> requires=IS_IN_SET(grouplist,multiple=True), widget =rhmultiselect_widget))
>>
>> With kind regards,
>> Jacobs Dennis.
>>
>>
>> On Friday, August 26, 2011 6:35:40 PM UTC+2, kenji4569 wrote:
>>>
>>> Hi, I've just published a collection of plugins which I'd created for 
>>> some web2py products (mainly cms sites) in my job: 
>>>
>>> The index page: 
>>> http://dev.s-cubism.com/web2py_plugins 
>>>
>>> The plugins are below: 
>>>
>>> [Form Widgets] 
>>>  Horizontal Radio Widget http://dev.s-cubism.com/plugin_hradio_widget 
>>>  Multiple Select Widget http://dev.s-cubism.com/
>>> plugin_multiselect_widget 
>>>  Suggest Widget http://dev.s-cubism.com/plugin_suggest_widget 
>>>  Lazy Options Widget http://dev.s-cubism.com/plugin_lazy_options_widget 
>>>  Anytime Widget http://dev.s-cubism.com/plugin_anytime_widget 
>>>  Color Widget http://dev.s-cubism.com/plugin_color_widget 
>>>  elRTE WYSIWYG Widget http://dev.s-cubism.com/plugin_elrte_widget 
>>>  Uploadify Widget http://dev.s-cubism.com/plugin_uploadify_widget 
>>>
>>> [Form Customize] 
>>>  Solid Form http://dev.s-cubism.com/plugin_solidform 
>>>  Not-Empty Marker http://dev.s-cubism.com/plugin_notemptymarker 
>>>
>>> [Table Customize] 
>>>  Solid Table http://dev.s-cubism.com/plugin_solidtable 
>>>  Pagenator http://dev.s-cubism.com/plugin_paginator 
>>>  Table Scope http://dev.s-cubism.com/plugin_tablescope 
>>>  Table Checkbox http://dev.s-cubism.com/plugin_tablecheckbox 
>>>  Table Permuter http://dev.s-cubism.com/plugin_tablepermuter 
>>>
>>> You can try demos, see souces, and download plugins (MIT Licence). 
>>> I'll appreciate your feedback and advises (especially for design 
>>> decisions). 
>>> I'll keep trying to create useful plugins and to improve them! 
>>>
>>  -- 
>> 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/d/optout.
>>
>
>

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

[web2py] Re: bootstrap 3 - if you care help test trunk now

2014-11-24 Thread Tom Øyvind Hogstad
I think the standard bootstrap theme is perfect for business apps :-)

But I do use various components: navs, buttongroups, pills and so on. And 
the App/Site is very mobile friendly.

Not many files to modify anyway. 

Tom Ø.




kl. 15:33:20 UTC+1 mandag 24. november 2014 skrev Anthony følgende:
>
> I think the relevant BS3 functionality is there. The only thing we don't 
> have is a BS3 based scaffolding app, but if you're using a custom theme, 
> the scaffolding app probably wouldn't help much anyway (and if you were 
> just going to stick with a relatively unmodified scaffolding app, then it 
> wouldn't much matter whether it were BS2 or BS3, as they would look the 
> same).
>
> Anthony
>
> On Monday, November 24, 2014 2:39:58 AM UTC-5, Tom Øyvind Hogstad wrote:
>>
>> No particular problem. More of a wondering what happened to this 
>> "project".
>>
>> Since this is my first web2py project, never used Bootstrap, I also had 
>> almost zero knowledge of Python, never really used PostgreSQL and my VPSes 
>> have always been Centos, but I felt for Debian on my latest VPS. 200+ hours 
>> later I need to set aside some time to refactor stuff :-)
>> Selling in projects without being proficient in any of the tech you wan't 
>> to use, lead to loads of fun (And a bit on the low side considering "real" 
>> hourly rate) :-)
>>
>> Mostly wan't to use BS3 trying to consolidate theming to BS3 for both 
>> Web2py and Drupal work.
>> Going for reworking my app to BS3.
>>
>> Tom Ø.
>>
>>
>>
>> kl. 18:22:13 UTC+1 søndag 23. november 2014 skrev Anthony følgende:
>>>
>>> You can use web2py with Bootstrap 3 (or any front end framework). It 
>>> even has built-in formstyles and grid classes for Bootstrap 3 (though even 
>>> without those, you can add your own custom formstyles and grid classes). Is 
>>> there a particular problem you are having?
>>>
>>> Anthony
>>>
>>> On Sunday, November 23, 2014 8:00:13 AM UTC-5, Tom Øyvind Hogstad wrote:

 What is the status of bootstrap3 now.
 It was reverted in trunc and I just started a project at that time. 
 Started in bootstrap3, but I had not done much so I reverted to bootstrap2.
 Now I would like to go back/forward to bootstrap3 again before my 
 project gets any larger.

 Tom Ø.



 kl. 09:13:38 UTC+2 lørdag 9. august 2014 skrev Massimo Di Pierro 
 følgende:
>
> Bootstrap 3 is in trunk now. Please help us test it.
> Also help us test that existing apps are not broken.
>
> 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/d/optout.


[web2py] web2py and post data

2014-11-24 Thread محمد رشاد
Hi all
Thank you for this helpful group
I'm new in web2py and python, I have an application that has a function 
called "ws"
That function has an page called "check" which accepts user inputs by this 
"token = request.vars.token", it works and accept the inputs that come 
using POST and GET http methods.
What I want is to accept the POST methods only and refuse the GET ones, who 
to do that?

Thank you

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


[web2py] Re: multiple select plugin and list reference

2014-11-24 Thread Dennis Jacobs
Hi TSmith,

I'm experiencing the exact same issue! Were you able to resolve this issue?
And if so, how exactly did you do so?

Regards,
Dennis.

On Wednesday, November 27, 2013 5:14:25 PM UTC+1, BlueShadow wrote:

> I found this wonderfull plugin: 
> http://dev.s-cubism.com/plugin_multiselect_widget
> which looks awesome for the things I wonna do.
> But I don't get ist to work with a field which has a list reference table
> I want the field to be either empty of filled with an unlimeted amount of 
> entries. So I had no required field at all:
> Field('Fruit','list:reference Fruits'),
> so I tried the following:
> from plugin_multiselect_widget import (
> hmultiselect_widget, vmultiselect_widget,
> rhmultiselect_widget, rvmultiselect_widget,
> )
> ...
> db.Cocktail.Fruit.requires=IS_EMPTY_OR(IS_IN_DB(db,'Fruits.id',
> 'Fruits.Name',multiple=True))
> db.Cocktail.Fruit.widget = hmultiselect_widget
> which gave me the multiselect widget but When I mark a fruit and click on 
> the register button nothing happens.
>
>
>

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


Re: [web2py] Re: bootstrap 3 - if you care help test trunk now

2014-11-24 Thread Anthony
Also, I don't know what version of web2py you are running, but the current 
version now includes Bootstrap 3 classes in the default "ui" dict for the 
grid, and there are now "bootstrap3_stacked" and "bootstrap3_inline" 
formstyles. Of course, you may still need to customize if these defaults 
aren't sufficient, but the same is true with Bootstrap 2 or any CSS theme.

Anthony

On Monday, November 24, 2014 12:58:05 PM UTC-5, Jim S wrote:
>
> For what it's worth, I have these modifications in my app to make 
> Bootstrap 3 work with SQLFORM.grid:
>
> In db.py:
>
> def my_formstyle(form, fields):
> col_sm_label_size = 4
> col_md_label_size = 3
> form.add_class('form-horizontal col-sm-9 col-md-7 col-lg-5')
> label_col_class = "col-sm-%d col-md-%d" % (col_sm_label_size, 
> col_md_label_size)
> col_class = "col-sm-%d col-md-%d" % ((12 - col_sm_label_size), (12 - 
> col_md_label_size))
> offset_class = "col-sm-offset-%d col-md-offset-%s" % (col_sm_label_size, 
> col_md_label_size)
> parent = CAT()
> for id, label, controls, help in fields:
> # wrappers
> _help = SPAN(help, _class='help-block')
> # embed _help into _controls
> _controls = DIV(controls, _help, _class=col_class)
> if isinstance(controls, INPUT):
> if controls['_type'] == 'submit':
> controls.add_class('btn btn-primary')
> _controls = DIV(controls, _class="%s %s" % (col_class, 
> offset_class))
> if controls['_type'] == 'button':
> controls.add_class('btn btn-default')
> elif controls['_type'] == 'file':
> controls.add_class('input-file')
> elif controls['_type'] == 'text':
> controls.add_class('form-control')
> elif controls['_type'] == 'email':
> controls.add_class('form-control')
> elif controls['_type'] == 'password':
> controls.add_class('form-control')
> elif controls['_type'] == 'checkbox':
> label['_for'] = None
> label.insert(0, controls)
> _controls = DIV(DIV(label, _help, _class="checkbox"),
> _class="%s %s" % (offset_class, col_class))
> label = ''
> elif isinstance(controls, SELECT):
> controls.add_class('form-control')
> elif isinstance(controls, TEXTAREA):
> controls.add_class('form-control')
>
> elif isinstance(controls, SPAN):
> _controls = P(controls.components, _class="form-control-static 
> %s" % col_class)
>
> if isinstance(label, LABEL):
> label['_class'] = 'control-label %s' % label_col_class
>
> parent.append(DIV(label, _controls, _class='form-group', _id=id))
> return parent
>
> grid_ui = dict(widget='',
>header='',
>content='',
>default='',
>cornerall='',
>cornertop='',
>cornerbottom='',
>button='btn btn-default button',
>buttontext='buttontext button',
>buttonadd='glyphicon glyphicon-plus space-after',
>buttonback='glyphicon glyphicon-arrow-left space-after',
>buttonexport='glyphicon glyphicon-download space-after',
>buttondelete='glyphicon glyphicon-trash space-after',
>buttonedit='glyphicon glyphicon-pencil space-after',
>buttontable='glyphicon glyphicon-arrow-right space-after',
>buttonview='glyphicon glyphicon-zoom-in space-after')
>
>
> Then I pass along to my SQLFORM.grid calls like this:
>
> In my controllers:
>
> grid = SQLFORM.grid(query, fields=fields, orderby=orderby,
> create=create, details=details,
> editable=editable, deletable=deletable,
> csv=False, search_widget=defaultSearch,
> paginate=15, maxtextlength=45,
> formstyle = my_formstyle, ui=grid_ui)
>
>
> This works well with my site, you may need to tweak it to get your site 
> looking nice.  By no means is this something that will work universally.
>
> -Jim
>
>
>
> On Mon, Nov 24, 2014 at 8:33 AM, Anthony  wrote:
>
>> I think the relevant BS3 functionality is there. The only thing we don't 
>> have is a BS3 based scaffolding app, but if you're using a custom theme, 
>> the scaffolding app probably wouldn't help much anyway.
>>
>> Anthony
>>
>>
>> On Monday, November 24, 2014 2:39:58 AM UTC-5, Tom Øyvind Hogstad wrote:
>>>
>>> No particular problem. More of a wondering what happened to this 
>>> "project".
>>>
>>> Since this is my first web2py project, never used Bootstrap, I also had 
>>> almost zero knowledge of Python, never really used PostgreSQL and my VPSes 
>>> have always been Centos, but I felt for Debian on my latest VPS. 200+ hours 
>>> later I need to s

[web2py] Re: web2py RESTful timeout

2014-11-24 Thread Leonel Câmara
Are you sure it's the POSTs to web2py that are timing out and not the 
fetching of the stock quotes?

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


Re: [web2py] Re: bootstrap 3 - if you care help test trunk now

2014-11-24 Thread Jim Steil
For what it's worth, I have these modifications in my app to make Bootstrap
3 work with SQLFORM.grid:

In db.py:

def my_formstyle(form, fields):
col_sm_label_size = 4
col_md_label_size = 3
form.add_class('form-horizontal col-sm-9 col-md-7 col-lg-5')
label_col_class = "col-sm-%d col-md-%d" % (col_sm_label_size,
col_md_label_size)
col_class = "col-sm-%d col-md-%d" % ((12 - col_sm_label_size), (12
- col_md_label_size))
offset_class = "col-sm-offset-%d col-md-offset-%s" %
(col_sm_label_size, col_md_label_size)
parent = CAT()
for id, label, controls, help in fields:
# wrappers
_help = SPAN(help, _class='help-block')
# embed _help into _controls
_controls = DIV(controls, _help, _class=col_class)
if isinstance(controls, INPUT):
if controls['_type'] == 'submit':
controls.add_class('btn btn-primary')
_controls = DIV(controls, _class="%s %s" % (col_class,
offset_class))
if controls['_type'] == 'button':
controls.add_class('btn btn-default')
elif controls['_type'] == 'file':
controls.add_class('input-file')
elif controls['_type'] == 'text':
controls.add_class('form-control')
elif controls['_type'] == 'email':
controls.add_class('form-control')
elif controls['_type'] == 'password':
controls.add_class('form-control')
elif controls['_type'] == 'checkbox':
label['_for'] = None
label.insert(0, controls)
_controls = DIV(DIV(label, _help, _class="checkbox"),
_class="%s %s" % (offset_class, col_class))
label = ''
elif isinstance(controls, SELECT):
controls.add_class('form-control')
elif isinstance(controls, TEXTAREA):
controls.add_class('form-control')

elif isinstance(controls, SPAN):
_controls = P(controls.components,
_class="form-control-static %s" % col_class)

if isinstance(label, LABEL):
label['_class'] = 'control-label %s' % label_col_class

parent.append(DIV(label, _controls, _class='form-group', _id=id))
return parent

grid_ui = dict(widget='',
   header='',
   content='',
   default='',
   cornerall='',
   cornertop='',
   cornerbottom='',
   button='btn btn-default button',
   buttontext='buttontext button',
   buttonadd='glyphicon glyphicon-plus space-after',
   buttonback='glyphicon glyphicon-arrow-left space-after',
   buttonexport='glyphicon glyphicon-download space-after',
   buttondelete='glyphicon glyphicon-trash space-after',
   buttonedit='glyphicon glyphicon-pencil space-after',
   buttontable='glyphicon glyphicon-arrow-right space-after',
   buttonview='glyphicon glyphicon-zoom-in space-after')


Then I pass along to my SQLFORM.grid calls like this:

In my controllers:

grid = SQLFORM.grid(query, fields=fields, orderby=orderby,
create=create, details=details,
editable=editable, deletable=deletable,
csv=False, search_widget=defaultSearch,
paginate=15, maxtextlength=45,
formstyle = my_formstyle, ui=grid_ui)


This works well with my site, you may need to tweak it to get your site
looking nice.  By no means is this something that will work universally.

-Jim



On Mon, Nov 24, 2014 at 8:33 AM, Anthony  wrote:

> I think the relevant BS3 functionality is there. The only thing we don't
> have is a BS3 based scaffolding app, but if you're using a custom theme,
> the scaffolding app probably wouldn't help much anyway.
>
> Anthony
>
>
> On Monday, November 24, 2014 2:39:58 AM UTC-5, Tom Øyvind Hogstad wrote:
>>
>> No particular problem. More of a wondering what happened to this
>> "project".
>>
>> Since this is my first web2py project, never used Bootstrap, I also had
>> almost zero knowledge of Python, never really used PostgreSQL and my VPSes
>> have always been Centos, but I felt for Debian on my latest VPS. 200+ hours
>> later I need to set aside some time to refactor stuff :-)
>> Selling in projects without being proficient in any of the tech you wan't
>> to use, lead to loads of fun (And a bit on the low side considering "real"
>> hourly rate) :-)
>>
>> Mostly wan't to use BS3 trying to consolidate theming to BS3 for both
>> Web2py and Drupal work.
>> Going for reworking my app to BS3.
>>
>> Tom Ø.
>>
>>
>>
>> kl. 18:22:13 UTC+1 søndag 23. november 2014 skrev Anthony følgende:
>>>
>>> You can use web2py with Bootstrap 3 (or any front end framework). It
>>> even has built-in formstyles and grid classes for Bootstrap 3 (though even
>>> without those, you can add your own c

[web2py] Re: Can I use TACACS+ for authentication?

2014-11-24 Thread Derek
Look for radius authentication. TACACS+ is aka advanced radius.

On Thursday, November 20, 2014 7:59:44 PM UTC-7, Luis Ramos wrote:
>
> Can I use TACACS+ for authentication?
>
> I can't find any documentation nor questions on this.
> Thanks!
>

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


Re: [web2py] Re: SQLite query with random not working anymore

2014-11-24 Thread Dom Dom
Hi Derek,

It's not random because out of several hundrefs of records,  it's always
the first ones (first ids) that are proposed (knowing that I limit the
number of results).
I think I should have made a mistake somewhere in the code that puts the
mess.
Forget it!

Anyway Thanks for helping
Dominique

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


Re: [web2py] after_update

2014-11-24 Thread Alex Glaros
improved but now get this error:

Traceback

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

Traceback (most recent call last):
  File "gluon/restricted.py", line 224, in restricted
  File "C:/alex/web2py/web2py/web2py/applications/ES1/controllers/default.py" 
, line 
1280, in 
  File "gluon/globals.py", line 392, in 
  File "C:/alex/web2py/web2py/web2py/applications/ES1/controllers/default.py" 
, line 
909, in view_suggestions
links = suggestionLinks,  buttons_placement = 'right')
  File "gluon/sqlhtml.py", line 2214, in grid
  File "gluon/html.py", line 2303, in process
  File "gluon/html.py", line 2240, in validate
  File "gluon/sqlhtml.py", line 1669, in accepts
  File "gluon/dal.py", line 10774, in update
  File "C:/alex/web2py/web2py/web2py/applications/ES1/models/db.py" 
, line 1440, in 
update_SuggestionDisplayName
db(db.SuperObject.id == 
ThisSuperObject.objectID).update(objectDisplayName=displayName)
  File "gluon/dal.py", line 7529, in __getitem__
AttributeError: 'Row' object has no attribute 'objectID'


CONTROLLER
# Update displayName in db.SuperObject whenever Suggestion.suggestionTitle 
is updated in db.Suggestion  
def update_SuggestionDisplayName(set, ufields):
   table = 'Suggestion' if ('suggestionTitle' in ufields) else None
   if table:
   name_format = '%(suggestionTitle)s'
   records = set.select()
   for record in records:
   displayName = name_format % record
   ThisSuperObject = db(db.SuperObject.id == 
record.objectID).select(db.SuperObject.id).first()
   ThisSuperObject.update_record(objectDisplayName=displayName)
   db(db.SuperObject.id == 
ThisSuperObject.objectID).update(objectDisplayName=displayName)

db.Suggestion._after_update.append(update_SuggestionDisplayName)

Table SuperObject
db.define_table('SuperObject',  #
Field('objectDisplayName','string', label='Object Name'),
Field('objectTypeID','reference ObjectType', label = 'Object Type'), 
format='%(objectDisplayName)s') ## 

Table Suggestion
db.define_table('Suggestion', 
Field('objectID', 'reference SuperObject'),  
Field('suggestionTitle','string', length=140, label='suggestion Title', 
comment='140 characters max'),
Field('suggestionShortSummary','string', length=280, label='Summary info', 
comment='short summary - 280 characters max'),
format='%(suggestionTitle)s')

Thanks,

Alex Glaros

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


[web2py] Re: web2py RESTful timeout

2014-11-24 Thread Derek
If you don't need sessions for those requests, you should disable sessions 
first and see if that works better. Sessions kills concurrency.

On Friday, November 21, 2014 8:36:36 AM UTC-7, Bart wrote:
>
> I have a python script that posts data to my web2py/application/projects 
> database using RESTful services.  Everything works fine for an hour or two, 
> but then all future posts will timeout.  If, using a web browser, I reload 
> the web2py application's main page then the RESTful services start working 
> again for another hour or two.  Any ideas why I cant run a script 24/7 to 
> GET/POST data to my web2py application's RESTful services? 
>

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


[web2py] Re: SQLite query with random not working anymore

2014-11-24 Thread Derek
How do you know it's not random? If it's truely random, you will get 
repeats. I think you want something other than random.

In any case, if you use pagination, your results will be sorted. Check 
db._lastsql

On Friday, November 21, 2014 7:32:00 AM UTC-7, Dominique wrote:
>
> Hello,
>
> I have a small personal website published on PythonAnywhere.
> PythonAnywhere upgraded SQLITE some time ago.
> Since then, one query doesn't work anymore. 
>
> It is a query with a many to many relationship and the select should give 
> results at random.
> rows = db(...).select(..., orderby='')
> It doesn't return me a random set of rows but rather always the same rows, 
> starting from the beginning of the possible matching rows. 
>
> I tried to address the problem without success. 
>
> I also tried not using the web2py dialect and replacing it with 
>
> import random
> rows=db(...).select().sort(lambda row: random.random())
>
>
> as explained in the web2py doc. No success either.
>
> I also replaced the query with explicit SQL statement using 
> db.executesql( SELECT.ORDER BY RANDOM() )
>
> No success !
>
> I downloaded the database onto my home pc and tested with the same website 
> in local.
> It works perfectly at home.
>
> I tested on PythonAnywhere another model (based on the docs 
> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Many-to-many
> ).
> It works fine returning results randomly. So it seems the upgrade of 
> SQLite done by PythonAnywhere is not responsible for the problem.
>
> Does anybody have an idea what's going on, why the query doesn't work on 
> PythonAnywhere and works locally ?
>
> Thanks for any hint 
> Dominique
>
>

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


Re: [web2py] Re: Published my collection of plugins

2014-11-24 Thread Richard Vézina
Hello Jacobs,

db.table.field.default = default

Don't work?

Richard

On Thu, Nov 20, 2014 at 9:11 AM, Dennis Jacobs  wrote:

> Hi Kenji,
>
> First of all I wanted to thank you for submitting and maintaining your
> web2py plugins.
> However I do have one small issue with the “multiselect_widget”, which
> could be due to the fact that I don’t know how to implement the plugin
> properly.
>
>
>
> The problem I’m currently facing is the fact that I don’t know how to
> preselect values.
>
> For instance, I’m trying to create a page where a user’s membership can be
> rectified.
> The administrator first have to select a username (based on a dropdown
> from), afterwards the 2 boxes(“member of” and “Not member of”) should
> display the memberships of that specific user.
>
> And this is the point where I’m stuck.
> All the groups seem to end up in the same box, and I can’t figure out how
> to make the selection of “members” and “nomembers”.
>
> And I just wanted to make sure that I’m not doing something wrong, and I’m
> not forgetting something.
>
> The line I currently have to create this widget is the following.
> The grouplist is actualy a list of the "db.auth_group.role"-field.
> form = SQLFORM.factory(Field("Members",
> type='list:reference(db.auth_group.role)',
> requires=IS_IN_SET(grouplist,multiple=True), widget =rhmultiselect_widget))
>
> With kind regards,
> Jacobs Dennis.
>
>
> On Friday, August 26, 2011 6:35:40 PM UTC+2, kenji4569 wrote:
>>
>> Hi, I've just published a collection of plugins which I'd created for
>> some web2py products (mainly cms sites) in my job:
>>
>> The index page:
>> http://dev.s-cubism.com/web2py_plugins
>>
>> The plugins are below:
>>
>> [Form Widgets]
>>  Horizontal Radio Widget http://dev.s-cubism.com/plugin_hradio_widget
>>  Multiple Select Widget http://dev.s-cubism.com/plugin_multiselect_widget
>>  Suggest Widget http://dev.s-cubism.com/plugin_suggest_widget
>>  Lazy Options Widget http://dev.s-cubism.com/plugin_lazy_options_widget
>>  Anytime Widget http://dev.s-cubism.com/plugin_anytime_widget
>>  Color Widget http://dev.s-cubism.com/plugin_color_widget
>>  elRTE WYSIWYG Widget http://dev.s-cubism.com/plugin_elrte_widget
>>  Uploadify Widget http://dev.s-cubism.com/plugin_uploadify_widget
>>
>> [Form Customize]
>>  Solid Form http://dev.s-cubism.com/plugin_solidform
>>  Not-Empty Marker http://dev.s-cubism.com/plugin_notemptymarker
>>
>> [Table Customize]
>>  Solid Table http://dev.s-cubism.com/plugin_solidtable
>>  Pagenator http://dev.s-cubism.com/plugin_paginator
>>  Table Scope http://dev.s-cubism.com/plugin_tablescope
>>  Table Checkbox http://dev.s-cubism.com/plugin_tablecheckbox
>>  Table Permuter http://dev.s-cubism.com/plugin_tablepermuter
>>
>> You can try demos, see souces, and download plugins (MIT Licence).
>> I'll appreciate your feedback and advises (especially for design
>> decisions).
>> I'll keep trying to create useful plugins and to improve them!
>>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] Re: bootstrap 3 - if you care help test trunk now

2014-11-24 Thread Anthony
I think the relevant BS3 functionality is there. The only thing we don't 
have is a BS3 based scaffolding app, but if you're using a custom theme, 
the scaffolding app probably wouldn't help much anyway.

Anthony

On Monday, November 24, 2014 2:39:58 AM UTC-5, Tom Øyvind Hogstad wrote:
>
> No particular problem. More of a wondering what happened to this "project".
>
> Since this is my first web2py project, never used Bootstrap, I also had 
> almost zero knowledge of Python, never really used PostgreSQL and my VPSes 
> have always been Centos, but I felt for Debian on my latest VPS. 200+ hours 
> later I need to set aside some time to refactor stuff :-)
> Selling in projects without being proficient in any of the tech you wan't 
> to use, lead to loads of fun (And a bit on the low side considering "real" 
> hourly rate) :-)
>
> Mostly wan't to use BS3 trying to consolidate theming to BS3 for both 
> Web2py and Drupal work.
> Going for reworking my app to BS3.
>
> Tom Ø.
>
>
>
> kl. 18:22:13 UTC+1 søndag 23. november 2014 skrev Anthony følgende:
>>
>> You can use web2py with Bootstrap 3 (or any front end framework). It even 
>> has built-in formstyles and grid classes for Bootstrap 3 (though even 
>> without those, you can add your own custom formstyles and grid classes). Is 
>> there a particular problem you are having?
>>
>> Anthony
>>
>> On Sunday, November 23, 2014 8:00:13 AM UTC-5, Tom Øyvind Hogstad wrote:
>>>
>>> What is the status of bootstrap3 now.
>>> It was reverted in trunc and I just started a project at that time. 
>>> Started in bootstrap3, but I had not done much so I reverted to bootstrap2.
>>> Now I would like to go back/forward to bootstrap3 again before my 
>>> project gets any larger.
>>>
>>> Tom Ø.
>>>
>>>
>>>
>>> kl. 09:13:38 UTC+2 lørdag 9. august 2014 skrev Massimo Di Pierro 
>>> følgende:

 Bootstrap 3 is in trunk now. Please help us test it.
 Also help us test that existing apps are not broken.

 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/d/optout.


[web2py] Re: bootstrap 3 - if you care help test trunk now

2014-11-24 Thread Tom Øyvind Hogstad
No particular problem. More of a wondering what happened to this "project".

Since this is my first web2py project, never used Bootstrap, I also had 
almost zero knowledge of Python, never really used PostgreSQL and my VPSes 
have always been Centos, but I felt for Debian on my latest VPS. 200+ hours 
later I need to set aside some time to refactor stuff :-)
Selling in projects without being proficient in any of the tech you wan't 
to use, lead to loads of fun (And a bit on the low side considering "real" 
hourly rate) :-)

Mostly wan't to use BS3 trying to consolidate theming to BS3 for both 
Web2py and Drupal work.
Going for reworking my app to BS3.

Tom Ø.



kl. 18:22:13 UTC+1 søndag 23. november 2014 skrev Anthony følgende:
>
> You can use web2py with Bootstrap 3 (or any front end framework). It even 
> has built-in formstyles and grid classes for Bootstrap 3 (though even 
> without those, you can add your own custom formstyles and grid classes). Is 
> there a particular problem you are having?
>
> Anthony
>
> On Sunday, November 23, 2014 8:00:13 AM UTC-5, Tom Øyvind Hogstad wrote:
>>
>> What is the status of bootstrap3 now.
>> It was reverted in trunc and I just started a project at that time. 
>> Started in bootstrap3, but I had not done much so I reverted to bootstrap2.
>> Now I would like to go back/forward to bootstrap3 again before my project 
>> gets any larger.
>>
>> Tom Ø.
>>
>>
>>
>> kl. 09:13:38 UTC+2 lørdag 9. august 2014 skrev Massimo Di Pierro følgende:
>>>
>>> Bootstrap 3 is in trunk now. Please help us test it.
>>> Also help us test that existing apps are not broken.
>>>
>>> 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/d/optout.


[web2py] Re: SQLite query with random not working anymore

2014-11-24 Thread Dominique
Hi Anthony,

Thanks a lot for your help.

Le vendredi 21 novembre 2014 17:15:44 UTC+1, Anthony a écrit :
>
>
> Can you show more of your code? In particular, how are you displaying the 
> results to determine the order? Are you sure there is not some subsequent 
> step that is re-ordering the records?
>
> My code is exactly like this one:

db.define_table('person',
Field('name'))
db.define_table('thing',
Field('name'))

db.define_table('ownership',
Field('person', 'reference person'),
Field('thing', 'reference thing'))

def populate_db():
db.person.insert(name='alex')
db.person.insert(name='bob')
db.person.insert(name='curt')
db.thing.insert(name='boat')
db.thing.insert(name='chair')
db.thing.insert(name='shoes')
db.ownership.insert(person=1, thing=1) # Alex owns Boat
db.ownership.insert(person=1, thing=2) # Alex owns Chair
db.ownership.insert(person=2, thing=3) # Bob owns Shoes
db.ownership.insert(person=3, thing=1) # Curt owns Boat too
db.ownership.insert(person=2, thing=1) # Bob owns Boat too
return
def m2m_query():
persons_and_things = db((db.person.id==db.ownership.person)& 
(db.thing.id==db.ownership.thing))
all_rows = persons_and_things.select(db.person.name, db.thing.name, 
orderby='')
alex_rows = 
persons_and_things(db.person.name=='alex').select(db.person.name, db.thing.name)
boat_rows = 
persons_and_things(db.thing.name=='boat').select(db.person.name, db.thing.name, 
orderby='')
return dict(all_rows = all_rows, alex_rows=alex_rows, boat_rows=boat_rows, 
lastSQL=db._lastsql)



I am sure that the display of the results is ok and that there is no 
re-ordering of the records.
The db._lastsql provides me with the correct SQL query and the rows shown 
are those resulting from the query.
 
SELECT  person.name, thing.name FROM person, ownership, thing WHERE 
(((person.id = ownership.person) AND (thing.id = ownership.thing)) AND 
(thing.name = 'boat')) ORDER BY Random();

Are you absolutely sure that:
>
> rows=db(...).select().sort(lambda row: random.random())
>
>
> produces the same Rows object as:
>
> rows=db(...).select()
>
>
> That would imply that either the .sort method or the built-in 
> random.random method are not working.
>
No, they're different. The problem lies in somewhere else.

The problem only exist on the website at PythonAnywhere. On my local 
machine, everything is fine.
Since I don't want to lose your time and mine, I'm going to "clean up" my 
code (I am not a professional developer !!), the database and install the 
application again.
I'll come back later if the problem remains.
Thanks a lot for your help and your time.
I really appreciate.

Dominique 

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


[web2py] Re: Support for MS Access?

2014-11-24 Thread ksotiris
Dear Leonel yes of course. 

I have already write down in my previous post changes/additions that have 
made in my "dal.py" for the new adapter.

I am new in web2py and do not know very well the framework and i would like 
to check the code someone more experienced user. I have checked it and is 
working ok... But never knows ...

Can any admin of the web2py to check and add these changes to the source of 
the web2py ? 



Τη Τετάρτη, 19 Νοεμβρίου 2014 2:24:16 μ.μ. UTC+2, ο χρήστης Leonel Câmara 
έγραψε:
>
> Good job ksotiris, maybe you could contribute this adapter and document 
> its dependencies so the other poor souls having to deal with MSACCESS have 
> a way 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/d/optout.


Re: [web2py] after_update

2014-11-24 Thread Roberto Perdomo
I dont ser the displayName field in you SuperObject table. Try change this:

ThisSuperObject.update_record(displayName=displayName)

For this:

ThisSuperObject.update_record(ObjectDisplayName=displayName)
El nov. 24, 2014 3:17 AM, "Alex Glaros"  escribió:

> anyone see what the error is with this after_update function?
>
> # Update displayName in db.SuperObject whenever Suggestion.suggestionTitle
> is updated in db.Suggestion
> def update_SuggestionDisplayName(set, ufields):
>table = 'Suggestion' if ('suggestionTitle' in ufields) else None
>if table:
>name_format = '%(suggestionTitle)s'
> records = set.select()
>for record in records:
>displayName = name_format % record
>ThisSuperObject = db(db.SuperObject.id ==
> record.objectID).select(db.SuperObject.id).first()
>ThisSuperObject.update_record(displayName=displayName)
>db(db.SuperObject.id ==
> ThisSuperObject.objectID).update(objectDisplayName=displayName)
>
>
> db.Suggestion._after_update.append(update_SuggestionDisplayName)
>
>
> Error
>  File "C:/Program Files
> (x86)/web2py/web2py/applications/ES1/models/db.py", line 1441, in
> update_SuggestionDisplayName
> ThisSuperObject.update_record(displayName=displayName)
>   File "gluon/dal.py", line 10866, in __call__
>   File "gluon/dal.py", line 10772, in update
> SyntaxError: No fields to update
>
> Function argument list
> (self=, **update_fields={})
>
> Table SuperObject
> db.define_table('SuperObject',  #
> Field('objectDisplayName','string', label='Object Name'),
> Field('objectTypeID','reference ObjectType', label = 'Object Type'),
> format='%(objectDisplayName)s') ##
>
> Table Suggestion
> db.define_table('Suggestion',
> Field('objectID', 'reference SuperObject'),
> Field('suggestionTitle','string', length=140, label='suggestion Title',
> comment='140 characters max'),
> Field('suggestionShortSummary','string', length=280, label='Summary info',
> comment='short summary - 280 characters max'),
> format='%(suggestionTitle)s')
>
> Thanks,
>
> Alex Glaros
>
>
>
>
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [web2py] Re: Scheduler misleading DEBUG logging when task reaches timeout

2014-11-24 Thread Francisco Ribeiro
Niphlod,
i have no expectations whatsoever and specially when it comes to undocumented 
features but merely reasonable hopes.

Now, let me be clear here, I also don't expect software to be always properly 
documented and specially Open-Source where talented and busy people like 
yourself generously contribute to.  I just mentioned it to explain my 
reasonable hope :)

Thank you for adding some input validation in there, it is essential.

Francisco

> On 24 Nov 2014, at 09:00, Niphlod  wrote:
> 
> there's a difference between "it's not documented" and "I expect it to do 
> that" . 
> In python standard lib, multiprocessing.Process join() method accepts a 
> timeout, and that timeout argument can - theoretically - be 0. 
> If you try that "outside" the scheduler, the same thing happens ... 100% cpu 
> and erratic behaviour.
> 
> in standard lib, timeout=None means "let it run with no timeout", but the 
> scheduler doesn't allow a timeout=None for the reasons explained before. 
> 
> summary: I'll send a patch to restrict the timeout value to be >= 1 instead 
> of >= 0.
>  
> 
>> On Sunday, November 23, 2014 10:29:19 PM UTC+1, Francisco Ribeiro wrote:
>> Niphlod, 
>>  let me tell you that the "0" is very often interpreted as "disabled" in 
>> computing. For example in "select()"  the famous UNIX system call, uses that 
>> convention for the timeout argument and the "same" happens when you use the 
>> snapshop length = 0 argument in "tcpdump -s 0" which is allowed but 
>> certainly doesn't mean 0 length . It's not spectacularly wrong nor childish, 
>> it's just a common and useful convention.
>> So, once I did not find this in the documentation, i tried that just as I 
>> tried timeout = None hoping to find it in use.
>> 
>> I understand where you are coming from but tbh i think at this stage it's 
>> too early for a scheduler engine to enforce that behaviour. There are 
>> scenarios where you don't expect applications to block but if that happens 
>> you might want to take different measures to analyse and handle what 
>> happened (while it is still running) and not necessarily to have them 
>> automatically killed. At the end of the day, a large timeout as you suggest, 
>> allows me to achieve the same result but actually doing so is what makes me 
>> feel a bit silly ;)
>> 
>> Anyway, now I understand how it works, thank you.
>> 
>> Kind regards,
>> Francisco
>> 
>> i did not find this on the documentation and 
>> 
>>> On Sunday, 23 November 2014 19:20:52 UTC, Niphlod wrote:
>>> timeout gets passed as it is to the underlying base function. Python with 
>>> timeout = 0 seems to exhibit a pretty strange behaviour, but I guess that 
>>> is allowed just because in python "we're all consenting adults". 
>>> Launching something that needs to return in 0 time is clearly something 
>>> spectacularly wrong. 
>>> As it is, scheduler is "bugged", in the sense that allowing a timeout=0 is 
>>> not safe. Until now, all "consenting adults" never used it, and perhaps we 
>>> should change the field to accept only integer starting from 1 rather than 
>>> 0 (just to discourage "consenting childs" ;-P ).
>>> 
>>> As web2py enforces "good manners", there's no way to disable the timeout, 
>>> and I think it's a safe decision to keep. A task queued with no timeout 
>>> that can potentially block any other outstanding task in a task processor 
>>> is plain silly.
>>> That being said, if you don't want any (theoretical) timeout, if you pass, 
>>> e.g.,  timeout=99, you'll get  ~12 days of timeout. 
>>> If your task is still running at that time, killing it is something that 
>>> won't bother your application at all.
> 
> -- 
> 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/3GyfgbJzAio/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [web2py] Re: Scheduler misleading DEBUG logging when task reaches timeout

2014-11-24 Thread Francisco Ribeiro
Niphlod,
i have no expectations whatsoever and specially when it comes to undocumented 
features but merely reasonable hopes.

Now, let me be clear here, I also don't expect software to be always properly 
documented and specially Open-Source where talented and busy people like 
yourself generously contribute to.  I just mentioned it to explain my 
reasonable hope :)

Thank you for adding some input validation in there, it is essential.

Francisco

> On 24 Nov 2014, at 09:00, Niphlod  wrote:
> 
> there's a difference between "it's not documented" and "I expect it to do 
> that" . 
> In python standard lib, multiprocessing.Process join() method accepts a 
> timeout, and that timeout argument can - theoretically - be 0. 
> If you try that "outside" the scheduler, the same thing happens ... 100% cpu 
> and erratic behaviour.
> 
> in standard lib, timeout=None means "let it run with no timeout", but the 
> scheduler doesn't allow a timeout=None for the reasons explained before. 
> 
> summary: I'll send a patch to restrict the timeout value to be >= 1 instead 
> of >= 0.
>  
> 
>> On Sunday, November 23, 2014 10:29:19 PM UTC+1, Francisco Ribeiro wrote:
>> Niphlod, 
>>  let me tell you that the "0" is very often interpreted as "disabled" in 
>> computing. For example in "select()"  the famous UNIX system call, uses that 
>> convention for the timeout argument and the "same" happens when you use the 
>> snapshop length = 0 argument in "tcpdump -s 0" which is allowed but 
>> certainly doesn't mean 0 length . It's not spectacularly wrong nor childish, 
>> it's just a common and useful convention.
>> So, once I did not find this in the documentation, i tried that just as I 
>> tried timeout = None hoping to find it in use.
>> 
>> I understand where you are coming from but tbh i think at this stage it's 
>> too early for a scheduler engine to enforce that behaviour. There are 
>> scenarios where you don't expect applications to block but if that happens 
>> you might want to take different measures to analyse and handle what 
>> happened (while it is still running) and not necessarily to have them 
>> automatically killed. At the end of the day, a large timeout as you suggest, 
>> allows me to achieve the same result but actually doing so is what makes me 
>> feel a bit silly ;)
>> 
>> Anyway, now I understand how it works, thank you.
>> 
>> Kind regards,
>> Francisco
>> 
>> i did not find this on the documentation and 
>> 
>>> On Sunday, 23 November 2014 19:20:52 UTC, Niphlod wrote:
>>> timeout gets passed as it is to the underlying base function. Python with 
>>> timeout = 0 seems to exhibit a pretty strange behaviour, but I guess that 
>>> is allowed just because in python "we're all consenting adults". 
>>> Launching something that needs to return in 0 time is clearly something 
>>> spectacularly wrong. 
>>> As it is, scheduler is "bugged", in the sense that allowing a timeout=0 is 
>>> not safe. Until now, all "consenting adults" never used it, and perhaps we 
>>> should change the field to accept only integer starting from 1 rather than 
>>> 0 (just to discourage "consenting childs" ;-P ).
>>> 
>>> As web2py enforces "good manners", there's no way to disable the timeout, 
>>> and I think it's a safe decision to keep. A task queued with no timeout 
>>> that can potentially block any other outstanding task in a task processor 
>>> is plain silly.
>>> That being said, if you don't want any (theoretical) timeout, if you pass, 
>>> e.g.,  timeout=99, you'll get  ~12 days of timeout. 
>>> If your task is still running at that time, killing it is something that 
>>> won't bother your application at all.
> 
> -- 
> 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/3GyfgbJzAio/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


[web2py] Re: Scheduler misleading DEBUG logging when task reaches timeout

2014-11-24 Thread Niphlod
there's a difference between "it's not documented" and "I expect it to do 
that" . 
In python standard lib, multiprocessing.Process join() method accepts a 
timeout, and that timeout argument can - theoretically - be 0. 
If you try that "outside" the scheduler, the same thing happens ... 100% 
cpu and erratic behaviour.

in standard lib, timeout=None means "let it run with no timeout", but the 
scheduler doesn't allow a timeout=None for the reasons explained before. 

summary: I'll send a patch to restrict the timeout value to be >= 1 instead 
of >= 0.
 

On Sunday, November 23, 2014 10:29:19 PM UTC+1, Francisco Ribeiro wrote:
>
> Niphlod, 
>  let me tell you that the "0" is very often interpreted as "disabled" in 
> computing. For example in "select()"  the famous UNIX system call, uses 
> that convention for the timeout argument and the "same" happens when you 
> use the snapshop length = 0 argument in "tcpdump -s 0" which is allowed but 
> certainly doesn't mean 0 length . It's not spectacularly wrong nor 
> childish, it's just a common and useful convention.
> So, once I did not find this in the documentation, i tried that just as I 
> tried timeout = None hoping to find it in use.
>
> I understand where you are coming from but tbh i think at this stage it's 
> too early for a scheduler engine to enforce that behaviour. There are 
> scenarios where you don't expect applications to block but if that happens 
> you might want to take different measures to analyse and handle what 
> happened (while it is still running) and not necessarily to have them 
> automatically killed. At the end of the day, a large timeout as you 
> suggest, allows me to achieve the same result but actually doing so is what 
> makes me feel a bit silly ;)
>
> Anyway, now I understand how it works, thank you.
>
> Kind regards,
> Francisco
>
> i did not find this on the documentation and 
>
> On Sunday, 23 November 2014 19:20:52 UTC, Niphlod wrote:
>>
>> timeout gets passed as it is to the underlying base function. Python with 
>> timeout = 0 seems to exhibit a pretty strange behaviour, but I guess that 
>> is allowed just because in python "we're all consenting adults". 
>> Launching something that needs to return in 0 time is clearly something 
>> spectacularly wrong. 
>> As it is, scheduler is "bugged", in the sense that allowing a timeout=0 
>> is not safe. Until now, all "consenting adults" never used it, and perhaps 
>> we should change the field to accept only integer starting from 1 rather 
>> than 0 (just to discourage "consenting childs" ;-P ).
>>
>> As web2py enforces "good manners", there's no way to disable the timeout, 
>> and I think it's a safe decision to keep. A task queued with no timeout 
>> that can potentially block any other outstanding task in a task processor 
>> is plain silly.
>> That being said, if you don't want any (theoretical) timeout, if you 
>> pass, e.g.,  timeout=99, you'll get  ~12 days of timeout. 
>> If your task is still running at that time, killing it is something that 
>> won't bother your application at all.
>>
>>

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