Re: [web2py] Re: sqlform insert row id

2021-07-01 Thread Javier Pepe
http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-and-insert-update-delete In form.vars.id store Last ID inserted El jue., 1 de julio de 2021 15:47, Dave S escribió: > > > On Wednesday, June 30, 2021 at 11:35:29 PM UTC-7 Clemens wrote: > >> the insert returns the id of

Re: [web2py] customizing SQLFORM

2020-03-18 Thread Javier Pepe
auth.signature > ) > > On Wed, Mar 18, 2020 at 4:22 PM Maurice Waka > wrote: > >> I'm getting a none value. See attached. >> >> On Wed, Mar 18, 2020 at 4:14 PM Javier Pepe wrote: >> >>> in the manual >>> >>> http

Re: [web2py] customizing SQLFORM

2020-03-18 Thread Javier Pepe
: > Thanks. > I put the code in the model.py code. It works. > > How about float button to right? > > Regards > > On Wed, Mar 18, 2020 at 4:00 PM Javier Pepe wrote: > >> Hi >> >> You can try with this >> >> db.posts.question.label = ' ' >

Re: [web2py] customizing SQLFORM

2020-03-18 Thread Javier Pepe
Hi You can try with this db.posts.question.label = ' ' label attr replace field name El mié., 18 de mar. de 2020 a la(s) 09:51, Maurice Waka ( mauricew...@gmail.com) escribió: > Hello, > > I'm trying to customize the SQLFORM to look like textarea/inputwith > text area floating left and s

Re: [web2py] Problem passing a json object to controller

2019-11-20 Thread Javier Pepe
You need use: var = json.loads ( request.post_vars.items[*"*json1*"*] ) El mié., 20 de nov. de 2019 a la(s) 14:08, Patito Feo ( patitofeo...@gmail.com) escribió: > Hi, > > Ive been trying to pass an object with keys to the controller. But i > havent been able to extract the request.vars. > >

Re: [web2py] Re: Changing color of a cell function of another cell value

2018-11-22 Thread Javier Pepe
You can try this way db.articles.conteneur.represent = lambda cntnumok, row: SPAN*(*row[ 'conteneur'], _class='cnt-false'*)* if cntnumok==False and cntnumok else None Check parenthesis El mié., 21 de nov. de 2018 a la(s) 07:42, Yann Dulondel ( yann.dulon...@gmail.com) escribió: > > > Le mercre

Re: [web2py] Connect DAL to Azure Postgres Instance

2018-09-28 Thread Javier Pepe
Try this: db = DAL("postgres://xw@dbname-postgres: p...@dbname-postgres.postgres.database.azure.com/dbname") El vie., 28 de sep. de 2018 a la(s) 02:17, gb (gregb...@gmail.com) escribió: > Trying to connect to Azure-hosted postgres on version > 2.17.1-stable+timestamp.2018.08.06.01.02.56 > > If I

Re: [web2py] Setting writable and readable=True on all fields

2018-09-27 Thread Javier Pepe
You need use the follow code: for f in my_table.fields(): db['my_table'][f].writable=True El jue., 27 de sep. de 2018 a la(s) 19:01, icodk (i...@alpiron.com) escribió: > At a certain point, I need to allow read and write on all fields of a > specific table > > How can I iterate through all

Re: [web2py] CUSTOMIZING WEB2PY FORMS

2018-09-07 Thread Javier Pepe
In docs you have example. http://web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-forms El vie., 7 de sep. de 2018 a la(s) 07:02, elisha bere (elishabe...@gmail.com) escribió: > Hie guys, > > how do i customize the buttons on the forms if i add =form to my web page? > > -- > Re

Re: [web2py] SQLFORM IS_NOT_EMPTY validator dependent on the value of another request vara

2018-01-15 Thread Javier Pepe
Hi You can use de conditional show_if http://web2py.com/books/default/chapter/29/07/forms-and-validators#Conditional-fields db,table.text_field.show_if = (db.table.select_field == Other) 2018-01-12 23:19 GMT-03:00 vtcpe12 : > Hi, > > I am utilizing the IS_IN_SET functionality to produce a s

Re: [web2py] Open a form (form=SQLFORM(db.marks)) for a selected person by clicking on a link of their name

2017-10-22 Thread Javier Pepe
Hi You can fill the record before SQLFORM def marks_entry(): stu=db.student(request.args(0)) *db.marks.students.default = stu.id * form=SQLFORM(db.marks) return locals(); 2017-10-22 8:59 GMT-03:00 mostwanted : > Hi guys, i need help, I'm creating a simple results man

