[web2py] how to add style in header of current page?

2015-09-21 Thread Edward Shave
I'm sure this is going to be trivial but I can't seem to find an example...

I want to add some styles into the header of just the specific page I'm 
working on, so not generally wanting to edit layout.htm? 

-- 
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] how to add style in header of current page?

2015-09-21 Thread Selman Kocael
you can do one of these:

1. clone layout.html as layout1.html and edit for the page. use
layout1.html in the page.
2. in layout.html, give id to elements. in the page, change styles using
css.
3. don't use layout.html, create all page from scratch. (not recommended )

2015-09-21 12:44 GMT+03:00 Edward Shave :

> I'm sure this is going to be trivial but I can't seem to find an example...
>
> I want to add some styles into the header of just the specific page I'm
> working on, so not generally wanting to edit layout.htm?
>
> --
> 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.
>



-- 
Selman Kocael
İsabet Yayınları

-- 
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: how to add style in header of current page?

2015-09-21 Thread Leonel Câmara
The default layout.html has a {{block head}} you can put them there. 
Another alternative is to append them to response.files in the controller 
response.files.append(URL('static','css/mystyles.css')).

-- 
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] appadmin 10 roew show - not 100!

2015-09-21 Thread Dmitri Ermolaev
appadmin work slowly!!!
please limit rows in list to 10

or make input for set LIMIT rows in DB view in appadmin controller

-- 
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: how to add style in header of current page?

2015-09-21 Thread Anthony
On Monday, September 21, 2015 at 6:56:45 AM UTC-4, Leonel Câmara wrote:
>
> The default layout.html has a {{block head}} you can put them there.
>

Specifically, in the view of the specific page (e.g., mypage.html), you 
would have:

{{block head}}

[your styles]

{{end}}

Anthony

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


[web2py] Re: appadmin 10 roew show - not 100!

2015-09-21 Thread Niphlod
if it's slow it's for YOUR application, not the largest majority out there.

Edit 
https://github.com/web2py/web2py/blob/master/applications/welcome/controllers/appadmin.py#L210
 
to "10" in your own if you feel comfortable with 10 lines per page.

On Monday, September 21, 2015 at 1:36:41 PM UTC+2, Dmitri Ermolaev wrote:
>
> appadmin work slowly!!!
> please limit rows in list to 10
>
> or make input for set LIMIT rows in DB view in appadmin controller
>

-- 
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: Reverse Proxy problem with grid form (bootstrap 3.x)

2015-09-21 Thread Niphlod
web2py can't be blamed if your reverse proxy is not acting as a passthrough 


On Monday, September 21, 2015 at 8:13:38 AM UTC+2, Daniel Vogel wrote:
>
> Hi,
>
> Some additional information. With older web2py versions (bootstrap 2.x) we 
> have wrong sizing with the login behind reverse proxy (field has not the 
> normal size).
> With the new web2py version the problem is gone, but a new one appeared 
> (see my first screen shot). I think it's a bug.
>
>
>
> 
> (Login field behind reverse proxy, bootstrap 2.x)
>
> Thanks
>
>
> Am Mittwoch, 9. September 2015 04:48:42 UTC+2 schrieb Daniel Vogel:
>>
>> Hi,
>>
>> I use web2py 2.12.3 with auth.wiki. In development mode, no problem with 
>> HTML rendering. But behind a Apache reverse proxy in need some rules to 
>> change HTML URL's.
>>
>> ProxyHTMLEnable On
>> ProxyHTMLLinks imgsrc
>> ProxyHTMLLinks ahref
>>
>> 
>> Require all granted
>> ProxyPass http://localhost:8000/eav
>> ProxyPassReverse http://localhost:8000/
>> ProxyHTMLURLMap http://localhost:8000/eav /eav
>> 
>>
>> With this settings the grid form is deformed, the first search field is 
>> as high as the display. If I remove the "ProxyHTMLURLMap", it's ok, but all 
>> the img URL's has localhost:8000 in auth.wiki.
>>
>>
>>
>> 
>>
>>
>>
>> How can I fix this problem?
>>
>>
>> Thanks
>>
>> 
>>
>

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


[web2py] component form without submit button

2015-09-21 Thread Manuele Pesenti
Hi *,
I would like to realize a little one-text-field form and submit the
typed value each time the content of the field is changed and its
content is greater than 3 characters. The form is called inside a web2py
component so run something like this.form.submit() as onchange callback
is not the right solution because the whole page is submitted and not
only the desidered content.

can somebody help me please?

Thank you very mutch
Cheers

Manuele

-- 
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: Polymer and SQLFORM

2015-09-21 Thread Niphlod
you should simply override widget defaults (according to your own 
formstyle.)
As for "HTML helpers" go for TAG, which can create whatever you may need 
without littering the global environment.

