[web2py] import csv (referenced fields)

2017-01-05 Thread Adam Jed
Hi, I have defined tables: db.define_table('BL', Field('name'), format='%(name)s' ) db.define_table('PL', Field('name'), Field('BL_name', 'reference BL'), format='%(name)s' ) db.defi

[web2py] Creating table from a controller

2017-01-05 Thread Leonardo Dutra
Hi guys, I need to create a table in my db from a controller, such as: I have my controller and after to submit a form it will create a new table automatically, it's possible? If they have better suggestions, please feel free to tell me! Thanks a lot! -- Resources: - http://web2py.com - http:/

[web2py] Custom forms, I don't undersand

2017-01-05 Thread Wellington Faria
Hi. I don't understand how i use it: - form.custom.label[fieldname] contains the label for the field. - form.custom.comment[fieldname] contains the comment for the field. - form.custom.dspval[fieldname] form-type and field-type dependent display representation of the field. - fo

[web2py] IS_IN_SET or IS_IN_DB to create a sublist based on part of a table

2017-01-05 Thread Pierre Corbeil
Trying to migrate my old access environment to web2py. I have imported all data, can be viewed ok. Trying to get a dropdown list (when using smargrid) that is a subset of a table. been trying for while now, maybe someone can give me a hint. Here is the tables : # db.define_table('famille' ,

[web2py] LOAD Component returns "invalid function"

2017-01-05 Thread briannd81
Please help with the following: In CONTROLLER: def get_author(*args): In VIEW: {{=LOAD('default', 'get_author.load', ajax=True)}} With the LOAD component inside a view, it returns "Invalid function (default/get_author)". Seems like it doesn't like the function argument *args. There is no er

[web2py] Re: how get the set/tuple from the DAL requires of IS_IN_SET

2017-01-05 Thread Anthony
On Thursday, January 5, 2017 at 9:59:18 PM UTC-5, Anthony wrote: > > db.dictionary.type.requires.theset > Note, the above actually gives you back [str(item) for item in the_original_set]. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web

[web2py] Re: how get the set/tuple from the DAL requires of IS_IN_SET