Re: [web2py] Re: how to create pdf report in web2py???

2017-08-29 Thread Javier Pepe
Alex The tool is very good, you have a user list for question, i am to try the designer and not found howto save this. Thanks 2017-08-26 10:19 GMT-03:00 Alex : > We created a report tool since creating pdf reports in a web application > is a common problem and none of the existing solutions wer

Re: [web2py] SQLFORM.GRID Change Header and labels too?

2017-04-07 Thread Javier Pepe
Hi You can use de label atribute in Field definition, this used in all forms. - label is a string (or a helper or something that can be serialized to a string) that contains the label to be used for this field in auto-generated forms. http://www.web2py.com/books/default/chapter/29/06/t

Re: [web2py] Grid

2017-01-24 Thread Javier Pepe
Hi You can use selectable metod to pass selected row to a function to update records. El sáb., 21 ene. 2017 a las 12:05, Bishal Saha () escribió: > Cant we use grid to update few rows ? > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/w

Re: [web2py] How to define tables in a new model file

2016-05-11 Thread Javier Pepe
Hi Web2py load files in alphabet orden. You need rename files for load in correct order. For example: Db.py as 00_db.py Data.py as 01_data.py El dom., 8 de mayo de 2016 10:48, Simon Carr escribió: > I created a new model and called it data.py > > I created a definition for a table > > db.defin

Re: [web2py] Changing color of field

2016-04-21 Thread Javier Pepe
Hello If you use bootstrap, can change the class of field http://getbootstrap.com/css/#helper-classes-backgrounds On Thu, Apr 21, 2016 at 9:39 AM, Md Anam Raihan wrote: > I am creating task management app and i want to change color of field if > deadline is completed then how to do it using

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] charts on web2py

2016-01-20 Thread Javier Pepe
Hi For simple charts you can use google chart, exist plugin for integrate this http://www.web2pyslices.com/slice/show/1721/google-charts-plugin On Wed, Jan 20, 2016 at 3:09 PM, Richard Vézina wrote: > Do you know that plotly was open sourced : https://plot.ly/ > > I it one of your best choic

Re: [web2py] Showing menu only after successful login

2015-02-10 Thread Javier Pepe
Also you can try to verify the model (menu.py) that the user is logged before loading the array with the options menu if auth.is_logged_in (): response.menu = [options ] else: response.menu = [] On Tue, Feb 10, 2015 at 5:26 PM, Richard Vézina wrote: > You can create a layout_login.

Re: [web2py] grid problem

2014-07-29 Thread Javier Pepe
form = SQLFORM.grid(db.t_proposte, searchable=True, deletable=True, details=False, * selectable**=True,** <- must be a function* csv=True, user_signature=False) #

Re: [web2py] how to turn off the record counter on Sqlform.grid

2014-06-26 Thread Javier Pepe
I'm use this code: form = SQLFORM.grid() form.element('.web2py_counter',replace=None) On Thu, Jun 26, 2014 at 2:04 AM, JorgeH wrote: > hello > Is it possible to turn off the record counter , on the top right of the > table generated by sqlform.frid ?? > > -- > Resources: > - http://web2py.com

Re: [web2py] Re: Cron job every 30 seconds

2013-11-28 Thread Javier Pepe
You can add cron job which sleep * * * * * sleep 0;/usr/local/apps/web2py/applications/sipacweb/private/run procesos.py * * * * * sleep 10;/usr/local/apps/web2py/applications/sipacweb/private/run procesos.py * * * * * sleep 20;/usr/local/apps/web2py/applications/sipacweb/private/run procesos.py *

Re: [web2py] Re: simple button in grid question