On Monday, September 21, 2015 at 1:51:00 AM UTC+2, Luis Valladares wrote:
>
> Hello!
>
> I'm building a web2py site and i want to use polymer as my front-end 
> "framework", as you may know polymer uses web elements with custom html 
> tags, i mean, a input is something can be something like
>
> 
>
> I want to integrate this "feature" with the web2py SQLFORM module, after a 
> bit of research i came with this approach, im not sure if its correct so i 
> accept suggestion:
>
> i've to override all the FormWidget class inside sqlhtml.py and modify all 
> widget to generate a HTML output adapted to my custom tags, also create a 
> custom formstyle related to polymer and maybe (and this is one of the 
> problems i've found) create some sort of custom HTML helper for generating 
> the HTML custom tags.
>
> I think i miss a lot of changes needed for this to work well, so i am 
> looking for opinions in this matter, i'm correct in my planning, or maybe 
> there is a easier path to join SQLFORM and Polymer, or may be better to 
> work without SQLFORM?
>
> Thank for any help you can provide
>

-- 
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: component form without submit button

2015-09-21 Thread Niphlod
uhm... if the component has been loaded with web2py's facilities, then a 
form.submit should be "intercepted"/"handled" by 

https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L266



On Monday, September 21, 2015 at 2:31:20 PM UTC+2, Manuele wrote:
>
> Hi *, 
> I would like to realize a little one-text-field form and submit the 
> typed value each time the content of the field is changed and its 
> content is greater than 3 characters. The form is called inside a web2py 
> component so run something like this.form.submit() as onchange callback 
> is not the right solution because the whole page is submitted and not 
> only the desidered content. 
>
> can somebody help me please? 
>
> Thank you very mutch 
> Cheers 
>
> Manuele 
>

-- 
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: component form without submit button

2015-09-21 Thread Manuele Pesenti
Il 21/09/15 14:36, Niphlod ha scritto:
> uhm... if the component has been loaded with web2py's facilities, then
> a form.submit should be "intercepted"/"handled" by 
>
> https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L266
You can try inserting this little code in a controller of a brand new
application:

def _index():
form = FORM(
DIV(
INPUT(_type="text", _class="form-control", _name="tip",
  _onchange="this.form.submit();",
_oninput="this.onchange();" # COMMENT OUT THIS LINE
),
SPAN(
 TAG.button(
 "Run",
 _type="submit",
 _class="btn btn-default"),
 _class="input-group-btn"),
_class="input-gourp"),
_class = "form-inline",
)
if form.accepts(request,session):
session.flash = "Success!"
return dict(form=form, vars=BEAUTIFY(form.vars))

if the event callback definition is not commented out the whole page is
submitted and not only the component.

I'm using web2py in the version:
2.12.3-stable+timestamp.2015.08.18.19.14.07

thanks a lot
Best regards

Manuele
>
>
>
> On Monday, September 21, 2015 at 2:31:20 PM UTC+2, Manuele wrote:
>
> Hi *,
> I would like to realize a little one-text-field form and submit the
> typed value each time the content of the field is changed and its
> content is greater than 3 characters. The form is called inside a
> web2py
> component so run something like this.form.submit() as onchange
> callback
> is not the right solution because the whole page is submitted and not
> only the desidered content.
>
> can somebody help me please?
>
> Thank you very mutch
> Cheers
>
> Manuele
>
> -- 
> 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] Off topic - A good talk

2015-09-21 Thread António Ramos
https://www.youtube.com/watch?v=__dDAD0Y_WU

some good messages under the hood

-- 
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: auth.wiki search generates error 'exceptions.AttributeError'

2015-09-21 Thread Daniel Vogel
Hi,

This issue is new, I used the auth.wiki with older web2py versions, no 
problems. I updated my auth.wiki to web2py 2.12.3. Now the same problem 
(xceptions.AttributeError) with search. I think it's a bug.
I run web2py locally.


Am Montag, 14. September 2015 12:16:47 UTC+2 schrieb A3:
>
> Hi,  I'm learning to use the auth.wiki and ran into the following problem:
>
> I tried the minimal example in the code:
> def index()
> return auth.wiki()
> I add a user 
>
> Created a wikipage with a tag: mytag
>
> When I click the tag mytag or use the wiki menu search page it show me:
> 
>
> Please note I'am using pythonanywhere as host.
>
> Any clues?
>
>

-- 
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: component form without submit button

2015-09-21 Thread Manuele Pesenti
Il 21/09/15 15:03, Manuele Pesenti ha scritto:
> def _index():
> form = FORM(
> DIV(
> INPUT(_type="text", _class="form-control", _name="tip",
>   _onchange="this.form.submit();",
> _oninput="this.onchange();" # COMMENT OUT THIS LINE
> ),
> SPAN(
>  TAG.button(
>  "Run",
>  _type="submit",
>  _class="btn btn-default"),
>  _class="input-group-btn"),
> _class="input-gourp"),
> _class = "form-inline",
> )
> if form.accepts(request,session):
> session.flash = "Success!"
> return dict(form=form, vars=BEAUTIFY(form.vars))
def index():
form = LOAD(request.controller, "_index.load", ajax=True)
return dict(form=form)

ups... I'd forgotten the code of the main controller function.

M.

-- 
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: component form without submit button

2015-09-21 Thread Anthony
Have your put that inside a web2py Ajax component? Can you show the full 
code of the parent controller and view?

Anyway, as an alternative, you might want to take the approach shown here: 
http://web2py.com/books/default/chapter/29/11/jquery-and-ajax#Auto-completion