2017-01-05 Thread Anthony
db.dictionary.type.requires.theset Anthony On Thursday, January 5, 2017 at 6:12:21 PM UTC-5, lucas wrote: > > hey one and all, > > say there is this: > > db.define_table('dictionary', > Field('word', length=32, requires=IS_NOT_EMPTY()), > Field('type', leng

[web2py] how get the set/tuple from the DAL requires of IS_IN_SET

2017-01-05 Thread lucas
hey one and all, say there is this: db.define_table('dictionary', Field('word', length=32, requires=IS_NOT_EMPTY()), Field('type', length=1, requires=IS_IN_SET(('F','G','A','P','C','B','M','U')), comment="Frequent, General, Astronomical, Physical, Chemica

[web2py] Made with web2py

2017-01-05 Thread Mathieu Clabaut
Hello everybody, This is just to announce a new web2py powered website (my first one) going live : http://bback.me This site is in beta test for now, but you can ask for taking part in the beta test phase at https://bback.me/user_/request_access. Note that the English version has not been proofr

Re: [web2py] Re: session.flash question

2017-01-05 Thread Anthony
It seems session.flash must be empty at that point, though hard to say why without seeing all the relevant code. On Thursday, January 5, 2017 at 11:52:33 AM UTC-5, Ramos wrote: > > it appears "empty" > anyway i changed it to test a more simpler approach so... > > > {{if session.flash:}} > *

Re: [web2py] Re: session.flash question

2017-01-05 Thread António Ramos
it appears "empty" anyway i changed it to test a more simpler approach so... {{if session.flash:}} ** * toastr.info <http://toastr.info>("popup message");* ** × {{=T("Notification")}}: {{=s

[web2py] Re: Call functions from other applications without network requests

2017-01-05 Thread Anthony
Check out http://web2py.com/books/default/chapter/29/04/the-core#Execution-environment and http://web2py.com/books/default/chapter/29/04/the-core#Cooperation. You might also consider whether the shared functionality can be abstracted into Python modules that can be imported by multiple applicat

[web2py] Re: session.flash question

2017-01-05 Thread Anthony
> > *But this does not work!!* > > flash="{{=session.flash or 'empty'}}"; > > if (flash=="") > { > toastr.info(flash); > } > > > > how to fix this ? > What do you mean "does not work"? Please check the HTML source code in the browser -- does the correct va

[web2py] Re: is there "has_signature()" alternative for auth.requires_signature()

2017-01-05 Thread Anthony
Use URL.verify() -- http://web2py.com/books/default/chapter/29/04/the-core#Digitally-signed-urls. Anthony On Thursday, January 5, 2017 at 9:46:31 AM UTC-5, Jurgis Pralgauskis wrote: > > Hi, > > I want to use @auth.requires_signature() on inner function (which is > defined inside controller fu

[web2py] Re: Rest Json

2017-01-05 Thread Leonel Câmara
PK you need to tell the server you're posting JSON in content-type for instance using $.ajax var somedict = {a: 1, b: 2}; $.ajax({ type: "POST", url: "{{=URL()}}", dataType: "json", /* if the server is also replying with json*/ contentType: "application/json; charset=UTF-8"

[web2py] Re: Arbitrary args/kwargs with service?

2017-01-05 Thread Anthony
On Thursday, January 5, 2017 at 12:39:13 AM UTC-5, Brendan Barnwell wrote: > > It looks like I could use request.restful for that, but to be honest I > find that mechanism somewhat awkward. Creating functions as local > variables and then returning locals() just seems gross to me. :-) > Not su

[web2py] is there "has_signature()" alternative for auth.requires_signature()

2017-01-05 Thread Jurgis Pralgauskis
Hi, I want to use @auth.requires_signature() on inner function (which is defined inside controller function), but this doesn't work. I imagine 2 solutions: 1) use "has" alternative for signature decorator (but didn't notice it -- maybe too lazy to search :/ ) 2) join decorators -- but also d

Re: [web2py] Re: session.flash question

2017-01-05 Thread António Ramos
2017-01-05 12:54 GMT+00:00 Áureo Dias Neto : > flash="{{='N/A' if session.flash == None else session.flash}}"; does not work also if i just do toastr.info("{{=session.flash}}"); I always get the poput with "None" -- Resources: - http://web2py.com - http://web2py.com/book (Docum

Re: [web2py] Re: session.flash question

2017-01-05 Thread Áureo Dias Neto
Change 'flash="{{=session.flash or 'empty'}}";' to: flash="{{='N/A' if session.flash == None else session.flash}}"; 2017-01-05 10:40 GMT-02:00 António Ramos : > session.flash="Documento enviado ..." > redirect(URL(c="entities",f="list",user_signature=True)) > > *this works and shows "Documen

Re: [web2py] Re: session.flash question

2017-01-05 Thread António Ramos
session.flash="Documento enviado ..." redirect(URL(c="entities",f="list",user_signature=True)) *this works and shows "Documento enviado"* {{if session.flash:}} × {{=T("Notification")}}: {{=session.flash}} {{pass}} *But this

[web2py] Re: Call functions from other applications without network requests

2017-01-05 Thread Niphlod
never though about just scheduling the functions via the scheduler ? On Thursday, January 5, 2017 at 6:54:59 AM UTC+1, Brendan Barnwell wrote: > > I have a situation where I have (or am going to have) multiple > applications running on a single web2py instance. Each application will do > its ow

Re: [web2py] Re: session.flash question

2017-01-05 Thread Áureo Dias Neto
How you define 'session.flash'? 2017-01-05 10:04 GMT-02:00 António Ramos : > in fact this > > > toastr.info("{{=session.flash}}"); > > > > always produces a popup saying "None" > > why? > > > 2017-01-05 11:50 GMT+00:00 António Ramos : > >> *this works* >> >> {{if session.fl

[web2py] Re: session.flash question

2017-01-05 Thread António Ramos
in fact this toastr.info("{{=session.flash}}"); always produces a popup saying "None" why? 2017-01-05 11:50 GMT+00:00 António Ramos : > *this works* > > {{if session.flash:}} > >role="alert"> > aria-label="Close"> > × > >

[web2py] session.flash question

2017-01-05 Thread António Ramos
*this works* {{if session.flash:}} × {{=T("Notification")}}: {{=session.flash}} {{pass}} *But this does not work!!* flash="{{=session.flash or 'empty'}}"; if (flash=="") { toastr.info(flash); }

[web2py] Re: Smartgrid headers not working

2017-01-05 Thread Andrea Fae'
great!! Il giorno mercoledì 4 gennaio 2017 17:24:58 UTC+1, Anthony ha scritto: > > Any argument to .grid that is normally a dictionary must actually be a > dictionary of dictionaries with .smartgrid -- you need a separate key for > each table: > > headers = {'sede': {'sede.nome': 'Struttura', 's