[web2py] Decimal fields error as float

2015-09-09 Thread Dmitri Ermolaev
in db: Field('bal', 'decimal(16,8)', default = Decimal(0)), Field('fee', 'decimal(5,3)', default = Decimal(0)), in appadmin I set values in controller: t.fee =0.3 t.bal - t.fee -> error! float and decimal operation -- Resources: - http://web2py.com - http://web2py.com/book (Document

[web2py] Re: impossible to convert decimal

2015-09-09 Thread Dmitri Ermolaev
fff = round( float (t.decimal_val), 2) четверг, 13 февраля 2014 г., 14:49:44 UTC+3 пользователь Robin Manoli написал: > > Hey, > I have a decimal in db, for which I tried numerous ways to round to two > decimal points, and also to calculate with other numbers. Basically I want > to convert it t

[web2py] Re: Link helper with pop up?

2015-09-09 Thread JorgeH
It shouldn't be no problem. Can you share your code... ? try _target="_blank" On Wednesday, September 9, 2015 at 7:49:27 PM UTC-5, Diego Tostes wrote: > > I am using the A helper. It is possible to use this helper to create a pop > up to the link? > > Thanks > -- Resources: - http://web2p

[web2py] Re: Is this use of the scheduler correct?

2015-09-09 Thread Phillip
It appears that no workers are being started with my queuing the tasks in this manner. If they can't be started in the controller or if they were expected to be started with the above code, please let me know. Otherwise, sincere thanks for all of your posts, in general, with Web2py -- Resource

[web2py] Re: Is this use of the scheduler correct?

2015-09-09 Thread Phillip
*Please see top post (9-9-15)* -- 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] Link helper with pop up?

2015-09-09 Thread Diego Tostes
I am using the A helper. It is possible to use this helper to create a pop up to the link? 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 rec

[web2py] Re: Syntax help for (1) left join (2) defining result as query instead of a set

2015-09-09 Thread Alex Glaros
I need left-outer-join help that has added complexity beyond the simplified example I gave This query below works perfect if used by itself except doesn't have the outer join feature query = ((db.StaffPosition.jobClassification==db.JobClassification.id)& (db.StaffPositionOrganization.staffPosi

[web2py] Re: virtual fields with link