Anthony

On Monday, September 21, 2015 at 9:03:12 AM UTC-4, Manuele wrote:
>
> Il 21/09/15 14:36, Niphlod ha scritto:
>
> uhm... if the component has been loaded with web2py's facilities, then a 
> form.submit should be "intercepted"/"handled" by  
>
>
> https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L266
>
> You can try inserting this little code in a controller of a brand new 
> application:
>
> def _index():
> form = FORM(
> DIV(
> INPUT(_type="text", _class="form-control", _name="tip",
>   _onchange="this.form.submit();", 
> _oninput="this.onchange();" # COMMENT OUT THIS LINE
> ),
> SPAN(
>  TAG.button(
>  "Run",
>  _type="submit",
>  _class="btn btn-default"),
>  _class="input-group-btn"),
> _class="input-gourp"),
> _class = "form-inline",
> )
> if form.accepts(request,session):
> session.flash = "Success!"
> return dict(form=form, vars=BEAUTIFY(form.vars))
>
> if the event callback definition is not commented out the whole page is 
> submitted and not only the component.
>
> I'm using web2py in the version:
> 2.12.3-stable+timestamp.2015.08.18.19.14.07
>
> thanks a lot
> Best regards
>
> Manuele
>
>
>
>
> On Monday, September 21, 2015 at 2:31:20 PM UTC+2, Manuele wrote: 
>>
>> Hi *, 
>> I would like to realize a little one-text-field form and submit the 
>> typed value each time the content of the field is changed and its 
>> content is greater than 3 characters. The form is called inside a web2py 
>> component so run something like this.form.submit() as onchange callback 
>> is not the right solution because the whole page is submitted and not 
>> only the desidered content. 
>>
>> can somebody help me please? 
>>
>> Thank you very mutch 
>> Cheers 
>>
>> Manuele 
>>
> -- 
> 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: Reverse Proxy problem with grid form (bootstrap 3.x)

2015-09-21 Thread Daniel Vogel
I use auth.wiki. If reverse proxy is acting as path through, wrong links in 
the HTML stream. A solution, using ProxyHTMLURLMap to fix the links.
If I don't use auth.wik, reverse proxy is set as path through, every thing 
works fine. Where could be the solution for this issue?


Am Montag, 21. September 2015 14:28:09 UTC+2 schrieb Niphlod:
>
> web2py can't be blamed if your reverse proxy is not acting as a 
> passthrough 
>
> On Monday, September 21, 2015 at 8:13:38 AM UTC+2, Daniel Vogel wrote:
>>
>> Hi,
>>
>> Some additional information. With older web2py versions (bootstrap 2.x) 
>> we have wrong sizing with the login behind reverse proxy (field has not the 
>> normal size).
>> With the new web2py version the problem is gone, but a new one appeared 
>> (see my first screen shot). I think it's a bug.
>>
>>
>>
>> 
>> (Login field behind reverse proxy, bootstrap 2.x)
>>
>> Thanks
>>
>>
>> Am Mittwoch, 9. September 2015 04:48:42 UTC+2 schrieb Daniel Vogel:
>>>
>>> Hi,
>>>
>>> I use web2py 2.12.3 with auth.wiki. In development mode, no problem with 
>>> HTML rendering. But behind a Apache reverse proxy in need some rules to 
>>> change HTML URL's.
>>>
>>> ProxyHTMLEnable On
>>> ProxyHTMLLinks imgsrc
>>> ProxyHTMLLinks ahref
>>>
>>> 
>>> Require all granted
>>> ProxyPass http://localhost:8000/eav
>>> ProxyPassReverse http://localhost:8000/
>>> ProxyHTMLURLMap http://localhost:8000/eav /eav
>>> 
>>>
>>> With this settings the grid form is deformed, the first search field is 
>>> as high as the display. If I remove the "ProxyHTMLURLMap", it's ok, but all 
>>> the img URL's has localhost:8000 in auth.wiki.
>>>
>>>
>>>
>>> 
>>>
>>>
>>>
>>> How can I fix this problem?
>>>
>>>
>>> Thanks
>>>
>>> 
>>>
>>

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


Re: [web2py] Eclipse + Pydev + Docker - need suggestions

2015-09-21 Thread Richard Vézina
Hi Kiran,

Just about having web2py app outside of web2py folder and docker... I think
what you want to achieve goes against the idea of containerization... Why
not deploy you app inside your container (as you will do if you host your
app somewhere for instance, in this case your host is your container)
instead of trying to make your container work with something from the
outside...

Richard

On Mon, Sep 21, 2015 at 1:17 AM, Kiran Subbaraman <
subbaraman.ki...@gmail.com> wrote:

