[web2py] Re: Setting hidden fields with custom SQLFORMs

2021-09-10 Thread Diego Tostes
Is it possible to use on SQLFORM.grid? Em quarta-feira, 18 de março de 2015 às 16:11:44 UTC-3, pumplerod escreveu: > I tried that. It doesn't work either. I've worked around my issue by > simply not using hidden fields at all, but rather populating the fields > after the form is submitted

[web2py] Column auth_user.id not found BUT the column exists.

2020-06-23 Thread Diego Tostes
I am getting this error: Traceback (most recent call last): File "/home/rebec/web2py/gluon/restricted.py", line 227, in restricted exec ccode in environment File "/home/rebec/web2py/applications/lavanderia/views/appadmin.html"

[web2py] Re: hidden field on CRUD

2019-02-26 Thread Diego Tostes
Done. I did using the table definitions ... Field('user_id', 'integer',writable=False ,readable=False,default=user_dic["user_id"]) Em ter, 26 de fev de 2019 09:34, Diego Tostes escreveu: > Hi, > > i have this controller: > > def cria_servico(): > crud.setting

[web2py] hidden field on CRUD

2019-02-26 Thread Diego Tostes
Hi, i have this controller: def cria_servico(): crud.settings.create_next = URL('default', 'dashboard') form = crud.create(db.service) I have a field on db.service named user_id. I whant to force the form to fill this field with the auth_user.id of the user. How can i hidden this

[web2py] Conditional fields

2019-02-23 Thread Diego Tostes
Hi, Is it possible to use Conditional fields to show a filed field? I want to fill the geolocation infos using a Zip code from a field. rgds Diego -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Create a drop-down menu from a database

2018-09-17 Thread Diego Tostes
Massimo, may i use multiple fields on SQLFORM.factory? may be a solution to create a form with the functionality of set a state and automatically fill a dropdown with all cities from selected state, set a city and automatically fill a dropdown with all zones from that selected cities...

[web2py] conditional requirements

2018-09-16 Thread Diego Tostes
Hi, i was reading about conditional fields ( http://web2py.com/books/default/chapter/29/07/forms-and-validators#Conditional-fields ) and i have a question. is it possible to do it as a table definition? bellow are my table definition: Adverts = db.define_table('adverts',

[web2py] auto save feature

2018-07-15 Thread Diego Tostes
Hi, i have a table with more than 60 fields. Is it possible to create a "auto save" feature with web2py Built-in methods to allowing users to have data saved while the process of filling the form? rgds Diego -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] Re: error: invalid literal for long() with base 10: ''

2018-07-02 Thread Diego Tostes
The problem was at dB.clientes... Solved. Thanks!! Em seg, 2 de jul de 2018 16:20, Anthony escreveu: > Hard to say what's going on. Looks like it's getting an empty string from > an ID field. What does the db.clientes definition look like? > > On Monday, July 2, 2018 at 7:38:27 AM

[web2py] error: invalid literal for long() with base 10: ''