2013-09-16 Thread Javier Pepe
You need pass a list of dict links = [{'header':'', 'body': lambda row: A('',_title='Procesar',_class='icon-refresh',_href=URL(c='planilla', {'header':'', 'body': lambda row: A('',_title='Mail',_class='icon-envelope',_href='index/pedircontadores/% {'header':'', 'body': lambda r

Re: [web2py] Re: web2py 2.6.1 is OUT - IMPORTANT READ

2013-09-13 Thread Javier Pepe
Now work The update from admin interface not end correctly. Unzip file over actual folder, restart and work!!! On Fri, Sep 13, 2013 at 8:49 AM, Javier Pepe wrote: > I'm try to use new version, but missing settings.cfg file. > > In that directory has to put it and what fo

Re: [web2py] Re: web2py 2.6.1 is OUT - IMPORTANT READ

2013-09-13 Thread Javier Pepe
I'm try to use new version, but missing settings.cfg file. In that directory has to put it and what format must have? Thansk On Fri, Sep 13, 2013 at 8:40 AM, Javier Pepe wrote: > +1 > > > On Fri, Sep 13, 2013 at 5:56 AM, Tim Richardson wrote: > >> I've been us

Re: [web2py] Re: web2py 2.6.1 is OUT - IMPORTANT READ

2013-09-13 Thread Javier Pepe
+1 On Fri, Sep 13, 2013 at 5:56 AM, Tim Richardson wrote: > I've been using it for about a month on one Windows production site with > ms-sqlserver, and it's a great release. So many improvements and even more > fun to use. Thanks. > > -- > Resources: > - http://web2py.com > - http://web2py.com/

Re: [web2py] Re: Load every 5 seconds

2013-08-30 Thread Javier Pepe
Thanks works better than expected On Fri, Aug 30, 2013 at 2:53 PM, Paolo Valleri wrote: > Have a look at > http://web2py.com/books/default/chapter/29/12/components-and-plugins#Components > Paolo > > On Friday, August 30, 2013 7:50:10 PM UTC+2, Javier Pepe wrote: >> &g

[web2py] Load every 5 seconds

2013-08-30 Thread Javier Pepe
Hi I need load SQLFOM.grid every 5 seconds, try whith autorefresh, but load all page. I need help to create javascript to load only a SQLFROM.grid. Thanks -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group an

Re: [web2py] Any way of removing the text from Grid buttons?

2013-08-29 Thread Javier Pepe
Is simple SQLFORM.grid(query,showbuttontext=False) On Wed, Aug 28, 2013 at 8:19 PM, greenpoise wrote: > is there a way to remove the text from grid buttons? I mean the stock ones > (View, Edit, Delete) > > -- > > --- > You received this message because you are subscribed to the Google Groups >

Re: [web2py] Re: Change form layout

2013-06-24 Thread Javier Pepe
You can try whith: http://dev.s-cubism.com/plugin_solidform On Mon, Jun 24, 2013 at 12:02 PM, Tom Russell wrote: > Ah, I see now. > > Thanks > > > On Mon, Jun 24, 2013 at 10:50 AM, Anthony wrote: > >> No, 3 columns means: >> >> Col 1 Col 2 Col 3 >> label widget comment >> >> It's st

Re: [web2py] SQLFROM.GRID SELECTEBLE

2013-05-10 Thread Javier Pepe
Hi you have to use selectable = lambda ids: function(ids) def function(ids): ... ... ... On Fri, May 10, 2013 at 9:14 AM, Pawan Jha wrote: > Hi I am new developer with Web2py so getting problem to work on so please > help > > > I'm using "selectable=True" in the sqlform.grid. This shows a che

Re: [web2py] REF: Pie/bar Charts

2013-04-04 Thread Javier Pepe
Hello I am use http://pygooglechart.slowchop.com/ Is very simple, create a file, a use then in the view. On Thu, Apr 4, 2013 at 10:37 AM, Teddy Nyambe wrote: > whats the easiest way to create a pie/bar chart using web2py/python, i was > attempting to use pycha with cairo/pycairo libraries wi

Re: [web2py] Smartgrid: How to make value from foreign table appear in table when only foreign key is in table

2013-02-22 Thread Javier Pepe
Alex Use represent for this: http://web2py.com/books/default/chapter/29/06#Record-representation Ej: db.Word.dictionaryTipeID.represent = lambda id,row: db.DictionaryType (id).dictionaryName On Thu, Feb 21, 2013 at 10:35 PM, Alex Glaros wrote: > Instead of *db.Word.dictionaryTypeID* displ

Re: [web2py] SQLFORM.grid and the maxtextlength parameter: The parameter doesnt work in my code

2013-01-18 Thread Javier Pepe
Hello maxtextlength is for all fields, you need use maxtextlengths http://web2py.com/book/default/chapter/07#SQLFORM.grid-and-SQLFORM.smartgrid On Fri, Jan 18, 2013 at 9:40 AM, Sverre wrote: > I have the controller: > > def commodities(): > tbl = db.commodities > fields = [tbl.itemcod

Re: [web2py] Smartgrid orderby field , descending

2013-01-09 Thread Javier Pepe
Use this: orderby=~db.table.date On Wed, Jan 9, 2013 at 7:08 AM, António Ramos wrote: > hello, how do i order a smartgrid based on a field in descending order? > for example the auth event table on date descending > > thank you > > -- > > > > --

Re: [web2py] Re: Need to save a multipage PDF

2012-11-21 Thread Javier Pepe
Try this: def taggen_print(): *pdf = FPDF()* rows = db(db.bike_no.id > 0).select() for row in rows: tag_no = row.bike_typ+str(row.id) pfile = tag_no+'_p.pdf' pdf.add_page() pdf.set_font('Arial', 'B', 14) pdf.cell(40,10,tag_no) * pdf.AddPage()* *

Re: [web2py] SQLFORM.grid dinamically update fields

2012-10-03 Thread Javier Pepe
chech this http://web2py.com/books/default/chapter/29/07?search=onupdate may help. On Wed, Oct 3, 2012 at 9:49 PM, alex wrote: > > I have a SQLFORM.grid. > When the user updates field 'a' in the grid, before submitting the form, > field 'b' should represent a calculation based on value of

Re: [web2py] Re: Calculated field in SQLFORM.grid

2012-10-01 Thread Javier Pepe
Hello You can create a function to represent in link links = [{'header':'Contador', 'body': lambda row: count_b(row.id) }] def count_b(a.id): c = db(db.B.ref_a == id).count() if c: count = c else: count = 0 return count On Sun, Sep 30, 2012 at 9:26 AM, Massimo

Re: [web2py] Re: bootstrap and user panel

2012-07-24 Thread Javier Pepe
Hello Delete the content on database dir. The system recreate auth tables. On Tue, Jul 24, 2012 at 2:49 AM, murtaza52 wrote: > > Hello Martin, > > The CSS is cool so +1 for this. > > 1) I cloned your welcome app repo and placed it under applications, this > is the summary of the error I get wh

Re: [web2py] Re: Nightly Build (for testers) for windows

2012-06-22 Thread Javier Pepe
Thanks I expect the final version On Fri, Jun 22, 2012 at 3:20 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > There are some known issue with the windows nightly build because we are > moving from python 2.5 to 2.7. He hope to resolve them soon. > > > On Friday, 22 June 2012 11:53

[web2py] Nightly Build (for testers) for windows

2012-06-22 Thread Javier Pepe
Hello I'm trying to use de lastest binary version and get the follow error: Traceback (most recent call last): File "web2pypy", line 16, in zipimport.ZipImportError: can't find module 'gluon' I need use this version to use scheduler. Thanks --

Re: [web2py] web2py interactive console

2012-06-06 Thread Javier Pepe
Hello You need add the -M option to load models. On Wed, Jun 6, 2012 at 6:25 AM, Hassan Alnatour wrote: > Dear ALL , > > i am trying to use web2py from the terminal now i open the terminal and > did this : > > $ cd web2py > $ python web2py.py -S welcome > > > here web2py will start the intera

Re: [web2py] Re: Add conditional sub-menu

2012-04-12 Thread Javier Pepe
I was working on a set menu from the database. It's simple and it can be useful. The model is simple, and has a condition to evaluate options when generating the menu items. The evaluation was done using the function 'eval'. Attach model. To manage SQLFORM.grid use or what you like db.define_table

Re: [web2py] Re: SQLForm.grid : is it possible to delete multiple rows at once ?

2012-03-23 Thread Javier Pepe
sabsto You can use selectable, for example: selectable = lambda ids: delete(ids) form=SQLFORM.grid(query,selectable=selectable) def delete(ids): to_delete=db(db.tabla.id.belongs(ids)) to_delete.delete() On Fri, Mar 23, 2012 at 9:46 PM, Derek wrote: > Or you could avoid javascript,

Re: [web2py] Select Where first letter is A

2012-02-09 Thread Javier Pepe
>From manual: http://web2py.com/books/default/chapter/29/6#like,-startswith,-contains,-upper,-lower db.mytable.myfield.startswith('value') On Thu, Feb 9, 2012 at 11:06 AM, Web2Py Freak wrote: > Dear All , > > How Can i select everything in the table the starts with A > > Best Regards, > Hassan

Re: [web2py] SQLFORM.grid collection of posts

2011-10-31 Thread Javier Pepe
Nick I'm use the attribute _class to make a button A('Detalle',_class='button',_href='index/detalle/%s' % row.id) This class render a button, same a the buttons on grid. On Fri, Oct 28, 2011 at 11:08 PM, Nik Go wrote: > It mentions: "If you use jqueryui then the links are rendered as butto

Re: [web2py] Re: Overriding Grid/Smartgrid's 'Edit/Delete/View'

2011-10-06 Thread Javier Pepe
Hello Along with the question of Johann, you can add new buttons to the grid / SmartGrid, because the links are render as links, and not as buttons. Thanks On Thu, Oct 6, 2011 at 9:36 AM, apple wrote: > You can add your own buttons using: > > links = [lambda row: A('Edit',_href=URL("controller"