> Hello,
> I need some help with understanding the best way to use Pydev with
> Eclipse, for web2py applications development.
> I have been working with web2py for the past year, and use the tools
> mentioned above for this purpose. Am trying to refine my understanding of
> this toolset, and if there is something more that can be done to improve
> the experience.
>
> I use Eclipse IDE (Luna Service Release 2 - 4.4.2), with Pydev
> (4.3.0.201508182223), on Windows (10.0.10240), as my web2py development
> environment.
>
> *Sorting out web2py imports*
> I was looking at the documentation:
> http://web2py.com/books/default/chapter/29/14/other-recipes#Using-general-purpose-IDEs-with-web2py.
> Went ahead and added the code to resolve imports:
>
> if False:
> from gluon import *
> request = current.request
> response = current.response
> session = current.session
> cache = current.cache
> T = current.T
>
>
> ...It is probably wise to remove the import of the gluon debug module.
>> Also, to do this you should make the pydev project the web2py directory,
>> not your specific application.
>>
>> PyDev's git integration copes with this; it supports multiple git
>> repositories inside the one project directory structure.
>>
>
> I didn't quite understand what this means? It seems to suggest a means to
> debug applications from within Eclipse; can anyone elaborate on how to get
> this done. I can test it out, and contribute to improving the
> documentation.
>
>
> *Applications outside of web2py*
> I also noticed this response from Massimo:
>
> Actually the web2py applications/ folder is not required to be under the
>> the web2py folder..
>
>
> https://groups.google.com/d/msg/web2py/wi25qItKDEo/w-RbzvykRfcJ
> So, I need to create a *web2py/options.py*, which has the property
> folders = /web2py_applications #docker volume, for example
>
> This will help me create web2py docker-containers, which point to my
> applications code outside of the containers. The applications themselves
> are in a git repository. Is this a setup that anyone has tried out before.
> I noticed this thread by Massimo, but that was inconclusive:
> https://groups.google.com/forum/#!searchin/web2py/docker/web2py/XhrfaYX00dg/6koPFbJWfNYJ
> Any suggestions?
>
> Thanks,
> Kiran
>
> --
> 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] Eclipse + Pydev + Docker - need suggestions

2015-09-21 Thread Kiran Subbaraman

Richard,
Good point, but then I want to capture the state of my application 
outside of the infrastructure I need to run it in.
This will mean that if the web2py server container goes down, for 
whatever reason, I can spin up another container, and it will continue 
from where the previous one left off (or that is something am aiming for).
My application, and its data is managed as a simple volume (with 
necessary replication).
I do not know how this will behave if two web2py containers try to use 
this volume. Again, there are quite a few things I have not explored, 
but intend to.
Was looking for experiences with Docker based web2py deploys, and best 
practices that the community has evolved.



Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On Mon, 21-09-2015 8:06 PM, Richard Vézina wrote:

Hi Kiran,

Just about having web2py app outside of web2py folder and docker... I 
think what you want to achieve goes against the idea of 
containerization... Why not deploy you app inside your container (as 
you will do if you host your app somewhere for instance, in this case 
your host is your container) instead of trying to make your container 
work with something from the outside...


Richard

On Mon, Sep 21, 2015 at 1:17 AM, Kiran Subbaraman 
mailto:subbaraman.ki...@gmail.com>> wrote:


Hello,
I need some help with understanding the best way to use Pydev with
Eclipse, for web2py applications development.
I have been working with web2py for the past year, and use the
tools mentioned above for this purpose. Am trying to refine my
understanding of this toolset, and if there is something more that
can be done to improve the experience.

I use Eclipse IDE (Luna Service Release 2 - 4.4.2), with Pydev
(4.3.0.201508182223), on Windows (10.0.10240), as my web2py
development environment.

*Sorting out web2py imports*
I was looking at the documentation:

http://web2py.com/books/default/chapter/29/14/other-recipes#Using-general-purpose-IDEs-with-web2py.
Went ahead and added the code to resolve imports:
|

|ifFalse:fromgluon import*request =current.request response
=current.response session =current.session cache
=current.cache T =current.T|

|

...It is probably wise to remove the import of the gluon debug
module. Also, to do this you should make the pydev project the
web2py directory, not your specific application.

PyDev's git integration copes with this; it supports multiple
git repositories inside the one project directory structure.


I didn't quite understand what this means? It seems to suggest a
means to debug applications from within Eclipse; can anyone
elaborate on how to get this done. I can test it out, and
contribute to improving the documentation.


*Applications outside of web2py*
I also noticed this response from Massimo:

Actually the web2py applications/ folder is not required to be
under the the web2py folder..


https://groups.google.com/d/msg/web2py/wi25qItKDEo/w-RbzvykRfcJ
So, I need to create a /web2py/options.py/, which has the property
|
folders =/web2py_applications #docker volume, for example
|

This will help me create web2py docker-containers, which point to
my applications code outside of the containers. The applications
themselves are in a git repository. Is this a setup that anyone
has tried out before. I noticed this thread by Massimo, but that
was inconclusive:

https://groups.google.com/forum/#!searchin/web2py/docker/web2py/XhrfaYX00dg/6koPFbJWfNYJ


Any suggestions?

Thanks,
Kiran

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


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentatio

Re: [web2py] Re: component form without submit button

2015-09-21 Thread Niphlod
btw: inline javascript trumps any event attached NEVER inline 
javascript snippets!

