[web2py] Re: web2py: How to execute further code after ajax call

2022-08-13 Thread Anthony
FYI, already answered at https://stackoverflow.com/a/73338318/440323. On Saturday, August 13, 2022 at 10:37:06 PM UTC-4 JPlata wrote: > > > I have two dropdown/select widgets on a form. I am trying to set the > options of the second select thro

[web2py] Re: html helper: CODE (scroll or word-wrap)

2021-10-04 Thread Anthony
IV(CODE(my_code), _style="width:50%; overflow: scroll") Given the above, if the table created by CODE exceeds the width of the containing div, a horizontal scrollbar will be added. Of course, the above can also be achieved via CSS rules in a stylesheet. Anthony On Sunday, September 19, 2

[web2py] Re: Twinning tables in DAL

2021-10-04 Thread Anthony
See http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Table-inheritance. On Saturday, October 2, 2021 at 6:21:42 PM UTC-4 snide...@gmail.com wrote: > I need a reminder: > > If I want a given table structure to be used in multiple tables (different > instances existing

[web2py] Developers

2020-08-21 Thread Anthony Smith
Hi are there any programmers in Australia looking for work -- 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 subs

[web2py] Re: Why URL(..., scheme=True, ...) is implemented differently than request.is_https?

2019-07-17 Thread Anthony
Feel free to submit a pull request. Or just set scheme='https' if you know it is HTTPS. Anthony On Tuesday, July 16, 2019 at 4:31:06 AM UTC-4, Ray (a.k.a. Iceberg) wrote: > > Hi there, > > I tend to use > > URL(..., scheme=True, ...) > > in my apps to gener

[web2py] Re: Error in app: the variable was lost

2019-06-22 Thread Anthony
Can you show the full traceback? On Saturday, June 22, 2019 at 3:25:23 AM UTC-4, Константин Комков wrote: > > In my controller I have function: > def send_app(): > if session.abit_email is None:redirect(' > https://oas.timacad.ru/application', client_side=True) > const = {rec.NAME:rec.TEXT

[web2py] Re: orderby=['alias'] - works in sqlite, but not in postgres

2019-06-18 Thread Anthony
On Tuesday, June 18, 2019 at 11:04:16 AM UTC-4, Vlad wrote: > > Anthony, it works like a charm, thank you very much!! > > (Val's solution with also worked great, but it felt awkward to use the > whole thing when an alias was created, so emotionally this solution with

[web2py] Re: orderby=['alias'] - works in sqlite, but not in postgres

2019-06-18 Thread Anthony
operator, so when used in this way, it will throw an error. In any case, in SQL, "DESC" is used to indicate descending order ("ASC" for ascending). So, you can do: orderby='shares DESC' Anthony On Monday, June 17, 2019 at 11:48:51 PM UTC-4, Vlad wrote: > > This

[web2py] Re: T() in modules

2019-06-18 Thread Anthony
See http://web2py.com/books/default/chapter/29/04/the-core#Accessing-the-API-from-Python-modules. You can use current.T. Anthony On Tuesday, June 18, 2019 at 6:39:21 AM UTC-4, 黄祥 wrote: > > web2py™ Version 2.18.5-stable > tryin to use T() in modules > Traceback (most rece

[web2py] Re: how safe is it to rely on a value stored as a session variable?

2019-06-07 Thread Anthony
Users can neither read nor write to the session (even cookie based sessions, which are encrypted), so it is "safe" in that regard. Of course, we don't know what your app code is writing to the session -- if you take user input and write it to the session, then it may not be saf

[web2py] Re: auth.settings.login_next doesn't redirect after login -

2019-06-07 Thread Anthony
irect results in the browser sending a new HTTP request to web2py, and in that new request, your setting is not made. Instead, maybe try: def login_to_url(): login_next = URL(request.args(0), request.args(1)) redirect(URL('default','user', args='login', vars=dict(_

[web2py] Re: How to make this code work ...

2019-06-04 Thread Anthony
Ajax components. Anthony On Tuesday, June 4, 2019 at 3:23:11 PM UTC-4, Ben Duncan wrote: > > Ok, the following is code from w3 schools: > https://www.w3schools.com/js/js_ajax_intro.asp > > The code is as follows : > > > > > > > The XMLHttpRequest Object &g

[web2py] Re: web2py delimiters conflict with vue.jsz

2019-06-04 Thread Anthony
See response.delimiters at http://web2py.com/books/default/chapter/29/04/the-core#response. You can set it in a model file to apply to all views, or within a particular controller or view to apply to a specific view. Anthony On Tuesday, June 4, 2019 at 2:20:30 PM UTC-4, Craig Matthews wrote

[web2py] Re: string vs text db field question

2019-06-04 Thread Anthony
SQLite doesn't make a distinction between string and text nor have a length limit, so yes, you're just "lucky" at the moment. If you plan to migrate to something like Postgres, either explicitly set a higher limit or just use a text field. Anthony On Tuesday, June 4, 2019

[web2py] Re: submitting a form from a LOAD component - request.post_vars is empty

2019-06-01 Thread Anthony
don't want web2py to trap the form, try: Alternatively, create the entire form via Javascript *after* the component has been loaded. Anthony On Friday, May 31, 2019 at 3:57:50 PM UTC-5, Vlad wrote: > > sorry for keeping posting about this. I am just totally stuck. I am sure

[web2py] Re: IS_NOT_EMPTY() "takes away" a dropbox with a list of items referenced by a foreign key -

2019-05-19 Thread Anthony
case, you have replaced the default validator with your own, so you no longer get the default select widget. Instead, try just use an IS_IN_DB() validator, which will require the selection of a value. Anthony On Sunday, May 19, 2019 at 1:38:10 AM UTC-4, Vlad wrote: > > In the

Re: [web2py] Re: A question about ajax function (passing a string parameter over)

2019-05-17 Thread Anthony
On Friday, May 17, 2019 at 5:17:09 PM UTC-4, Vlad wrote: > > Also, I think it would be nice if URL helper would have ability to handle > this, without a need to figure out the encoding/decoding subject... > You don't need the encoding -- just put the values in the query

[web2py] Re: A question about ajax function (passing a string parameter over)

2019-05-17 Thread Anthony
On Friday, May 17, 2019 at 12:20:37 PM UTC-4, Vlad wrote: > > It works almost, but not 100% :) > > with encodeURIComponent : > > abc def (test) > comes back as > abc_def__test_ > Please show your exact code. Doesn't sound like you are using the query string.

[web2py] Re: A question about ajax function (passing a string parameter over)

2019-05-17 Thread Anthony
ription = $(this).text(); const url='{{=URL('cart','description')}}'; ajax( `${url}?id=${encodeURIComponent(id)}&description=${encodeURIComponent(description)}` , [], ':eval'); Then in the controller, access request.vars.id and request.vars.description. Anthon

[web2py] Re: new DBAPI in pydal for both web2py and web3py

2019-05-15 Thread Anthony
On Wednesday, May 15, 2019 at 12:53:27 AM UTC-4, Massimo Di Pierro wrote: > > We can change the name but api is too ambiguous. Any other idea? > Not sure. RESTAPI? HTTPAPI? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code)

[web2py] Re: new DBAPI in pydal for both web2py and web3py

2019-05-14 Thread Anthony
Looks great. You might want to consider an alternative name to avoid confusion with the Python DB-API specification (maybe just call the class API -- i.e., pydal.API rather than pydal.DBAPI). On Tuesday, May 14, 2019 at 2:18:42 AM UTC-4, Massim

[web2py] Re: Compiled pack always includes databases and private dirs. Is there any way to pack w/o those?

2019-05-12 Thread Anthony
Click on the folder to expand. -- 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] Re: I would like to log of all SQL commands web2py sends to SQLite. Is it possible?

2019-05-05 Thread Anthony
use db._timings. Anthony On Sunday, May 5, 2019 at 4:40:04 PM UTC-4, jcrma...@gmail.com wrote: > > Just to give you some feedback, I tried adding debug=True to the DAL > command and creating a pyDAL logger. Nothing is shown in the logging file. > It gets created (so the logging is

[web2py] Re: How to pass a query set string or a string with a select/count to be executed in another controller?

2019-05-04 Thread Anthony
In each controller: from mymodule import shared_function rows = shared_function(pass, some, args) Not clear why you instead need to use the session and have another controller action involved. Anthony On Friday, May 3, 2019 at 8:35:53 AM UTC-4, jcrma...@gmail.com wrote: > > That was

[web2py] Re: How to pass a query set string or a string with a select/count to be executed in another controller?

2019-05-03 Thread Anthony
It might help to show some code. Why don't you just put the shared function in a model or module and call it directly from each controller? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2p

[web2py] Re: How to pass a query set string or a string with a select/count to be executed in another controller?

2019-05-02 Thread Anthony
ta needed to generate the query in the session (e.g., table and field name, and the request.args value). Then construct the query in the second action. There is no need to store the query itself (or a text representation of the query code). Anthony -- Resources: - http://web2py.com -

[web2py] Re: pyDAL -> jsDAL?

2019-04-30 Thread Anthony
have a look at their codebases to get a sense of the complexity involved. Anthony On Monday, April 29, 2019 at 8:47:36 PM UTC-4, Scott Hunter wrote: > > > The direction from web2py to web3py seems to be applications where the > server is responsible for (relatively) static pag

[web2py] Re: Grid search and clear buttons don't restore request.args. Where can I correct that?

2019-04-29 Thread Anthony
What do you mean by master-child pages? Are you using smartgrid? Can you show some code? On Monday, April 29, 2019 at 6:15:30 PM UTC-4, jcrma...@gmail.com wrote: > > Grid search and clear buttons don't restore request.args. Where can I > correct that? > > > If using master-child pages, the maste

[web2py] Re: Grid search collects all records from all fields on each request. Isn't this bad for performance?

2019-04-29 Thread Anthony
om search function via the "search_widget" and "searchable" arguments, respectively. For ideas on the former, see SQLFORM.search_menu, and for the latter, see SQLFORM.build_query. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.

[web2py] Re: Grid sorting sorts by id (in case of a FK) instead of shown value (eg. name). Is this normal?

2019-04-29 Thread Anthony
join with the foreign table). Anthony On Monday, April 29, 2019 at 6:26:10 PM UTC-4, jcrma...@gmail.com wrote: > > Grid sorting sorts by id (in case of a FK) instead of shown value (eg. > name). Is this normal? > > The only way I found to correct this behavior was to change the g

[web2py] Re: Is it possible to write a virtual method field that modifies the row?

2019-04-26 Thread Anthony
def change_name(row, name): row.person.update_record(name=name) The above will update the database and the local Row object. Anthony On Friday, April 26, 2019 at 5:00:34 PM UTC-4, Lisandro wrote: > > Hi Anthony, thank you for your time. > I tried the method you suggested, but h

[web2py] Re: URL with link to anchor tag

2019-04-26 Thread Anthony
On Friday, April 26, 2019 at 2:25:10 PM UTC-4, Jörg Schneider wrote: > > Is it possible to have request args and link like > www.domain.org/a/c/index.html#anchor/args ? > The "#anchor/args" part of the URL does not get sent to the server. What are you trying to achieve? -- Resources: - http:/

[web2py] Re: Is it possible to write a virtual method field that modifies the row?

2019-04-26 Thread Anthony
def change_name(row, name): db(db.person.id == row.person.id).update(name=name) db.define_table('person', Field('name'), Field.Method('change_name', change_name)) row = db.person(1) row.change_name('Lisandro') Anthony On Friday, April 26, 2

[web2py] Re: Unable to edit grid record if I add @auth.requires_signature() to action. Is this normal?

2019-04-24 Thread Anthony
e protected from tampering. In any case, it's not clear @auth.requires_signature adds any value over @auth.requires_login in this case. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google

[web2py] Re: Unable to edit grid record if I add @auth.requires_signature() to action. Is this normal?

2019-04-22 Thread Anthony
less secure, as the signature will work with any URL with a full matching path, even if the query string is different. Anyway, why do you need signed URLs in this case? Why is @auth.requires_login not sufficient? Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Docu

[web2py] Re: Unable to edit grid record if I add @auth.requires_signature() to action. Is this normal?

2019-04-22 Thread Anthony
When using signed URLs, how do users get to that function (given that the URL requires a signature)? How do you construct the URL? When using @auth.requires_signature(), does sorting and searching the grid work? Only edit fails? Anthony On Sunday, April 21, 2019 at 12:30:29 PM UTC-4, João

[web2py] Re: Unable to edit grid record if I add @auth.requires_signature() to action. Is this normal?

2019-04-21 Thread Anthony
On Sunday, April 21, 2019 at 10:53:08 AM UTC-4, João Matos wrote: > > I wanted to have signed URL everywhere. > For that, I added user_signature=True to all my URL(). The grid has that > as a default. > At this point everything worked with @requires_login() except one special > case (I believe th

[web2py] Re: Unable to edit grid record if I add @auth.requires_signature() to action. Is this normal?

2019-04-21 Thread Anthony
signatures for those links. In any case, the grid already has built-in support for signed URLs for any write operations -- do you need more than that? Anthony On Saturday, April 20, 2019 at 4:03:17 PM UTC-4, João Matos wrote: > > If I replace @auth_requires_login() with @auth.requires_sig

[web2py] Re: Where do I find the user/profiel and user/change_password forms?

2019-04-21 Thread Anthony
On Sunday, April 21, 2019 at 7:32:50 AM UTC-4, João Matos wrote: > > I'd like to make changes to the user/profile and user/change_password > forms, but I can't find them. > In the associated methods in tools.py: https://github.com/web2py/web2py/blob/master/gluon/tools.py#L3646 -- Resources: -

[web2py] Re: SQLFORM.smartgrid selectable return string or list

2019-04-20 Thread Anthony
ds). Is modify_price a controller action that needs to be accessible separately from this particular operation? If not, just make it a helper function that accepts an "ids" argument, and set selectable=modify_price. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Do

Re: [web2py] Re: Web3py

2019-04-20 Thread Anthony
As far as I can tell, the weppy ORM does not really add any functionality to the DAL -- it is mostly an alternative syntax. I'm not saying there isn't value there, just that it is a lot of code maintenance to take on for maybe only a very modest benefit. Anthony -- Resources: - http:/

Re: [web2py] Re: Web3py

2019-04-20 Thread Anthony
organization or readability (particularly not enough to warrant introduction of the ORM codebase as well as the confusion that can come with having multiple ways to do the same thing). Anthony > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2p

Re: [web2py] Re: Web3py

2019-04-19 Thread Anthony
efits are worth having to adopt all that new code (and update it when changes are made to pyDAL). Maybe it should remain an external package rather than being folded into pyDAL. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Sourc

Re: [web2py] Re: Web3py

2019-04-19 Thread Anthony
the weppy ORM in particular, though, I think it really is just alternative syntax for everything that can already be done via pyDAL, typically with the same number of lines of code (note, the above examples would have the same number of lines if you added the @rowattr('get_something_plus_

[web2py] Re: SQLFORM.smartgrid selectable return string or list

2019-04-19 Thread Anthony
the conversion to a list. Anthony On Friday, April 19, 2019 at 9:28:21 AM UTC-4, icodk wrote: > > SQLFORM.smartgrid selectable return string if only one checkbox was > slected and returns a list if 2 or more was selected. > This inconsitancy force me to check for type before processin

[web2py] Re: Does web2py support SSE (server sent events) from HTML5?

2019-04-16 Thread Anthony
On Tuesday, April 16, 2019 at 11:14:10 AM UTC-4, João Matos wrote: > > Thanks Anthony, but I'm using Apache. > > Do you know any current solution for Apache? > You should be able to run Centrifugo or Pushpin side-by-side with Apache (on a different port). You could even

[web2py] Re: Is it possible to update a Rows object with another Rows object?

2019-04-16 Thread Anthony
])).select() > if len(request.args) > 1: > for id_ in request.args[1:]: > rows.update(db(db.wo.id == int(id_)).select() > > Why not a single query to get all records: rows = db(db.wo.id.belongs(request.args)).select() Anthony -- Resources: - http://web2py.com

[web2py] Re: Does web2py support SSE (server sent events) from HTML5?

2019-04-16 Thread Anthony
ithub.com/centrifugal/centrifugo/> and Pushpin <https://pushpin.org/>. Anthony On Saturday, April 13, 2019 at 3:06:46 PM UTC-4, João Matos wrote: > > It would be great if web3py would support SSE. > > For now, the websocket solution would work with Apache? > > sábado, 1

[web2py] Re: Does anyone know if it's possible & how I can distinguish, from web2py perspective, 2 browser tabs?

2019-04-13 Thread Anthony
trolled client-side via Javascript, making Ajax calls to the server. In that case, you could either store the relevant state in the browser (and send whatever is needed to the server with the Ajax requests), or just have a session ID in the page that gets sent with every Ajax request. An

[web2py] Re: Is it possible to send all args & vars from a view/controller to another using POST instead of GET?

2019-04-13 Thread Anthony
or an Ajax request -- but not via a redirect. Anthony -- 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 s

[web2py] Re: Datatables Object ID

2019-04-13 Thread Anthony
es.net/examples/advanced/deepObjects.html. The code is much simpler on the web2py side (even when joining multiple tables), and handling the nested objects in Datatables is very simple. Anthony On Saturday, April 13, 2019 at 4:23:09 PM UTC-4, Cristina Sig wrote: > > Thank you for the reply! >

[web2py] Re: Does anyone know if it's possible & how I can distinguish, from web2py perspective, 2 browser tabs?

2019-04-13 Thread Anthony
to distinguish between the tabs? What are you trying to achieve? Anthony -- 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

[web2py] Re: Is it possible to send all args & vars from a view/controller to another using POST instead of GET?

2019-04-13 Thread Anthony
u code to access the data. FORM and SQLFORM, for example, read data from request.post_vars. Anthony -- 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 r

[web2py] Re: Does anyone know if it's possible & how I can distinguish, from web2py perspective, 2 browser tabs?

2019-04-13 Thread Anthony
What are you trying to do? On Friday, April 12, 2019 at 6:10:47 PM UTC-4, João Matos wrote: > > Does anyone know if it is possible and how I can distinguish, from web2py > perspective, 2 tabs or windows (not Firefox containers) from the same > browser? > -- Resources: - http://web2py.com - htt

[web2py] Re: Datatables Object ID

2019-04-13 Thread Anthony
See https://stackoverflow.com/a/55667115/440323. On Friday, April 12, 2019 at 11:58:36 PM UTC-4, Cristina Sig wrote: > > Hello everybody, > > I have two tables and I am working with Datatables and what I would like > to do is use the child row to show more information about a particular row. > F

[web2py] Re: 2.18.5 LI(_class="dropdown-divider") bug?

2019-04-11 Thread Anthony
expects lists/tuples with 3 values. Either change your menu or change the code in the layout. Anthony On Thursday, April 11, 2019 at 8:18:00 PM UTC-4, lucas wrote: > > ok, i tried it without the appends, instead just direct: > > response.menu[1][3] = [ > (T('Dashboard

[web2py] Re: 2.18.5 LI(_class="dropdown-divider") bug?

2019-04-11 Thread Anthony
('Dashboard'), False, URL('main', 'students')), ... ] Anthony On Thursday, April 11, 2019 at 5:59:04 PM UTC-4, lucas wrote: > > alright, so just to be absolutely sure. i copied the layout.html and the > default/index.html files from the 2.18.5 welcome app and s

[web2py] Re: Bug in grid's edit validation.

2019-04-11 Thread Anthony
ther page. If it does, it doesn't work. > Deletes via the grid buttons happen via Ajax, so you need a client-side redirect: def ondelete(table, id): redirect(URL(...), client_side=True) Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://g

[web2py] Re: 2.18.5 LI(_class="dropdown-divider") bug?

2019-04-11 Thread Anthony
That traceback comes from code in your index.html view, not the code you have shown. There is an HTML helper that is being indexed, and whatever index value is being used is higher than the number of components in the helper. Hard to say more without seeing the relevant code. Anthony On

[web2py] Re: Bug in grid's edit validation.

2019-04-11 Thread Anthony
ted above, before and after delete callbacks in SQLFORM might be nice, but certainly aren't a necessity (particularly given that in many, if not most, cases, the DAL callbacks would suffice). Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.

[web2py] Re: 2.18.5 LI(_class="dropdown-divider") bug?

2019-04-11 Thread Anthony
Just post the traceback code directly -- don't need a ticket attachment. On Thursday, April 11, 2019 at 7:45:24 AM UTC-4, lucas wrote: > > attached and thank you. and for the record, I've tried everything I can > think of the for the past few days. and if it turns out I'm just a dumb > butt, t

[web2py] Re: Apps created using web2py 2.14 version doesn't open in 2.18

2019-04-11 Thread Anthony
Any details on what is happening? On Thursday, April 11, 2019 at 8:15:31 AM UTC-4, Ron Chatterjee wrote: > > Does anyone know how to mitigate the issue? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.goo

[web2py] Re: Bug in grid's edit validation.

2019-04-11 Thread Anthony
time that a special password is required. Anthony -- 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 t

[web2py] Re: Bug in grid's edit validation.

2019-04-11 Thread Anthony
essful update) and "onfailure" (run after failed update) arguments, as well as the "ondelete" argument. Some combination of these callbacks could be used to run some code whenever a delete is requested, though it is probably simpler to just do a check like the followin

[web2py] Re: 2.18.5 LI(_class="dropdown-divider") bug?

2019-04-11 Thread Anthony
I also tried using A instead of LI since current web2py > converts the tuple into A when in the submenu, that gave the same error > also. > > On Wednesday, April 10, 2019 at 3:41:08 PM UTC-4, Anthony wrote: >> >> Indexing is zero-based in Python, so the index of the third

[web2py] Re: Bug in grid's edit validation.

2019-04-11 Thread Anthony
I should also point out, at some point, if your requirements deviate too far from the built-in functionality of the grid, it might be easier to not use the grid and simply code your own solution. On Thursday, April 11, 2019 at 7:24:35 AM UTC-4, Anthony wrote: > > On Wednesday, April 10, 2

[web2py] Re: Bug in grid's edit validation.

2019-04-11 Thread Anthony
some house keeping or some other task when someone deletes a > record. > Better to use the db.mytable._after_delete callback for these cases. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://c

[web2py] Re: 2.18.5 LI(_class="dropdown-divider") bug?

2019-04-10 Thread Anthony
Indexing is zero-based in Python, so the index of the third element is 2, not 3. Anthony On Tuesday, April 9, 2019 at 10:23:47 PM UTC-4, lucas wrote: > > hey all, > > I have the following code under menu.py under 2.18.5: > > response.menu = [ > (T('Lectu

[web2py] Re: Bug in grid's edit validation.

2019-04-10 Thread Anthony
leting the record and that doesn't happen. > If the record is being deleted, why would you need to validate the submitted values (given that they will not be applied)? Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

[web2py] Re: The support of MongoDB is still experimental?

2019-04-09 Thread Anthony
I don't think so -- just that the book was never updated. On Tuesday, April 9, 2019 at 6:37:04 PM UTC-4, João Matos wrote: > > Hello, > > The support of MongoDB is still experimental? > > Thanks, > > JM > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.

[web2py] Re: Convert in line Javascript to file

2019-04-09 Thread Anthony
Get rid of the

[web2py] Re: Clearing cache for multiple processes / threads

2019-04-08 Thread Anthony
cache.ram is separate per process. What is the logic that you are currently using to clear the cache? On Monday, April 8, 2019 at 3:08:49 PM UTC-4, William wrote: > > Hi all, I have been trying to clear cache using cache.ram(key, None), but > the cleared cached value still appears even after cle

[web2py] Re: auth_user change field order

2019-04-08 Thread Anthony
rm in the view. Anthony On Monday, April 8, 2019 at 10:20:27 AM UTC-4, lucas wrote: > > i tried this before and after auth.define_tables and it had no effect: > > auth.settings.profile_fields = ['prefix_title', 'first_name', 'last_name', > 'g

[web2py] Re: auth_user automatically lowercase all email fields

2019-04-08 Thread Anthony
it to lowercase so at > least i know what is definitely stored in the db. > Yes, by default Auth already forces email addresses to lowercase. You have to set auth.settings.email_case_sensitive = True to *not *get that behavior. Anthony -- Resources: - http://web2py.com - http://web2py.com

[web2py] Re: auth_user change field order

2019-04-08 Thread Anthony
auth.settings.profile_fields = ['prefix_title', 'first_name', 'last_name', ...] Anthony On Monday, April 8, 2019 at 9:38:06 AM UTC-4, lucas wrote: > > hello one and all, > > i'm using web2py 2.17>. > > what is the best method to chang

[web2py] Re: auth_user automatically lowercase all email fields

2019-04-08 Thread Anthony
That's already the default behavior. If you wanted to preserve the case entered by the user, you would do: auth.settings.email_case_sensitive = True Anthony On Monday, April 8, 2019 at 9:40:52 AM UTC-4, lucas wrote: > > hello one and all, > > i'm using web2py 2.17>. &g

[web2py] Re: Validation messages of extra fields in auth_user don't comply with available translations

2019-04-07 Thread Anthony
>> orderby.first >> orderby = orderby | field_id >> return orderby >> >> where I added the 2 prints. >> A field that works correct shows inside2 on the first run and inside3 on >> the second. >> The date field always shows

[web2py] Re: Validation messages of extra fields in auth_user don't comply with available translations

2019-04-07 Thread Anthony
On Saturday, April 6, 2019 at 3:41:50 PM UTC-4, João Matos wrote: > > Thanks Anthony. I will open an issue (I still haven't enough know how to > make a PR). I hope some time in the future. > > I don't want to abuse your help, but I have another issue that is viewable

Re: [web2py] Re: web3py again....

2019-04-07 Thread Anthony
-- if they import a module, there will be a very small performance hit to look up the module in sys.modules on each request (trivial relative to the cost of initializing the module on the very first request), but given web2py's execution model, there is nothing you will do to eliminate that. A

Re: [web2py] Re: web3py again....

2019-04-07 Thread Anthony
On Sunday, April 7, 2019 at 1:33:22 PM UTC-4, João Matos wrote: > > @Anthony > > I was asking about reimport not reload. > Does track_changes appy to both? > What do you mean by "reimport"? Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Docume

Re: [web2py] Re: web3py again....

2019-04-07 Thread Anthony
above, they are only reloaded if they have changed. Anthony -- 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 sub

[web2py] Re: Custom validator broken in 2.18.4, working in 2.17.2

2019-04-06 Thread Anthony
The book should be update, but we should also decide if we're OK breaking backward compatibility in this way. Anthony On Saturday, April 6, 2019 at 3:06:20 PM UTC-4, David Manns wrote: > > Changed my import to: > > from pydal.validators import Validator, Validati

[web2py] Re: Validation messages of extra fields in auth_user don't comply with available translations

2019-04-06 Thread Anthony
ot be moved from the __init__ method to the validate method in these range validators, which would push the translation to validation time, as with all the other validators. So, feel free to submit an issue about this in the pydal repo and refer to this post (or better yet, make a pull request). An

[web2py] Re: Validation messages of extra fields in auth_user don't comply with available translations

2019-04-06 Thread Anthony
fields. The > extra_fields validation messages show up with the correct language. > > Do you still want me to send you the minimal app? > > > sábado, 6 de Abril de 2019 às 17:01:24 UTC+1, Anthony escreveu: >> >> Can you post a minimal app the reproduces the problem? >>

[web2py] Re: Validation messages of extra fields in auth_user don't comply with available translations

2019-04-06 Thread Anthony
force('pt') before the extra_fields and > so all my validation messages appeared correctly in PT or EN, except for > the validation messages of the extra_fields (they always appeared in EN). > If I add the T.force('pt') before adding the extra_fields, all my > val

[web2py] Re: Validation messages of extra fields in auth_user don't comply with available translations

2019-04-05 Thread Anthony
What do you mean by "change the language to English" there? Setting T.force('pt') should force all translations to Portuguese unless you override the T.force('pt'). Finally, are you running/sending requests to more than one application, not all of which have the same tra

[web2py] Re: Custom validator broken in 2.18.4, working in 2.17.2

2019-04-05 Thread Anthony
Though that breaks backward compatibility, as the interface for custom validators is provided in the official documentation. On Friday, April 5, 2019 at 2:07:22 PM UTC-4, Leonel Câmara wrote: > > The way validators are in 2.18.4 you need to do it like this: > > > class IS_MEMBERSHIP_YEAR_END(Vali

[web2py] Re: Validation messages of extra fields in auth_user don't comply with available translations

2019-04-05 Thread Anthony
compatibility (particularly given that all Auth error messages are still being translated automatically). Anthony On Thursday, April 4, 2019 at 3:25:10 PM UTC-4, João Matos wrote: > > When creating extra fields for auth_user, the validation messages for > those fields are always in Engl

Re: [web2py] Re: Error Ticket Includes Sensitive Information

2019-04-04 Thread Anthony
s can never see error tickets. The problem is writing sensitive information to the server storage. Anthony -- 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) --

[web2py] Re: How can I block logins from users with is_active == False?

2019-04-03 Thread Anthony
ly not active (as opposed to users who are not in the system at all), then your approach is probably best. Anthony On Tuesday, April 2, 2019 at 8:52:20 PM UTC-4, João Matos wrote: > > Found a solution > > def check_if_user_is_active(form): > """Check if user i

[web2py] Re: Is it possible to show the results from a SELECT (made with SQLite using db.executesql) in a grid?

2019-04-02 Thread Anthony
Note, you do not need to set fake_migrate, as long as migrate=False (the DAL will simply ignore migrations for that table). On Tuesday, April 2, 2019 at 1:43:41 AM UTC-4, Val K wrote: > > Create view in sqlite "CREATE VIEW your_tbl_name AS SELECT ..." using > executesql and define corresponding

Re: [web2py] Re: How to add a read-only field to a SQLFORM.factory

2019-03-30 Thread Anthony
inish', > 'date', > label=T('Estimated finish'), > notnull=True, > required=True, > requires=IS_DATE_IN_RANGE( # format=T('%Y-%m-%d'), >

Re: [web2py] Re: How to add a read-only field to a SQLFORM.factory

2019-03-30 Thread Anthony
0 de Março de 2019 às 18:27:11 UTC, Anthony escreveu: >> >> I don't see any advantage in using the fields parameter because the >>> change I found >>> form.element('#no_table_sn')['_readonly'] = 'readonly' >>> and the sugge

Re: [web2py] Re: How to add a read-only field to a SQLFORM.factory

2019-03-30 Thread Anthony
adonly attribute of the input widget and setting writable=False in the Field() definition do two different things. The former makes the input element read-only in the UI but is less secure because it does not prevent writes on the server. The latter does not use an input element to display the data in

Re: [web2py] Re: How to add a read-only field to a SQLFORM.factory

2019-03-29 Thread Anthony
to the Field, but didn't work. > > Only works after the form exists. > Field('sn', widget=lambda f, v: SQLFORM.widgets.string.widget(f, v, _readonly=True)) > Is there a better way? > As noted earlier, you can use the "fields" argument. Anthony -- Resources:

[web2py] Re: How to add a read-only field to a SQLFORM.factory

2019-03-29 Thread Anthony
On Friday, March 29, 2019 at 5:04:41 PM UTC-4, João Matos wrote: > > @Anthony > This is a SQLFORM.factory not a SQLFORM. > There is no database. > Are you sure fields parameter is applicable to SQLFORM.factory w/o a db? > Yes, it does work with SQLFORM.factory. >

[web2py] Re: placeholder for update record field names

2019-03-29 Thread Anthony
You can create a dictionary of field names and values and then do: workrecord.update_record(**dict_of_new_values) Anthony On Friday, March 29, 2019 at 4:49:28 PM UTC-4, Steve wrote: > > Hi All, > > When updating a record i would like to make some column names variable. >

[web2py] Re: How to add a read-only field to a SQLFORM.factory

2019-03-29 Thread Anthony
By default, non-writable fields are excluded from create forms (though shown in edit forms if readable=True). However, you can override that behavior by specifying the "fields" argument with a list of field names to include in the form. Anthony On Friday, March 29, 2019 at 4:32:2

[web2py] Re: Is there a way to differentiate between a form refresh (F5) and a submit that calls back the form?

2019-03-28 Thread Anthony
orm.record rather than unnecessarily re-selecting the record via db.client(request.vars.id)? Anthony -- 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) --- Y

[web2py] Re: Is there a way to differentiate between a form refresh (F5) and a submit that calls back the form?

2019-03-27 Thread Anthony
redirect(URL(args=request.args, vars=request.get_vars)) That will redirect to the same URL, which will load the same record (with the updated data), and show the message after redirect. Anthony On Wednesday, March 27, 2019 at 3:06:16 PM UTC-4, João Matos wrote: > > This is my code fo

  1   2   3   4   5   6   7   8   9   10   >