2015-09-09 Thread Anthony
href=row.url On Wednesday, September 9, 2015 at 3:53:12 PM UTC-4, Diego Tostes wrote: > > Hi, > > i have a model with: > > Article = db.define_table('article', > Field('title', 'string'), > Field('author', 'string'), > Field('type_article', 'string'), > Field('url', 'string'), >

[web2py] Re: virtual fields with link

2015-09-09 Thread Alex Glaros
hi Diego, URL might be a reserved word or give rise to confusion, so consider changing it I think you don't need the virtual link. Just add a "represent" clause. Here's a working example but it references other table. Field('superObjectURLID', 'reference SuperObjectURL', label='Meeting

[web2py] Re: How do i get the SQLFORM or Auth Token?

2015-09-09 Thread Alfonso Serra
How do i add a class to form.custom.begin? are they stripped from the form? ive tried: form = auth() form.add_class("hey") but form.custom.begin outputs Thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https:/

[web2py] Re: How do i get the SQLFORM or Auth Token?

2015-09-09 Thread Alfonso Serra
Thats so cool. Thank you very much You can acomplish things in web2py in such different ways that is easy to miss the best ones. http://web2py.com/books/default/search/29?search=form.custom -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/we

[web2py] virtual fields with link

2015-09-09 Thread Diego Tostes
Hi, i have a model with: Article = db.define_table('article', Field('title', 'string'), Field('author', 'string'), Field('type_article', 'string'), Field('url', 'string'), Field.Virtual('link_to_click', lambda row: A('click_here', _href=)), ) How can do to show the url field

[web2py] Re: How do i get the SQLFORM or Auth Token?

2015-09-09 Thread Anthony
Replace: with: {{=form.custom.end}} Anthony On Wednesday, September 9, 2015 at 1:42:23 PM UTC-4, Alfonso Serra wrote: > > I would like to design custom forms outside the bounds of creating custom > web2py formstyles, using the template language instead. > > Ive been able to decouple the fiel

Re: [web2py] .last() don't return last table id and first() also not returning the first record id

2015-09-09 Thread Richard Vézina
Ok you right... orderby=id On Wed, Sep 9, 2015 at 3:06 PM, Michele Comitini wrote: > absolutely normal, try ordering or using max > > 2015-09-09 20:54 GMT+02:00 Richard Vézina : > >> Postgres >> >> On Wed, Sep 9, 2015 at 2:23 PM, Leonel Câmara >> wrote: >> >>> You do not have an orderby on that

Re: [web2py] .last() don't return last table id and first() also not returning the first record id

2015-09-09 Thread Michele Comitini
absolutely normal, try ordering or using max 2015-09-09 20:54 GMT+02:00 Richard Vézina : > Postgres > > On Wed, Sep 9, 2015 at 2:23 PM, Leonel Câmara > wrote: > >> You do not have an orderby on that select so, depending on your backend, >> yes that can be very normal. >> >> -- >> Resources: >> -

Re: [web2py] .last() don't return last table id and first() also not returning the first record id

2015-09-09 Thread Richard Vézina
Postgres On Wed, Sep 9, 2015 at 2:23 PM, Leonel Câmara wrote: > You do not have an orderby on that select so, depending on your backend, > yes that can be very normal. > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source

[web2py] Re: auth.wiki deployment issue

2015-09-09 Thread pj00016
In addition to putting auth.wiki(resolve=False) in db.py, I have a refresh function as follows (because I couldn't get auth.wiki.get_renderer to work.) import string @auth.requires_membership('administrator') def refreshWiki(): print "\n" for row in db(db.wiki_page).select(): newh

Re: [web2py] .last() don't return last table id and first() also not returning the first record id

2015-09-09 Thread Leonel Câmara
You do not have an orderby on that select so, depending on your backend, yes that can be very normal. -- 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

[web2py] How do i get the SQLFORM or Auth Token?

2015-09-09 Thread Alfonso Serra
I would like to design custom forms outside the bounds of creating custom web2py formstyles, using the template language instead. Ive been able to decouple the fields and form attributes but i dont want to lose the security. So the answer is, how do i include the hidden div with the token? Exam

[web2py] .last() don't return last table id and first() also not returning the first record id

2015-09-09 Thread Richard
Hello, db().select(db.table.id).last().id don't return the last record available, it consistently (same id) return a wrong record id... rows[-1] also return wront (the same id) .first() also not return the first available record rows[0] also return wrong (the same id) Is that normal? Richar

[web2py] Re: Authenticate users on third-party database tables (md5 passwords)

2015-09-09 Thread Narūnas
For me the following did the trick... *db.py* def my_custom_auth(*args, **kwargs): from hashlib import md5 """ auth2 = Auth(db, controller="auth", function="user", hmac_key=Auth.get_or_create_key()) auth2.settings.create_user_groups = False auth2.settings.login_methods = [my_

[web2py] Re: How does 'default/user' works?

2015-09-09 Thread Anthony
On Wednesday, September 9, 2015 at 8:21:41 AM UTC-4, desta wrote: > > Thank you. > > I am trying to follow the procedure. So when the login form is submitted, > I guess line 1609 is called (?) > https://github.com/web2py/web2py/blob/master/gluon/tools.py#L1609. > > Following the getattr, I can't

[web2py] Re: auth.wiki deployment issue

2015-09-09 Thread pj00016
Upgrading didn't change the problem. But I found this link: http://www.web2pyslices.com/slice/show/1565/wikifying-web2py-apps I added the line: auth.wiki(resolve=False) to my db.py document and then I was able to reference the db.wiki_page object. So the issue is resolved. Thanks all for helping.

[web2py] Re: Is there a way to user response.render with a string object.

2015-09-09 Thread Anthony
Instead of response.render, you can use gluon.template.render: from gluon.template import render html = render(db.mytable(1).template, context=dict(key1=value1, key2=value2 )) Note, if the template needs access to web2py globals and objects defined in your models, you can set context=globals().

[web2py] Re: How does 'default/user' works?

2015-09-09 Thread desta
Thank you. I am trying to follow the procedure. So when the login form is submitted, I guess line 1609 is called (?) https://github.com/web2py/web2py/blob/master/gluon/tools.py#L1609. Following the getattr, I can't seem to find where it validates and redirects. Could you please enlighten me?

[web2py] Re: .gtilab-ci.yml for Continuous integration web2py projects

2015-09-09 Thread Niphlod
as for the needed script, there are bits and piecies in the master repo to cut/paste to a working solution. for the coverage part, we recently switched to codecov for the coverage (we used to rely on coveralls too) On Wednesday, September 9, 2015 at 11:27:30 AM UTC+2, Stefan van den Eertwegh w

[web2py] Re: How does 'default/user' works?

2015-09-09 Thread Leonel Câmara
auth is an instance of Auth that you have defined in your model. Auth happens to have a __call__ method so auth will be callable like a function. When called auth uses the first argument (request.args(0)) to get the correct user function (login, register, etc) from Auth using getattr and return

[web2py] How does 'default/user' works?

2015-09-09 Thread desta
Hello everyone. I want to understand how the login/register etc work. How does the 'default' controller exposes the 'user' functions? When the client requests 'default/user/login' what does the '/login' part do? In the 'default.py' file I see that the controller always returns a form 'return

[web2py] .gtilab-ci.yml for Continuous integration web2py projects

2015-09-09 Thread Stefan van den Eertwegh
Hi All, I have a GITLAB CE and GITLAB CI server running. Does anyone have an example for a python based web2py gitlab-ci.yml for continuous integration with web2py project GIT's? For the people who not know what this file is.. it is the file that configures the test suite for CI integration wit

Re: [web2py] SQLFORM - Filter referenced data based off another value.

2015-09-09 Thread Massimiliano
Try something like that, just before SQLFORM(...) db.changecontrol.project_id.requires = IS_IN_DB(db(db.Project.account_id==auth.user_id), db.Project.id,'%(name)s (%(id)d)',zero='Select ...') On Tue, Sep 8, 2015 at 8:55 PM, Vincent Zaffiro wrote: > I am trying to utilize the SQLFORM magic as mu

[web2py] Re: Syntax help for (1) left join (2) defining result as query instead of a set

2015-09-09 Thread Alex Glaros
Thanks Massimo, Ended up not needing "data_rows" Just putting statement in grid worked: grid = SQLFORM.grid(db.JobClassification,left= db.StaffPosition.on(query)) Much appreciated! Alex -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/we