On Monday, September 21, 2015 at 4:15:48 PM UTC+2, Anthony wrote:
>
> Have your put that inside a web2py Ajax component? Can you show the full 
> code of the parent controller and view?
>
> Anyway, as an alternative, you might want to take the approach shown here: 
> http://web2py.com/books/default/chapter/29/11/jquery-and-ajax#Auto-completion
>
> Anthony
>
> On Monday, September 21, 2015 at 9:03:12 AM UTC-4, Manuele wrote:
>>
>> Il 21/09/15 14:36, Niphlod ha scritto:
>>
>> uhm... if the component has been loaded with web2py's facilities, then a 
>> form.submit should be "intercepted"/"handled" by  
>>
>>
>> https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L266
>>
>> You can try inserting this little code in a controller of a brand new 
>> application:
>>
>> def _index():
>> form = FORM(
>> DIV(
>> INPUT(_type="text", _class="form-control", _name="tip",
>>   _onchange="this.form.submit();", 
>> _oninput="this.onchange();" # COMMENT OUT THIS LINE
>> ),
>> SPAN(
>>  TAG.button(
>>  "Run",
>>  _type="submit",
>>  _class="btn btn-default"),
>>  _class="input-group-btn"),
>> _class="input-gourp"),
>> _class = "form-inline",
>> )
>> if form.accepts(request,session):
>> session.flash = "Success!"
>> return dict(form=form, vars=BEAUTIFY(form.vars))
>>
>> if the event callback definition is not commented out the whole page is 
>> submitted and not only the component.
>>
>> I'm using web2py in the version:
>> 2.12.3-stable+timestamp.2015.08.18.19.14.07
>>
>> thanks a lot
>> Best regards
>>
>> Manuele
>>
>>
>>
>>
>> On Monday, September 21, 2015 at 2:31:20 PM UTC+2, Manuele wrote: 
>>>
>>> Hi *, 
>>> I would like to realize a little one-text-field form and submit the 
>>> typed value each time the content of the field is changed and its 
>>> content is greater than 3 characters. The form is called inside a web2py 
>>> component so run something like this.form.submit() as onchange callback 
>>> is not the right solution because the whole page is submitted and not 
>>> only the desidered content. 
>>>
>>> can somebody help me please? 
>>>
>>> Thank you very mutch 
>>> Cheers 
>>>
>>> Manuele 
>>>
>> -- 
>> 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 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: component form without submit button

2015-09-21 Thread Anthony

>
> INPUT(_type="text", _class="form-control", _name="tip",
>   _onchange="this.form.submit();", 
> _oninput="this.onchange();"),
>

The problem is that above, this.form is the native DOM form element (not a 
jQuery object), so the this.form.submit() is calling the form's native 
"submit" method, not the jQuery "submit" method. The browser's native 
"submit" method bypasses the jQuery "submit" handlers, so the "submit" 
handler set in trap_form in web2py.js never gets called. Instead, try 
changing this.form.submit() to jQuery(this.form).submit(). That will wrap 
the form in a jQuery object and call the jQuery "submit" method, which will 
trigger the trap_form handler, which will submit the form via Ajax.

Anthony

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


[web2py] Re: Off topic - A good talk

2015-09-21 Thread Leonel Câmara
It's quite an interesting talk although I think that if you write idiomatic 
python you don't bump into most of these problems as most these things were 
solved with generators and comprehensions quite beautifully years ago. 
Maria was also either very nervous to be in public or needs to go study 
some more.

-- 
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: component form without submit button

2015-09-21 Thread Manuele Pesenti
Il 21/09/15 17:16, Anthony ha scritto:
> Instead, try changing this.form.submit() to
> jQuery(this.form).submit(). That will wrap the form in a jQuery object
> and call the jQuery "submit" method, which will trigger the trap_form
> handler, which will submit the form via Ajax.
Great!! It's works as expected :)
thank you Anthony.

Cheers

M.

-- 
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: mail send

2015-09-21 Thread 'Diogene Laerce' via web2py-users
Hi,

Le 20/09/2015 17:30, Massimo Di Pierro a écrit :
> I am not sure I filly understand. There is not mail.settings.to. "to"
> is a mandatory argument of mail.send().

Thanks for stopping by.

Actually it was more rhetorical than a question : I first did try to
use this, and the application did return that mail.settings does
not have any "to" argument. So no problem with that proposition.

I just had a "Target receiver address not specified" that I couldn't
manage because of the introduction of an "email_address" field
instead of the "email" default one.

I just went on the wrong approach for this problem : I tried to
change the database fields  instead of just modify the sqlform, as
it was just an email validating field.
 
It's what I'm going to do now, I will be back if more issues on the
way.

Thank you, kind regards,

-- 
“One original thought is worth a thousand mindless quotings.†
“Le vrai n'est pas plus sûr que le probable.†

  Diogene Laerce


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


signature.asc
Description: OpenPGP digital signature


Re: [web2py] Re: Is it possible to have this type of multiple requires in db.py?

2015-09-21 Thread Richard Vézina
About this

IS_IN_DB(db(db.Organization.organizationPrimaryTypeID == 1),
 'Organization.id'), '%(represent_field_name)s')

I avoid using ID generally even if it does one more query I think code get
more readable in the future if you nest another query (2 ways of doing it) :

