[web2py] Apply where clause in external references

2016-02-17 Thread Alessio Varalta
Hi I have a class group and a class user for example. So i have a loop for row_user in row_group.user.select() now i want only the user that have status true i try for row_user in row_group.user.select(db.user.stato==True) but i have a error or row_user in row_group.user.select(stato==True) Ho

[web2py] Re: Apply where clause in external references

2016-02-17 Thread xmarx
users=db(db.user.stato==True).select() for user in users: #your code here 17 Şubat 2016 Çarşamba 10:18:40 UTC+2 tarihinde Alessio Varalta yazdı: > > Hi I have a class group and a class user for example. So i have a loop > > for row_user in row_group.user.select() > > now i want only the user

[web2py] regarding permission

2016-02-17 Thread prashant joshi
is there any way to provide permission to the admin to update and delete data from the table and provide user only to read it? db = DAL("postgres://postgres:postgres@localhost:5432/tripti1") from gluon.tools import Auth auth = Auth(db) auth.define_tables(username=False,signature=False) db.de

[web2py] Re: Need opinions/reviews about embedded jquery/javascript XHTML editor

2016-02-17 Thread PRACHI VAKHARIA
- Can you please post your codes for both TinyMCE and CKEditor? - It will allow to get a better understanding of how you applied it within web2py. - Also, do you know how to use TinyMCE using web2py Components? Thanks! *— PRACHI* On Saturday, 18 January 2014 02:25:02 UTC

[web2py] Re: Using tinymce for text areas of in component views

2016-02-17 Thread PRACHI VAKHARIA
- Can you please post your codes for making TinyMCE work with web2py Components? - It will allow to get a better understanding of how you applied it within web2py Components. Thanks! *— PRACHI* On Saturday, 6 November 2010 01:29:25 UTC-4, Luther Goh Lu Feng wrote: > > I am pu

[web2py] SQLFORM.grid orderby by links

2016-02-17 Thread Omicron VT
In SQLFORM.grid is possible to order the results by a links field ? Example : links = [{'header':'ValueX2', 'body' : lambda row : row.value*2}] orderby = HERE IS WHERE MY QUESTION GOES grid = SQLFORM.grid(db.mydb , links=links,orderby=orderby) -- Resources: - http://web2py.com - http://web2py.c

Re: [web2py] Re: charts on web2py