2018-07-02 Thread Diego Tostes
Hi, i have this table: def tempo_total_produto(produto_id): try: query = ((db.produto.id == produto_id)) result = db(query).select() data_status = result[0]["data_criacao"] data_hoje = datetime.date.today() retorno = abs((data_hoje -

[web2py] form in a dialog box

2018-06-30 Thread Diego Tostes
Anyone already used this plugin or have any tips to create a link in a SQLFORM that call a form in a dialog box? http://www.web2pyslices.com/slice/show/1713/ Rgds Diego -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] Re: customize requires in DB

2018-06-27 Thread Diego Tostes
liente,* * r.ordem_servico_id.identificador_os))* 2018-06-27 12:25 GMT-03:00 Diego Tostes : > Hi Anthony, > > > i think that put the requires make my code more organized ... But it is a > personal choice. I did changes in my tables and now i have: > > > Clientes = db.define_table('clientes', >

Re: [web2py] Re: customize requires in DB

2018-06-27 Thread Diego Tostes
em_servico.id <http://ordem_servico.id>',* *lambda r: '%s - os: %s' % (r.ordem_servico_id.produto_id.cliente_id.nome_cliente,* * r.ordem_servico_id.identificador_os))* > is it possible to "navigate" like this? *r.ordem_servico_id.produto_id.

[web2py] data from more than one table on SQLFORM grid

2018-06-26 Thread Diego Tostes
HI, I have those tables: *Produto = db.define_table('produto',* *Field('ficha_tecnica', 'upload', label=T("Ficha Tecnica")),* *Field('descricao_produto', 'string', label=T("Descricao Produto")))* *Ordem_servico = db.define_table('ordem_servico',* *Field('identificador_os',

Re: [web2py] Re: customize requires in DB

2018-06-20 Thread Diego Tostes
ormat" arguments in the definitions of the respective referenced > tables). In that case, web2py will automatically define the IS_IN_DB > validators for you. > > Anthony > > > On Wednesday, June 20, 2018 at 10:40:18 AM UTC-4, Diego Tostes wrote: >> >> I have tho

[web2py] customize requires in DB

2018-06-20 Thread Diego Tostes
I have those tables: *Produto = db.define_table('produto',* *Field('ficha_tecnica', 'upload', label=T("Ficha Tecnica")),* *Field('cliente_id', 'integer', label=T("Cliente ID")),* *Field('cliente_nome', 'string', label=T("Nome Cliente"))* *)* *Pedido = db.define_table('pedido',* *

[web2py] IS_IN_DB and SQLFORM edition

2018-06-13 Thread Diego Tostes
Hi, i have a table and i am using: Show_Room.product_id.requires = IS_IN_DB(db(Product), 'product.ref', '%(client_name)s - ref: %(ref)s') When i am using SQLFORM to edit a line of my table, the already persisted product_id is not selected and i have to select again. If i do not select the

[web2py] pre-populating SQLFORM

2018-06-11 Thread Diego Tostes
Hi, I want to send informations to fill some fields in a SQLFORM. I read this on web2py book: http://web2py.com/books/default/chapter/29/07/forms-and-validators#Pre-populating-the-form But i did not understood. Anybody has a example of this ? def display_form(): record =

Re: [web2py] Re: trigger implementation

2018-06-11 Thread Diego Tostes
Thanks!!! it works!! 2018-06-09 21:36 GMT-03:00 黄祥 : > perhaps you can use callback (before_update or after_update) > ref: > http://web2py.com/books/default/chapter/29/06/the- > database-abstraction-layer#callbacks-on-record-insert--delete-and-update > > best regards, > stifan > > -- >

[web2py] trigger implementation

2018-06-09 Thread Diego Tostes
Hi, is there a way to implement a trigger on web2py? i need a way to persist informations in a table every time a specific column in a specific table changes the value. rgsd Diego -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

[web2py] custom header in QLFORM

2018-04-21 Thread Diego Tostes
Hi, this is my code: fields = (db.ensaios.codigo_registro, db.ensaios.patrocinador_primario, db.ensaios.contato_publico, db.ensaios.titulo_en, db.ensaios.trial_info ) headers = {'db.ensaios.codigo_registro':

Re: [web2py] Re: direct upload in directory

2018-04-03 Thread Diego Tostes
thanks. db(db.ensaios.codigo_registro == "novo ensaio").update(en_pdf=stream) works for me!! thanks again! 2018-04-03 7:09 GMT-03:00 Dave S <snidely@gmail.com>: > On Monday, April 2, 2018 at 12:50:38 PM UTC-7, Diego Tostes wrote: >> >> Hi, >> >&

[web2py] Re: direct upload in directory

2018-04-02 Thread Diego Tostes
Hi, I already use this: stream = open("/teste_en.pdf", 'rb') db.ensaios.insert(codigo_registro="novo ensaio", en_pdf=stream ) but I need to know if is a possible update a row with an upload. 2018-04-02 14:27 GMT-03:00 Diego Toste

[web2py] Re: direct upload in directory

2018-04-02 Thread Diego Tostes
2018-04-02 13:22 GMT-03:00 Diego Tostes <dtos...@gmail.com>: > Hi, > > > i have a table in my model called ensaios: > > Ensaios = db.define_table('ensaios', > Field('codigo_registro', 'string'), > Field('url', 'string'), > Field('titulo_pt', 'string'),

[web2py] direct upload in directory

2018-04-02 Thread Diego Tostes
Hi, i have a table in my model called ensaios: Ensaios = db.define_table('ensaios', Field('codigo_registro', 'string'), Field('url', 'string'), Field('titulo_pt', 'string'), Field('titulo_en', 'string'), Field('tags', 'text'), Field('contato_publico', 'string'),

[web2py] requires em model

2017-06-10 Thread Diego Tostes
Hi, i was using a require in my model like this: Position.company.requires = IS_IN_DB(db, Company.id, '%(name)s') But i need to use a query that allows the user to insert only the companys that him already created. I need to know if is possible use a query like: Company.id and Company.owner

[web2py] contact form with attachments

2017-06-10 Thread Diego Tostes
Hi, how can i send to a controller the attachment file from a html form in my view? Rgds Diego -- 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

Re: [web2py] data from controller to javascript

2017-01-24 Thread Diego Tostes
Thanks Ramos! 2017-01-24 10:42 GMT-02:00 António Ramos <ramstei...@gmail.com>: > try > var lista = {{=*XML(*dic["signals_list"]*)*}}; > > > http://www.web2pyref.com/reference/xml-html-helper > > 2017-01-24 11:37 GMT+00:00 Diego Tostes <tostes.pyt...@gmai

[web2py] data from controller to javascript

2017-01-24 Thread Diego Tostes
Hi, I need to send a list from controller to a javascript variable in the view. When i send the data the list to the view using: var lista = {{=dic["signals_list"]}}; and when i try to open the page i get: var lista = [Fever, fever, dor no corpo, enxaqueca]; How can i fix this? Rgds

Re: [web2py] Re: static file

2017-01-24 Thread Diego Tostes
de static/js > then load it like this in the html > {{response.files.append(URL('static','/js/tagit.js'))}} > > > > > 2017-01-20 12:42 GMT+00:00 Diego Tostes <tostes.pyt...@gmail.com>: > >> Hi guys,,... >> >> i did all the tips without succes... >>

[web2py] static file

2017-01-20 Thread Diego Tostes
Hi, I have a html file that i i need to use with web2py, but this file access a unique css and js file. I try to add the files at the static withous success. I try to hardcoder the script and the css at the html file without success too. How can i do ? Rgds Tostes -- Resources: -

Re: [web2py] Re: static file

2017-01-20 Thread Diego Tostes
ppend(URL('static','/css/zzz.css'))}} > {{extend 'layout.html'}} > > 2017-01-19 20:30 GMT+00:00 Dave S <snidely@gmail.com>: > >> On Thursday, January 19, 2017 at 12:22:06 PM UTC-8, Diego Tostes wrote: >>> >>> Hi, >>> >>> I have a html file

[web2py] static file

2017-01-19 Thread Diego Tostes
Hi, I have a html file that i i need to use with web2py, but this file access a unique css and js file. I try to add the files at the static withous success. I try to hardcoder the script and the css at the html file without success too. How can i do ? Rgds Tostes -- Resources: -

[web2py] security login web2py

2016-01-30 Thread Diego Tostes
Hi, I am doing tests to approve a system that was develop in using web2py. When i did a modification on the code of the gluon/tools.py in: def __call__(self): """ Example: Use as:: def authentication(): return

Re: [web2py] Re: charts on web2py

2016-01-25 Thread Diego Tostes
var options = { > title: '{{=title}}' > }; > > var chart = new > google.visualization.PieChart(document.getElementById('my_chart')); > > chart.draw(data, options); > } > > > > 2016-01-21 18:01 GMT-03:00 Diego Tostes <toste

Re: [web2py] Re: charts on web2py

2016-01-21 Thread Diego Tostes
i am trying to use google chart plugin, but the example at http://www.web2pyslices.com/slice/show/1721/google-charts-plugin, it is not so clear to me. anybody can show me a example with a controller and a view? i need a simple line chart. rgds diego 2016-01-21 17:36 GMT-02:00 Diego Tostes

Re: [web2py] Re: charts on web2py

2016-01-21 Thread Diego Tostes
thanks for all! 2016-01-21 14:17 GMT-02:00 Alex : > my favorite chart library: > https://www.amcharts.com/ > very beautiful, easy to use, good documentation and friendly license > (allows usage of free version even for commercial websites). > > Alex > > -- > Resources: > -

[web2py] charts on web2py

2016-01-20 Thread Diego Tostes
Hi, anyone can indicate a good solution to create charts using web2py? rgds diego -- 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

[web2py] sqlform default field and redirect

2016-01-18 Thread Diego Tostes
Hi, i have a sqlform like this: form = SQLFORM.grid(query=query_simulados, user_signature=False, fields=fields, ignore_rw=True, orderby=default_sort_order, create=True, deletable=True, editable=True, maxtextlength=64,

Re: [web2py] Re: sqlform default field and redirect

2016-01-18 Thread Diego Tostes
thanks! works!! 2016-01-18 14:37 GMT-02:00 Anthony <abasta...@gmail.com>: > On Monday, January 18, 2016 at 11:22:16 AM UTC-5, Diego Tostes wrote: >> >> hi anthony! >> >> thnaks... the default field is working!! >> >> but the redirect i did no unde

Re: [web2py] Re: sqlform default field and redirect

2016-01-18 Thread Diego Tostes
hi anthony! thnaks... the default field is working!! but the redirect i did no understand... 2016-01-18 14:11 GMT-02:00 Anthony <abasta...@gmail.com>: > On Monday, January 18, 2016 at 9:29:29 AM UTC-5, Diego Tostes wrote: >> >> Hi, >> >> i have a sql

[web2py] sqlform or crud form update with custom field

2015-09-14 Thread Diego Tostes
Hi, I neew to create a form to edit a existing table element, but i do not want to expose all the fields of the table to update. is that possiblem using sqlform or crud form? or i need to build a custom form at the viw and create a controler to update the table? rgds diego -- Resources: -

Re: [web2py] sqlform or crud form update with custom field

2015-09-14 Thread Diego Tostes
rd > > On Mon, Sep 14, 2015 at 12:47 PM, Diego Tostes <tostes.pyt...@gmail.com> > wrote: > >> Hi, >> >> I neew to create a form to edit a existing table element, but i do not >> want to expose all the fields of the table to update. >> >> is that pos

Re: [web2py] sqlform or crud form update with custom field

2015-09-14 Thread Diego Tostes
def controler_update(): from gluon.tools import Crud crud = Crud(db) crud.update(db.tablename, id) db.tablename.field.readable = False db.tablename.field.editable = False return dict(form=crud()) 2015-09-14 14:37 GMT-03:00 Diego Tostes <tostes.pyt...@gmail.

Re: [web2py] sqlform or crud form update with custom field

2015-09-14 Thread Diego Tostes
to completly "mute" a > field... You may use readable = True and writable = False if you want to > display the field data that will not be updated... > > Richard > > On Mon, Sep 14, 2015 at 2:47 PM, Diego Tostes <tostes.pyt...@gmail.com> > wrote: > &

Re: [web2py] sqlform or crud form update with custom field

2015-09-14 Thread Diego Tostes
; On Mon, Sep 14, 2015 at 2:16 PM, Richard Vézina < > ml.richard.vez...@gmail.com> wrote: > >> No, no, no, before the crud.update() >> >> I think it may work either after, but it more safe and coherent before >> the form definition (before crud.something). >> >

[web2py] disable field on create Sqlform

2015-09-10 Thread Diego Tostes
Hi all, is it possible to disable a field in the insert form that is created on de SQLform grid? thanks, diego -- 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

[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

[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

Re: [web2py] Re: create doc files

2013-12-30 Thread Diego Tostes
automatically. Anthony On Saturday, December 28, 2013 4:20:34 PM UTC-5, Diego Tostes wrote: here is my code: http://pastebin.com/qh5AV8Xh but the download don't start when i access this controler. 2013/12/28 Diego Tostes tostes...@gmail.com i am using the pyrtf, but i dont know

Re: [web2py] Re: create doc files

2013-12-30 Thread Diego Tostes
() Renderer().Write(doc, s) s.seek(0) return response.stream(s, attachment= True, filename= 'yourdocument.rtf') Anthony On Monday, December 30, 2013 7:52:07 AM UTC-5, Diego Tostes wrote: thanks anthony, but did not works... the result was a file with no name with None printed

Re: [web2py] Re: link as virtualfield

2013-12-28 Thread Diego Tostes
: A('Teste_%s' % row.parte.id ,_href='')) but you may also want to consider using this instead: db.parte.id.label = anexos db.parte.id.represent = lambda id,row: lambda row: A('Teste_%s' % id ,_href='')) On Friday, 27 December 2013 12:23:08 UTC-6, Diego Tostes wrote: Hi, I am trying

[web2py] create doc files

2013-12-28 Thread Diego Tostes
Hi, Is it possible create doc files (word or openoffice) using templates rendering? Rgds, Diego -- 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] Re: create doc files

2013-12-28 Thread Diego Tostes
done using PyRTF thanks 2013/12/28 Diego Tostes tostes.pyt...@gmail.com Hi, Is it possible create doc files (word or openoffice) using templates rendering? Rgds, Diego -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

Re: [web2py] Re: create doc files

2013-12-28 Thread Diego Tostes
i am using the pyrtf, but i dont know how create the file and download without save the file on the server. any idea? 2013/12/28 Anthony abasta...@gmail.com There's also python-docx https://github.com/mikemaccana/python-docx. On Saturday, December 28, 2013 10:35:33 AM UTC-5, Diego Tostes

Re: [web2py] Re: create doc files

2013-12-28 Thread Diego Tostes
here is my code: http://pastebin.com/qh5AV8Xh but the download don't start when i access this controler. 2013/12/28 Diego Tostes tostes.pyt...@gmail.com i am using the pyrtf, but i dont know how create the file and download without save the file on the server. any idea? 2013/12/28

[web2py] link as virtualfield

2013-12-27 Thread Diego Tostes
Hi, I am trying to create a virtualfield as a link like the this code: http://pastebin.com/c2wZqECH But when i create a SQL.grid this virtualfield is displayed as a string. Is it possible to create a link ? Rgds, Diego -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] grid with dictionary

2013-12-06 Thread Diego Tostes
Hi, Is it possible create a grid like SQLform.grid using a dictionay instead of a query result? Rgds, Diego -- 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)

Re: [web2py] Re: grid with dictionary

2013-12-06 Thread Diego Tostes
Hi Massimo, I want to use the same graphics of a SQLform grid using my own dictionary. I don't want to create a html grid using tr and td. I am seeking for a solution to have a good graphical grid with search engine to show data that i will send to the view using a dictionary. Rgds, Diego --