organization_id = db(db.foreign_table_name.filter_field_name ==
'something).select(db.foreign_table_name.filter_field_name).first().id
IS_IN_DB(db(db.Organization.organizationPrimaryTypeID == organization_id),
 'Organization.id'), '%(represent_field_name)s')

# OR

IS_IN_DB(db(db.Organization.organizationPrimaryTypeID ==
 db(db.foreign_table_name.filter_field_name ==
'something

).select(db.foreign_table_name.filter_field_name).first().id),
 'Organization.id'), '%(represent_field_name)s')


Richard

On Thu, Sep 17, 2015 at 4:34 PM, Alex Glaros  wrote:

> Thanks Leonel and Anthony,
>
> works great.
>
> is used in many places and has greatly improved my app.
>
> much appreciated,
>
> Alex
>
> --
> 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: Is it possible to have this type of multiple requires in db.py?

2015-09-21 Thread Alex Glaros
thanks Richard,

is one of the reasons to retain referential integrity in case app is ported 
to another database? (pointed-to primary ID numbers will change)

thanks,

Alex

-- 
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] Grails for web2py - anyone interested ?

2015-09-21 Thread Graham Ranson
I don't know whether any of you are familiar with Grails (www.grails.org);  
I was using it for a few years but for a variety of reasons have moved to 
Python. However there are features of Grails that I did find particular 
useful and I felt that there may be some benefit, to me at least, in 
reproducing some of the features of Grails.

To summarise: I've written a little Python script that you can use to 
create a skeleton model file with the model as a class in its own file; you 
then complete the model by adding Field(...) definitions to the define_table
() entry and optionally add a few other attributes etc. The generator 
script can then write the controller and the set of views for that model. 
And then repeat for your various models. You will then have a working 
application immediately without writing any code but, of course, in reality 
most will want to tailor the views and controllers to their own 
requirements but the generated Python scripts provide a sound base from 
which anyone can work.

It can cope with one to one and one to many relationships, dealing with the 
data presentation by the use of modal pop-ups and with appropriate code in 
the controllers. 

Currently it works although I am in the process of putting the final 
touches and, needless to say, there are a good many little things that are 
still required. And there are some, but not many, conventions that must be 
used in order that the generator can make sense of the model.

I'm posting this to discover whether there is anyone else who may be 
interested in this type of application development and who may be 
interested in the generator script. I am minded to make the whole thing 
open source as it's hardly any of my ideas and others may want to make use 
of it to take a slightly different direction or whatever... 

If you are interested then either reply here or email me.

I would point out that the generated code does not make use of some web2py 
features: it does not use self-submission nor does it make use of features 
like SQLFORM, I did not feel that in my particular applications these 
offered me any great benefits and may have complicated some matters. If 
anything it tries to keep the whole thing simple with very visible code and 
HTML and I suppose could very readily be applied to other environments. The 
starting point was actually Bruno Rocha's http://www.web2pyslices.com/slice/
show/1478/using-modules-in-web2py where he describes using model classes 
in /modules.

And I do understand that this whole approach may be seen as not in the 
spirit of web2py so I'll apologise in advance if I am causing any distress.

graham

-- 
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: Is it possible to have this type of multiple requires in db.py?

2015-09-21 Thread Richard Vézina
Or just no out-of-the-box what the ID represent when you read your code...

Richard



On Mon, Sep 21, 2015 at 3:17 PM, Alex Glaros  wrote:

> thanks Richard,
>
> is one of the reasons to retain referential integrity in case app is
> ported to another database? (pointed-to primary ID numbers will change)
>
> thanks,
>
> Alex
>
> --
> 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] SQLFORM.grid links bug

2015-09-21 Thread zenzeromod
Hi All,

I was customizing a SQLFORM.grid startig from the code:

model:
db.define_table('aziende', 
 
Field('ragione_sociale', requires=[IS_NOT_EMPTY(
error_message=err_mess),
   IS_NOT_IN_DB(db, 
'aziende.ragione_sociale')],
  ),   
 
Field('iva_cf', requires=IS_NOT_EMPTY(error_message=err_mess
)), 
Field('indirizzo', 'string', label=('indirizzo'), requires=
IS_NOT_EMPTY(error_message=err_mess)),
Field('citta', 'string', label=T('Città'), requires=
IS_NOT_EMPTY(error_message=err_mess)),
Field('cap', 'string', label=T('C. A. P.'), requires=
IS_NOT_EMPTY(error_message=err_mess)),
Field('iscrizione', label=T('N° Albo Fornitori')), 
 
Field('descrizione', 'text', requires=IS_NOT_EMPTY(
error_message=err_mess)),
Field('logo', 'upload', label=T('Logo Aziendale'), 
autodelete=True,
  requires=[IS_NOT_EMPTY(error_message=T(err_mess)),   
 
IS_IMAGE(extensions=('jpeg', 'png'))   
 
]   

  ),   
 
Field('brochure', 'upload', label=T('brochure Aziendale'), 
autodelete=True,
  requires=[IS_NOT_EMPTY(error_message=T(err_mess)),   
 
IS_UPLOAD_FILENAME(extension='pdf') 

]   

  ),   
 
auth.signature, 

)   