2016-02-17 Thread Carlos Cesar Caballero Díaz
Highcharts is very good. I am using right now c3.js (http://c3js.org/) a good MIT licence option. Greetings. El 16/02/16 a las 12:54, Junior Phanter escribió: Use highcharts http://www.highcharts.com Example: *ON CONTROLLER* def chart(): dados_chart="[{name: 'Batata', y: 12},{name: 'To

Re: [web2py] Re: Using tinymce for text areas of in component views

2016-02-17 Thread Javier Pepe
Hello This work for me: Controller: def textarea(): form=FORM('Texto:', TEXTAREA(_name='texto', requires=IS_NOT_EMPTY(),_id='mytextarea'), INPUT(_type='submit')) return locals() View: tinymce.init({ selector: '#mytextarea' }); {{extend 'layout.

Re: [web2py] Re: Progress bars and session

2016-02-17 Thread Carlos Correia
On 17-02-2016 00:17, Alfonso Serra wrote: > Thanks Anthony, it does work. > > The hack is easy to implement, but to represent the insertion of 30k records > into the database, writing the session file and connecting 30k times might not > be optimal. > Perhaps you should update a field in some db

[web2py] personalizar busca

2016-02-17 Thread Charles tenorio
pessoal tenho uma tbl onde tem um campo date e outros campos, eu utilizo ela em um SQLFORM.grid. Gostaria de saber como faço pra que o filtro seja somente por esse campo data, e que na caixa de texto ficasse aparecendo somente um calendário. pra que quando eu fizer a busca ser somente pela data

[web2py] Re: star or favorite an event or list

2016-02-17 Thread rajjmatthur
I understand what you are saying. Just modify that star j-script to one and work out the algorithm to save the post. Yes it does. Thank you. On Tuesday, February 16, 2016 at 10:28:06 PM UTC-5, Dave S wrote: > > On Tuesday, February 16, 2016 at 1:32:29 PM UTC-8, rajjm...@gmail.com > wrote: >> >

Re: [web2py] Re: Displalay a form in light box or pop up window in view

2016-02-17 Thread Ron Chatterjee
If you don't want to use the nested load, you can also do this: form = SQLFORM(db.mytable); dialog = modal_wrapper(form, _id='*cont_id*', header='Header', footer='footer') Works just fine. On Friday, February 12, 2016 at 4:40:09 PM UTC-5, billmac...@gmail.com wrote: > > I got to tell you...th

Re: [web2py] Re: Using tinymce for text areas of in component views

2016-02-17 Thread PRACHI VAKHARIA
I tried that and it did *NOT* work with *Web2Py Components* —» *http://web2py.com/books/default/chapter/29/12/components-and-plugins#Components--LOAD-and-Ajax* But it does work well on normal H

Re: [web2py] Re: Progress bars and session

2016-02-17 Thread Alfonso Serra
> > > Perhaps you should update a field in some db table and use it instead of > session. > Please note that the end of this, is to create an ajax progress bar that indicates the numbers of records being inserted on a request. Although that might work as well, still it isnt good to read and w

Re: [web2py] Re: Progress bars and session

2016-02-17 Thread Anthony
Yes, I would say cache.ram might be a better approach. Also, keep in mind that although you might want to check every second or two, you don't have to update the progress variable after every single record insertion. For example, for a precision of 1%, just update the progress after every 300 i

[web2py] Re: SQLFORM.grid orderby by links

2016-02-17 Thread Anthony
No, ordering is done via the database query. Anthony On Wednesday, February 17, 2016 at 8:24:09 AM UTC-5, Omicron VT wrote: > > In SQLFORM.grid is possible to order the results by a links field ? > > Example : > > links = [{'header':'ValueX2', 'body' : lambda row : row.value*2}] > orderby = HERE

[web2py] Smartgrid and onvalidation for child tables

2016-02-17 Thread Seraaj Muneer
Hello everyone, according to the Book, the smartgrid can be passed a map of parameters, eg searchable=dict(parent=True, child=False), and this will be passed to the appropriate grids that the smartgrid creates. Now I am wondering how to pass an onvalidation call back to both a parent and a chi

[web2py] multiple versions of same table in database folder

2016-02-17 Thread Alex Glaros
I see multiple versions of all of the tables in the database folder. Is this a problem? Should I manually delete oldest versions and leave most recent? thanks, Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code

[web2py] Re: My web2py app adjusts according to the browser on mobile and look odd? How to load it like Chrome?

2016-02-17 Thread RAGHIB R
for example lovecalculator.pythonanywhere.com opens very differently on mobile and looks bad On Wednesday, February 17, 2016 at 10:09:58 AM UTC+5:30, RAGHIB R wrote: > > The background-image and everything looks curbed, not suited according to > browser. How to always open a standard size like t

[web2py] Re: Smartgrid and onvalidation for child tables

2016-02-17 Thread Anthony
Hmm, doesn't appear to support all of the grid arguments: for key in 'columns,orderby,searchable,sortable,paginate,deletable,editable,details,selectable,create,fields' .split(','): Maybe make a feature request on Github to include all of the grid arguments, not just those above. Anthony On We

[web2py] Re: regarding permission

2016-02-17 Thread Val K
Hi! There is a model only in your message, what does your controller like? After "auth = Auth(db)", auth.user_id == id of logged in user (None means nobody logged in) On Wednesday, February 17, 2016 at 12:36:53 PM UTC+3, prashant joshi wrote: > > is there any way to provide permission to the

Re: [web2py] Re: Progress bars and session

2016-02-17 Thread Alfonso Serra
Ive adapted the code to use cache.ram, but the docs about this mechanism is quite confusing, and i can't get it to work. There are several questions like, how to store simple values instead callables? what happens if i access a cache value after expiration? This is the code: def getprogress()

Re: [web2py] Re: Smartgrid and onvalidation for child tables

2016-02-17 Thread Saeed
Ah OK great. I'll have to raise a github request then. On 17 Feb 2016 20:15, "Anthony" wrote: > Hmm, doesn't appear to support all of the grid arguments: > > for key in > 'columns,orderby,searchable,sortable,paginate,deletable,editable,details,selectable,create,fields' > .split(','): > > Maybe ma

[web2py] Re: SQLFORM.factory - form.process().accepted fails first time but works after that

2016-02-17 Thread Val K
It seems after first click your form is reloaded, may be there is nested forms in your html-page or something else. What does your LOAD-call like? try ajax=true or ajax_trap=true On Wednesday, February 17, 2016 at 12:17:04 AM UTC+3, Jim S wrote: > > I have a simple SQLFORM.factory form. > >

[web2py] Re: apache2/pam/pwauth to remove www-data from shadow group

2016-02-17 Thread kwebb
Digging into this more, I have learned that the pam calls in the pam.py module use the username than is trying to authenticate and pwauth requires the www-data userid. There is some other magic with apache2/mod-authnz-external that makes this work with htaccess. I tried adding a pam_set_item

[web2py] Re: SQLFORM.factory - form.process().accepted fails first time but works after that

2016-02-17 Thread Jim S
I have them both set to True. Anthony - no time yet to package up a sample... Will see if I can find time tomorrow. -Jim On Wednesday, February 17, 2016 at 3:00:39 PM UTC-6, Val K wrote: > > It seems after first click your form is reloaded, may be there is nested > forms in your html-page o

Re: [web2py] Re: Progress bars and session

2016-02-17 Thread Anthony
> return cache.ram.storage['message'][1] > Where did you see that as the way to access cached values? That is not the proper API. Note, cache.ram.storage is not initialized until cache.ram has been called at least once, so unless you have a cache.ram() somewhere prior in the same request,

[web2py] Re: SQLFORM.factory - form.process().accepted fails first time but works after that

2016-02-17 Thread Anthony
Note, ajax_trap is irrelevant if ajax=True (it just indicates forms should be trapped within non-ajax components). Anthony On Wednesday, February 17, 2016 at 4:35:43 PM UTC-5, Jim S wrote: > > I have them both set to True. > > Anthony - no time yet to package up a sample... Will see if I can

Re: [web2py] Re: Progress bars and session

2016-02-17 Thread Alfonso Serra
Omg it did work!. Thanks you very much Anthony, i owe you one. Console log: progress -1 progress -1 main: 0 progress 0 main: 1 progress 1 main: 2 progress 2 main: 3 progress 3 main: 4 progress 4 -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web

[web2py] multiple versions of same table in database folder

2016-02-17 Thread Nico de Groot
The table files contain the field information. The info is created and updated by the automatic web2py database migrations (if migration is on). Old versions can be removed. If migration is switched off, like on a production servers, you can remove the table files. See the DAL section in the Web