controller:

def aziende(): 
 
serv = [dict(header=STRONG(XML(' ' * 2), XML('Galleria Foto')),   
 
 body=lambda row: (A(SPAN(_class='icon magnifier 
icon-zoom-in glyphicon glyphicon-arrow-zoom-in'),
 SPAN(XML('Aggiungi/rimuovi'), 
_class='buttontext 
button', _title='Gestisci'),
 _class='button btn btn-default', _href=
URL('gestione', 'aziende_gall', args=[row.id])),
   ))] 
 
form = SQLFORM.smartgrid(db.aziende,   
 
 create=True,   

 editable=True, 

 deletable=True,   
 
 details=True, 
 
 csv=False, 

 paginate=30,   

 showbuttontext=False, 
 
 maxtextlength=43, 
 
 links=serv,   
 
 orderby=db.aziende.ragione_sociale,   
 
 sortable=True, 

 searchable=True,   

 user_signature=False, 
 
 ) 
 
if 'edit' in request.args: 
 
response.view = 'gestione/aziende_edit.html'   
 
if 'new' in request.args:   

response.view = 'gestione/aziende_new.html' 

return dict(form=form)

view:


{{extend 'layout_gestione.html'}}   

   

Gestione Aziende   

   

  
{{=form}} 


into the "view" and into the "edit" view of the grid header  you can see 
the "the links" buttons bad rendered as shown from the image attached.

Into the file: web2py/gluon/sqlhtml.py, class SQLFORM(FORM), method 
buttons()
I changed the line (about 2234)

buttons.append(link['body'](record)) with
buttons.append(link['body'](record)[0]) and this resove my bug.

[web2py] Re: SQLFORM.grid links bug

2015-09-21 Thread Niphlod
IMHO you copy/pasted one time too much.

when you feel there's a bug, start with a smaller example and reiterate...

the links argument accepts 

"""
 a list of dict(header='name',body=lambda row: A(...))
""" 

Your code holds a couple of parenthesis more than needed, so the argument 
to the lambda is not a single element but a tuple

i.e. instead of doing 
dict(header='name',body=lambda row: A(...))
you're doing
dict(header='name',body=lambda row: *(*A(...)*)*)
notice the *()* parenthesis

That's why link['body'](record)[0] resolves the bug in your code.


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


[web2py] Re: Grails for web2py - anyone interested ?

2015-09-21 Thread Anthony


> To summarise: I've written a little Python script that you can use to 
> create a skeleton model file with the model as a class in its own file; 
> you 
> then complete the model by adding Field(...) definitions to the 
> define_table 
> () entry and optionally add a few other attributes etc. The generator 
> script can then write the controller and the set of views for that model. 
> And then repeat for your various models.


Sounds a lot like the application wizard available in the admin app: 
http://web2py.com/books/default/chapter/29/03/overview#Application-Wizard--experimental-

Anthony

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


[web2py] Re: how to add style in header of current page?

2015-09-21 Thread Edward Shave
Many thanks for answers. 

I ended up inserting styles into the block header but in the long run I 
think appending response.files may be the way to go.

I note in retrospect all this stuff is in the book but it took this thread 
to help me make use of it.

one explicit example is worth a thousand words ;o)

-- 
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: auth.wiki search generates error 'exceptions.AttributeError'

2015-09-21 Thread Leonel Câmara
> I think it's a bug.

It is. There's a typo in tools.py in line 6935 where you have this:
  db.wiki_page.can_read, db.wiki+page.can_edit]

When you should have
  db.wiki_page.can_read, db.wiki_page.can_edit]

I will submit a pull request to fix it but in the mean time you can fix it 
for yourself by doing this change in gluon/tools.py

-- 
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: auth.wiki search generates error 'exceptions.AttributeError'

2015-09-21 Thread Leonel Câmara
It was already fixed in trunk by Niphlod! In the next release it should be 
fixed. In the meantime you can fix it yourself like I described.

-- 
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: SQLform grid custom function for delete

2015-09-21 Thread Vid Ogris
Ok thanx. This worked.

One more question. My SQLFORM.grid is not refreshed after callback. So
record stays there. HOw to do a grid refresh?

2015-09-19 20:32 GMT+08:00 Anthony :

> On Saturday, September 19, 2015 at 4:18:49 AM UTC-4, Yebach wrote:
>>
>> Hello
>>
>> So I managed to put link and create it but now I have a probelm getting
>> the id of the record I want to deal with
>>
>> links = [lambda row: A('',_class='glyphicon glyphicon
>> glyphicon-remove-sign',
>> callback=URL('settings','deactivate',vars=dict(table='skills',field =
>> 'sk_status', value = form.vars.id )))]
>>
>
> If you want the id of the record in a given row of the table, then instead
> of value=form.vars.id, it should be value=row.id.
>
>
>> @auth.requires_login() def deactivate(): ##Aktiviramo delavca ko user
>> klikne na activate user = auth.user_id org = db(db.auth_user.id ==
>> user).select(db.auth_user.organization)[0]["organization"] #Worker je id
>> zaposlenenga ki ga damo v aktiven id = request.vars["id"]
>>
>
> In the URLs generated in the grid, you used the variable name "value", yet
> here you are looking for the variable name "id". The above line should be:
>
> id = request.vars.value
>
> Or you can change the URLs to use "id" as the variable name.
>
> Anthony
>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/3T1Qaf39wJg/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.
>



-- 
Lep pozdrav

Vid Ogris

-- 
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: Calling all Boulder, CO web2py users

2015-09-21 Thread weheh
Bumping. Can't believe there's only one other web2py-er in Boulder. How can 
that be? C'mon all you Boulderites, stand up and be counted. Not looking 
for a commitment to attend the meetup. Just a Boulder headcount. Thanks.

p.s.

Anyway, as you can see, Massimo is in. 

-- 
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: One form in multiple tabs

2015-09-21 Thread weheh
+1
Niphlod is top contributor. Never sarcastic. Always helpful. Insights are 
deep. Good guy to listen to. 'Nuf said.

On Thursday, April 18, 2013 at 5:30:27 PM UTC-6, Massimo Di Pierro wrote:
>
> I am pretty sure Niphlod did not mean it in a sarcastic sense. We are from 
> the same country and I did not read the negative connotation in his comment.
>
> Niphlod is a main contributor to web2py and he spends lots of time helping 
> people here.
>
> Massimo
>
> On Thursday, 18 April 2013 15:08:38 UTC-5, Pystar wrote:
>>
>> @Niphlod,
>> People come here to get answers to their questions from experts like you 
>> and not to be knocked down on. Your sarcasm of late is kind of offputting. 
>> Kindly tone it down for the sake of this community. 
>> Thanks
>>
>> On Wednesday, April 3, 2013 2:31:20 PM UTC+1, Niphlod wrote:
>>>
>>> the main issue here is : are you missing HTML/js skills to code a 
>>> "tabbed" form or is something on web2py's side that is not working as you 
>>> expect ?
>>>
>>> On Wednesday, April 3, 2013 1:11:21 PM UTC+2, Annet wrote:

 I defined the following table:

 db.define_table('scrptNxt',
 Field('nodeID','reference node',requires=IS_EMPTY_OR(IS_IN_DB(db,'
 node.id','%(id)s',zero='Select a 
 value')),ondelete='CASCADE',writable=False,readable=False),
 Field('viewID','reference view',requires=IS_EMPTY_OR(IS_IN_DB(db,'
 view.id','%(name)s')),ondelete='RESTRICT',label='View * 
 ',represent=lambda viewID, row: 
 db(db.view.id==viewID).select().first().name 
 if viewID else ''),
 Field('moduleID','list:reference 
 module',ondelete='RESTRICT',writable=False,readable=False,label='Module * 
 '), # requires= defined in function
 Field('BIC',length=16,requires=IS_LENGTH(16,error_message='lengte 
 overschreidt 16 tekens'),label='BIC * '),
 Field('IBAN',length=64,requires=IS_LENGTH(64,error_message='lengte 
 overschreidt 64 tekens'),label='IBAN * '),
 
 Field('holder',length=128,requires=IS_LENGTH(128,error_message='lengte 
 overschreidt 128 tekens'),label='Tenaamstelling * '),
 
 Field('agreedTaC',type='boolean',default=False,requires=IS_NOT_EMPTY(),notnull=True,label=None),
 Field('agreedDirectDebit',type='boolean',default=False,label=None),
 migrate=False)


 In a controller I defined the following function:

 def scrptNxt():
 
 form=SQLFORM(table=db.scrptNxt,deletable=False,showid=False,separator='',formstyle=mybootstrap)
 form.process()
 if form.errors:
 response.flash=response_flash('formerror',session)
 elif not response.flash:
 response.flash=response_flash('form',session)
 return dict(form=form)

 In the corresponding view, I want the form to be displayed in tabs, 
 something like:

 
   View
   Modules
   Bank account
   Agree
   Confirm
 

 
   {{=form.custom.begin}}
   
 {{=form.custom.widget.viewID}}
 # a next button here

   
 {{=form.custom.widget.moduleID}}
 # a previous and next button here

   
 {{=form.custom.widget.BIC}}
 {{=form.custom.widget.IBAN}}
 {{=form.custom.widget.holder}}
 # a previous and next button here

   
 {{=form.custom.widget.agreedTaC}}
 {{=form.custom.widget.agreedDirectDebit}}
 {{=form.custom.widget.submit}}
 {{=form.custom.end}} 

   
 # confimation message here

  

 I have no idea how to code this correctly, I look forward
 to your suggestions.

 Annet.

>>>

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


[web2py] How to urlify a computed field?

2015-09-21 Thread St. Pirsch
Hi,
I'am trying to generate a slug url from a computed field:
Field('url_name', compute=lambda r: r['first_name']+'-'+r['last_name']),

Something like:
Field('url_name', compute=lambda r: r['first_name']+'-'+r['last_name'], 
requires=IS_SLUG()),
doesn't seem to work, nor I get to treat the r-Objects like strings.
Thanks for a hint
-Stephan

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