Re: [web2py] Re: Sum/Total of the column values in SQLFROM.grid?

2018-07-26 Thread Anthony
On Thursday, July 26, 2018 at 7:39:05 AM UTC-4, sandeep patel wrote: > > @Anthony, This gives me an error.becouse of some values float type in the > field. > > ('float' object is not iterable) > How can I successfully sum all the values within this solution? > Please

Re: [web2py] Re: Sum/Total of the column values in SQLFROM.grid?

2018-07-26 Thread Anthony
into the web2py process: bag_sum = db.mytable.number_of_bags.sum() b = db().select(bag_sum).first()[bag_sum] See http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#sum--avg--min--max-and-len. Anthony -- Resources: - http://web2py.com - http://web2py.com/boo

[web2py] Re: Scheduler migrate=True doesn't recreate tables

2018-07-25 Thread Anthony
nt web2py to re-create it, you also have to delete the associated *.table file from the application's /databases folder. That file stores metadata about migrations, and its presence makes web2py think the table has already been created. Anthony -- Resources: - http://web2py.com - http://

[web2py] Re: Sum/Total of the column values in SQLFROM.grid?

2018-07-25 Thread Anthony
On Wednesday, July 25, 2018 at 5:41:26 PM UTC-4, Anthony wrote: > > On Wednesday, July 25, 2018 at 3:49:09 PM UTC-4, pbreit wrote: >> >> How about JavaScript? >> >> >> https://www.oreilly.com/library/view/javascript-cookbook/9781449390211/ch04s07.html >

[web2py] Re: Sum/Total of the column values in SQLFROM.grid?

2018-07-25 Thread Anthony
from the database into the Python environment, nor then send it all to the browser -- just let the database do the calculations directly and send only the result to the browser. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (So

[web2py] Re: Dealing with reserved keywords when you change or upgrade your database from SQLite to POSTGRES

2018-07-25 Thread Anthony
On Wednesday, July 25, 2018 at 3:36:58 PM UTC-4, pbreit wrote: > > ...or Anthony! > > Thanks, that's good info and reassuring. > > Safe to assume little/no downside to always double-quoting? > It's the default behavior of web2py now, so hopefully not. -- Resources: - htt

[web2py] Re: Scheduler migrate=True doesn't recreate tables

2018-07-25 Thread Anthony
On Wednesday, July 25, 2018 at 1:33:24 PM UTC-4, Ur. Kr. wrote: > > > scheduler = Scheduler(db, migrate=True) > This doesn't recreate tables for me when I rerun the scheduler and the > application. > Have the tables already been created once? If so, they will not be re-created. What are you

[web2py] Re: Dealing with reserved keywords when you change or upgrade your database from SQLite to POSTGRES

2018-07-25 Thread Anthony
See also https://groups.google.com/d/msg/web2py/lPcl3CrfnDs/J0zqHf8DAwAJ. On Wednesday, July 25, 2018 at 2:23:58 PM UTC-4, Anthony wrote: > > On Wednesday, July 25, 2018 at 1:54:56 PM UTC-4, pbreit wrote: >> >> I feel like I've heard before that we no longer need to worry about

[web2py] Re: Dealing with reserved keywords when you change or upgrade your database from SQLite to POSTGRES

2018-07-25 Thread Anthony
ere <https://github.com/web2py/pydal/blob/master/pydal/adapters/__init__.py#L36-L48> . 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: Dealing with reserved keywords when you change or upgrade your database from SQLite to POSTGRES

2018-07-25 Thread Anthony
On Wednesday, July 25, 2018 at 8:51:26 AM UTC-4, Rahul wrote: > > Hi Anthony, pbreit, >The following line of code works just fine for *rname*. I was able > to save *state*, *date*, *module*, *notify *etc in the database table as > field names. Although I will make it a

[web2py] Re: SQLFORM widget IS_IN_SET translation

2018-07-25 Thread Anthony
(value)) for value in values]) # Using the "labels" argument. IS_IN_SET(values, labels=[T(value) for value in values]) Anthony On Wednesday, July 25, 2018 at 12:40:12 AM UTC-4, rāma wrote: > > > I could do this in SQLFORM readonly mode: > > https://groups.google

[web2py] Re: Dealing with reserved keywords when you change or upgrade your database from SQLite to POSTGRES

2018-07-24 Thread Anthony
I believe the DAL now always double quotes table and field names when constructing queries, so I'm not sure you even need to use check_reserved anymore. What happens if you simply remove it? Anthony On Tuesday, July 24, 2018 at 4:39:05 PM UTC-4, pbreit wrote: > > Apparently if you are

[web2py] Re: Issues getting web2py to work.

2018-07-24 Thread Anthony
You'll need to run web2py with Python 2.7 (the specific issue below is that the DAL code includes a dictionary comprehension, which is only supported in Python 2.7+). Anthony On Tuesday, July 24, 2018 at 4:03:13 PM UTC-4, Ben Duncan wrote: > > Redhack 6.9 > Python 2.6.6 > > I

[web2py] Re: Sum/Total of the column values in SQLFROM.grid?

2018-07-24 Thread Anthony
You should do a separate query and have the database calculate the sum for you (rather than loading all the records from the database and doing the calculation in Python). Anthony On Tuesday, July 24, 2018 at 3:08:12 PM UTC-4, sandeep patel wrote: > > Hello, > I have a grid that is wo

Re: [web2py] Re: Updated script for 'Moving your data from one database to another' recipe

2018-07-23 Thread Anthony
efine_table(table._tablename, *[field for field in table > ] ) > Note, that script is outdated. You should be able to handle the table definitions via the auto_import option. See: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Using-DAL-without-define-tables Anthony

Re: [web2py] Deleting a db table row

2018-07-22 Thread Anthony
oks/default/chapter/29/06/the-database-abstraction-layer#belongs. 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 me

[web2py] Re: Updated script for 'Moving your data from one database to another' recipe

2018-07-21 Thread Anthony
er let you simply re-use an existing field in other tables -- you must instead clone it. Anthony On Saturday, July 21, 2018 at 6:26:33 PM UTC-4, Gualter Portella wrote: > > Hi everyone, > > I've been trying to move my sqlite database to a nysql database for > production. > &

[web2py] Re: Modules Import Problem.

2018-07-20 Thread Anthony
On Friday, July 20, 2018 at 5:39:56 PM UTC-4, Dave S wrote: > > > > On Friday, July 20, 2018 at 8:49:26 AM UTC-7, Anthony wrote: >> >> local_import was deprecated several years ago (I don't think it's even >> mentioned in the book any more). Just use regular impor

[web2py] Re: Modules Import Problem.

2018-07-20 Thread Anthony
the same name as another in system (this isn't a problem at the top level of /modules, but can cause problems when there are submodules). Anthony On Friday, July 20, 2018 at 7:55:20 AM UTC-4, Scott ODonnell wrote: > > I have an API Wrapper library I'm trying to use in my Web2PY p

[web2py] Re: row.update_record() leaves row as None (only sometimes)

2018-07-19 Thread Anthony
eld is explicitly excluded from being updated either in the database or in the Row object itself. 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: web2py internal error

2018-07-19 Thread Anthony
Googling that error message, it looks like it could have something to do with concurrency and the .pyc file for the module. Maybe confirm the module isn't corrupted, and remove its .pyc file. Anthony On Thursday, July 19, 2018 at 2:04:00 AM UTC-4, Dave S wrote: > > > > On Monday, J

Re: [web2py] Re: OperationalError when using datetime

2018-07-19 Thread Anthony
t;) > elif form.errors: > return TABLE(*[TR(k, v) for k, v in form.errors.items()]) > return dict() > In all cases, you code will return an empty dict. If there is no associated view, you will get an error unless generic views have been enabled, in which case, you will

[web2py] Re: row.update_record() leaves row as None (only sometimes)

2018-07-19 Thread Anthony
between the execution of the first and second lines above. Is that possible (i.e., is there some other action that could be deleting existing records)? Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.goo

[web2py] Re: Why not to mention support to Python3 on the official sites main page?

2018-07-18 Thread Anthony
> > Do you have tested python3? > Note, we do have passing tests, at least through Python 3.6: https://travis-ci.org/web2py/web2py -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Why not to mention support to Python3 on the official sites main page?

2018-07-18 Thread Anthony
> > I can testify that perfomance improoves a lot. Whats lacking for official > support announcement? > I believe support is official -- we just need to make the updates to the site and documentation. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: OperationalError when using datetime

2018-07-18 Thread Anthony
to get a given record right after it was inserted, this approach could lead to a race condition, as another record could be inserted before you do the read. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://co

[web2py] Re: BaseException: domain not in config []

2018-07-18 Thread Anthony
You're view has this line: if host_name in myconf.take('domain.name'): But as the traceback indicated, there is no "domain" section in the configuration file. Anthony On Wednesday, July 18, 2018 at 6:08:14 PM UTC-4, Valdeck Rowe wrote: > > Here is the entire user.html f

[web2py] BaseException: domain not in config []

2018-07-18 Thread Anthony
We need to see your appconfig.ini and the line in user.html that is presumably trying to access a setting from the config object. The error indicates it's not finding what it's looking for. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: empty field saved as NULL or ' '

2018-07-18 Thread Anthony
To add some detail, when values are passed to validators, the validator returns a tuple like (value, None) or (value, 'error message'), and the returned value can potentially be transformed by the validator (as in this case). Anthony On Wednesday, July 18, 2018 at 9:51:40 AM UTC-4, Leonel

[web2py] Re: Why not to mention support to Python3 on the official sites main page?

2018-07-17 Thread Anthony
bsite, which is the "examples" app in the Github repo) and https://github.com/web2py/web2py-book (for the book -- there are mentions of Python 2.7 in each of the first three chapters). Anthony On Monday, July 16, 2018 at 8:55:01 AM UTC-4, Ari Lion BR Sp wrote: > > Hi, > >

[web2py] Re: web2py internal error

2018-07-16 Thread Anthony
et ... . > > Anyone experience with this one? > When you click on the ticket link and then log into the admin app, what happens next? You can copy on of the error ticket files from your server (in the /errors folder) to a development machine and view it in admin on the de

[web2py] Re: cant get content of uploaded image file in post srervice

2018-07-16 Thread Anthony
It should be a cgi.FieldStorage object, so try request.vars.my_image.file to access the file object itself. Anthony On Monday, July 16, 2018 at 3:18:44 PM UTC-4, mr.p...@gmail.com wrote: > > I need to upload an image in a post REST service > and process the uploaded image for further p

[web2py] Re: Beginning noob - link issue

2018-07-16 Thread Anthony
No, looks like something is broken. On Monday, July 16, 2018 at 3:18:44 PM UTC-4, ju...@us.ibm.com wrote: > > This page has a link to try out web2py > http://web2py.com/init/default/what at this location > http://www.web2py.com/demo_admin which throws this error: > Internal error Ticket

[web2py] Re: SYTLING

2018-07-16 Thread Anthony
Please read http://web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-forms and http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-in-HTML and come back with specific questions as you proceed. Anthony On Monday, July 16, 2018 at 10:50:01 AM UTC-4

Re: [web2py] Re: auth tables rname

2018-07-16 Thread Anthony
In that case, you'll need to create custom definitions, in which case, just specify the appropriate "rname" attributes in the custom definition. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://c

[web2py] Re: auth tables rname

2018-07-13 Thread Anthony
You can try: db.auth_user._rname = ... db.auth_user.first_name._rname = ... Or you can code custom table definitions, as described here: http://web2py.com/books/default/chapter/29/09/access-control#Customizing-Auth Anthony On Friday, July 13, 2018 at 3:36:51 PM UTC-4, fiubarc wrote

[web2py] Re: Fixing an issue from GitHub #1929

2018-07-13 Thread Anthony
quot;jQuery('#%s').slideUp()" % panel_id) > > Yes, looks like that needs to be updated as well. Feel free to submit a pull request. so its not clear to me if all references should be made to both classes > I think the btn-default class is left in case someone is using Bootstra

[web2py] Re: Fixing an issue from GitHub #1929

2018-07-13 Thread Anthony
I believe this is fixed in master, so you could try cloning master directly from Github. Anthony On Friday, July 13, 2018 at 6:25:16 AM UTC-4, Stelios Koroneos wrote: > > Greetings to all. > As i was working with grid i stumbled upon the same issue mention in 1929 > > https://gi

[web2py] Re: Syntax Error "unknown app...."

2018-07-12 Thread Anthony
denly disappearing applications). 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 to the Goog

[web2py] Re: Payment integration documentation needs update

2018-07-11 Thread Anthony
Feel free to make a pull request to update the docs: https://github.com/web2py/web2py-book Anthony On Wednesday, July 11, 2018 at 10:32:42 AM UTC-4, Peter Woolf wrote: > > Hello, > > I'm exploring ways to integrate a payment option into a web2py application > an

[web2py] Re: Syntax Error "unknown app...."

2018-07-11 Thread Anthony
py is only executed once upon startup. Anthony On Wednesday, July 11, 2018 at 9:47:30 AM UTC-4, fiubarc wrote: > > Hello, i need help with this behavior > > Steps to reproduce: > > 1) routes.py > > domains = { "app1.com" : "app1", "app2.com" : &

[web2py] Re: Share database connection between modules

2018-07-11 Thread Anthony
ave to call db.commit(), and if the HTTP request ultimately results in an error, web2py will also automatically call db.rollback()). Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2p

Re: [web2py] Re: Form input not working.

2018-07-07 Thread Anthony
, the submitted form values will be available in request.vars -- from there, you can do whatever you want with the data. Anthony On Saturday, July 7, 2018 at 6:02:55 PM UTC-4, Maurice Waka wrote: > > Hi. > I'll need your help. Am still stuck at this. I note that only when I > refr

Re: [web2py] Re: Form input not working.

2018-07-06 Thread Anthony
to make sure the hidden formname and formkey fields are included. Please read the documentation. 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: Form input not working.

2018-07-06 Thread Anthony
/07/forms-and-validators#Custom-forms and http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-in-HTML for creating custom HTML in conjunction with SQLFORM. Anthony On Friday, July 6, 2018 at 10:49:28 AM UTC-4, Maurice Waka wrote: > > Hi. > Am trying out this ht

[web2py] Re: Here's how to run Web2Py on IBM BlueMix

2018-07-06 Thread Anthony
documentation nor get technical support, you might need to consider an alternative hosting option. 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: Here's how to run Web2Py on IBM BlueMix

2018-07-04 Thread Anthony
Not sure if this is the only problem, but in run.sh, the call to web2py.py in the "else" block does not specify an ip address, so it will default to 127.0.0.1, which will run the server on localhost only. You should instead specify "-i 0.0.0.0". Anthony On Wednesday, July

[web2py] Re: cannot make ondelete='SET NULL' to work

2018-07-04 Thread Anthony
ad of seting empty on the refered field. > I think this is one of the things that cannot be changed, so if you started with the default "CASCADE" behavior, you may need to drop the table and create a new one with "SET NULL" specified from the beginning. Anthony -- Resources: - h

[web2py] Re: custom maxlengths on create/edit grid

2018-07-04 Thread Anthony
class" attribute. Another option is to specify a custom widget for the field in question, either when the db table is defined or later: Field('cantidad', widget=lambda f, v: SQLFORM.widgets.string.widget(f, v, _class='col-sm-3', _maxlength=8)) Anthony On Wednesday, July 4, 2018 at 6:31:50 AM UTC-

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

2018-07-02 Thread Anthony
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 UTC-4, Diego Tostes wrote: > > Hi, > > i have this table: > > def tempo_total_produto(produto_id): > try: >

[web2py] Re: Write dynamic query in DAL without extra nested parentheses

2018-06-28 Thread Anthony
bjects.Query / Set ? > I'm trying query = db(query) , and get a pydal.objects.Set , but can't > use it , query.select() rise errors > You need some way to tell the DAL what table is involved. So, either: db((db.product.id > 0) & query).select() or: db(query).select(db.product.ALL)

Re: [web2py] Re: customize requires in DB

2018-06-27 Thread Anthony
> I believe that should work. Is it not doing what you expect? Note, that will result in two additional database selects for each record in ordem_servico. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.

Re: [web2py]: Empty dropdown value

2018-06-27 Thread Anthony
lue False if it is selected. 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 to the Google Groups

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

2018-06-26 Thread Anthony
irst table encountered in the query will be the target of any create/update/delete operations. However, you can specify field_id=db.pedido.id to ensure the pedido table is the target of CRUD operations. Anthony On Tuesday, June 26, 2018 at 7:56:18 PM UTC-4, Diego Tostes wrote: > > HI,

[web2py] Why these functions don't work in web2py

2018-06-26 Thread Anthony
Note, Idle is not giving you a return value - the function is simply printing the output, which Idle displays. Of you want a return value, you must return something. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Re: Using Scheduler without "dict" to define functions

2018-06-26 Thread Anthony
defined in the same model > page as the scheduler, all I get from the scheduler is "NameError: name > 'x' not found in scheduler's environment" even though I specifically > test to make sure it is visible when invoking web2py -M -S > app/controller/x > Again,

Re: [web2py] Re: How to handle routing

2018-06-25 Thread Anthony
You could also use routes.py to remove the app name in development. Anthony On Monday, June 25, 2018 at 8:27:29 PM UTC-4, marco mansilla wrote: > > Thanks Dave, I'll try ASAP. > > El lun., 25 de jun. de 2018 21:25, Dave S > escribió: > >> >> >> On Monda

[web2py] Re: list:reference and SQLFORM.grid

2018-06-25 Thread Anthony
c methods to see how the built-in widget and query generator work. Anthony On Monday, June 25, 2018 at 9:02:19 AM UTC-4, Paulo wrote: > > I have the exact same question and can't find an easy solution in the web > :/ > > Fields of the type list:reference with multiple choice

[web2py] Re: dependencies inside 'static' folder

2018-06-23 Thread Anthony
he file in /static/img, you can still use a relative URL: cfg.pieceTheme = '../img/chesspieces/wikipedia/{piece}.png <http://127.0.0.1:8000/tablero/static/img/chesspieces/wikipedia/%7Bpiece%7D.png> '; The ../ will traverse from the /js folder up one level to the /static folder. Antho

[web2py] Re: Problem with python 2.6 and running web2py

2018-06-23 Thread Anthony
> > The only walkaround I can imagine is to downgrade web2py to a release > compatible with python 2.6. > You could try web2py 2.14.6. If it's a relatively low traffic site, you might consider using the web2py built-in server. Anthony -- Resources: - http://web2py.com - http:

[web2py] Re: Problem with python 2.6 and running web2py

2018-06-23 Thread Anthony
web2py no longer supports Python 2.6 (the website should be updated to reflect this). The line in question includes a dictionary comprehension, which was introduced in Python 2.7. Anthony On Saturday, June 23, 2018 at 10:34:45 AM UTC-4, Girolamo Giudice wrote: > > Dear all, > I a

Re: [web2py] Required field label

2018-06-22 Thread Anthony
s? > The best approach is to add an HTML class to the label and use a CSS rule. 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 rece

Re: [web2py] Re: user request_reset_password doesn't send mail

2018-06-22 Thread Anthony
he onaccept callback. It would help if you could describe the exact workflow and what is happening. Try to do some debugging to figure out what code is being run (e.g., does auth.request_reset_password get called at all?). Anthony -- Resources: - http://web2py.com - http://web2py.com/book (

[web2py] Re: customize requires in DB

2018-06-20 Thread Anthony
b2py 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 those tables: > > *Produto = db.define_table('produto',* > *Field('ficha_tecnica', 'upload', label=T("Ficha Tecnica")),*

[web2py] Re: save the original value of one field in another table field

2018-06-20 Thread Anthony
On Wednesday, June 20, 2018 at 9:16:04 AM UTC-4, Ayron Rangel wrote: > > Anthony, > > What I want would be to insert the same value(integer) from one Field to > another Field on other table. > Ex.: > > db.define_table('product', > Field('name', 'string'),

[web2py] Re: password reset does not redirect to correct page

2018-06-20 Thread Anthony
auth.settings.reset_password_next Anthony On Monday, June 4, 2018 at 8:32:27 AM UTC-4, Yebach wrote: > > Hello > > After the password reset link is received in my mail and I follow the link > to MyApp > i/default/user/reset_password/1528115334-1104060c-6c13-4715-a153-d19

Re: [web2py] Re: user request_reset_password doesn't send mail

2018-06-20 Thread Anthony
Describe the exact workflow and exactly what you observe. Check db.auth_event to see if anything is logged. You can also add onvalidation and onaccept callbacks to see if they are getting executed. Anthony On Friday, June 1, 2018 at 12:54:40 AM UTC-4, Yebach wrote: > > It send

[web2py] Re: save the original value of one field in another table field

2018-06-19 Thread Anthony
This is generally not good database design. What are you really trying to do? Would it make more sense for mytable2 to reference mytable? Anthony On Tuesday, June 19, 2018 at 9:09:42 PM UTC-4, Ayron Rangel wrote: > > How can i save the value of one field in another table

[web2py] Re: managing latin characters

2018-06-19 Thread Anthony
re: [IS_MATCH('[\w\.\-]+', strict=True, error_message=self.messages.invalid_username), IS_NOT_IN_DB(db, '%s.username' % settings.table_user_name, error_message=self.messages.username_taken)] You could replace the IS_MATCH with a custom validator that accepts unicode characters, or just remove IS_MATCH al

[web2py] Re: field username in auth_user

2018-06-19 Thread Anthony
By default it must match the following regular expression: '[\w\.\-]+' So, no spaces. I suppose you could override the default validator and allow spaces, but I'm not sure if that has any consequences for uses of the username elsewhere in the Auth system. Anthony On Tuesday, June 19, 2018

[web2py] Re: Clarification please on autocomplete widget...

2018-06-19 Thread Anthony
It sounds like you want the reference field version of autocomplete. What is your exact model code and the widget code you tried? Anthony On Tuesday, June 19, 2018 at 11:24:07 AM UTC-4, jim kaubisch wrote: > > Thanks, Anthony. > > because there may be MANY values in the field,

[web2py] Re: Clarification please on autocomplete widget...

2018-06-19 Thread Anthony
lues from an alternative field). Anthony On Monday, June 18, 2018 at 11:59:27 PM UTC-4, jim kaubisch wrote: > > What am I misunderstanding... ?? > > Building a form with fields that really need to be autocompleted > (potentially 1,000+ possible values). > > Looked at the boo

[web2py] Re: CHANGE THE LOGIN FLASH MESSAGE

2018-06-18 Thread Anthony
, you could explicitly set: session.flash = 'Welcome %s' % auth.user.username Anthony On Monday, June 18, 2018 at 9:48:04 AM UTC-4, Ayron Rangel wrote: > > Guys, > > How do I change the response.flash message when I log in? > > Every time when I'm login, appears just "Logge

Re: [web2py] Is it possible to translate data in SQLFORM.grid?

2018-06-18 Thread Anthony
On Monday, June 18, 2018 at 7:50:23 AM UTC-4, Bruno Duarte Ramos wrote: > > Hi Anthony, actually I just want to translate the form on my view, like my > view was {{=T(form)}}. > Yes, but what exactly do you want translated in the form? Do you want the actual data values trans

Re: [web2py] Re: how do i import a module in my controller?

2018-06-18 Thread Anthony
o not use your system-installed version of Python) and (b) make sure you start web2py using Python 3 (i.e., if you have both Python 2 and Python 3 installed, be sure to explicitly use Python 3). Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.c

Re: [web2py] Re: how do i import a module in my controller?

2018-06-18 Thread Anthony
typically used directly but is the foundation of urllib? Consider urllib, urllib2, or the third-party Requests library. As for using Python 3 with web2py, you just have to install Python 3 (and of course make sure your app code is compatible with Python 3). Anthony -- Resources: - http://web2py.c

[web2py] Re: how do i import a module in my controller?

2018-06-18 Thread Anthony
Are you using Python 2 or Python 3? What does your import statement look like? Anthony On Monday, June 18, 2018 at 3:41:07 AM UTC-4, elisha bere wrote: > > i want to import http.client and it it giving me an error 'exceptions.ImportError'> (ImportError("Cannot

[web2py] Re: SQLFORM.grid Add multiple items in links

2018-06-16 Thread Anthony
t;body" item of the dictionary must be a callable that takes the row object and outputs a web2py string or web2py HTML DOM element. It cannot be a list of functions. If you want to generate a set of links, generate them all in a single function and wrap them in CAT() or DIV() (or whatever wor

[web2py] Re: SQLFORM.grid Add multiple items in links

2018-06-16 Thread Anthony
ur grid. > > Then, the second dict shouldn't be a dict at all, links should just be a > list of your lambdas, like you have in the 'body' of the second dict. > Note, links can include dictionaries -- any link that is a dict will be put in its own column rather than being added as a

[web2py] Re: Other login methods

2018-06-16 Thread Anthony
Seems like a problem with the provider. On Saturday, June 16, 2018 at 8:09:15 AM UTC-4, 黄祥 wrote: > > $ python > Python 2.7.15 |Anaconda, Inc.| > >>> import smtplib > >>> smtplib.SMTP('mail.stifix.com', 25) > Traceback (most recent call last): > File "", line 1, in > File >

[web2py] Re: Other login methods

2018-06-16 Thread Anthony
It's failing at smtplib.SMTP(host, port), so maybe try that directly in a Python shell to confirm you get the same error there. Anthony On Friday, June 15, 2018 at 9:39:56 PM UTC-4, 黄祥 wrote: > > ldap_auth() issue done at : https://github.com/web2py/web2py/issues/1955 > for email_auth

[web2py] Re: Other login methods

2018-06-15 Thread Anthony
east reject the login. Feel free to open a Github issue about this. 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

Re: [web2py] Is it possible to translate data in SQLFORM.grid?

2018-06-15 Thread Anthony
the stored values of an existing record to be translated before inserting them in an update form? If you did that, when the form is submitted, the translated values would be stored rather than the original ones. What exactly are you trying to achieve? Anthony > -- Resources: - http://web2py.com - htt

[web2py] Re: return binary

2018-06-15 Thread Anthony
On Thursday, June 14, 2018 at 11:17:56 PM UTC-4, 黄祥 wrote: > > submit on this : > https://github.com/web2py/web2py/issues > Actually, this would be a pydal issue: https://github.com/web2py/pydal/issues Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documenta

[web2py] Re: Other login methods

2018-06-15 Thread Anthony
fake data (just for testing) > Both of the errors in your last post were due to the use of dummy parameters. If you are having problems with real parameters, please show the results. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web

[web2py] Re: Other login methods

2018-06-14 Thread Anthony
Are you planning to actually use any of these methods? If so, I would suggest setting them up properly with real authentication services, and only then report back if you are receiving errors. They are not necessarily supposed to work as expected with dummy inputs. Anthony On Thursday, June

[web2py] Re: Other login methods

2018-06-14 Thread Anthony
h.login_bare thinks the login was successful). 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 subscribe

[web2py] Re: Other login methods

2018-06-14 Thread Anthony
uth -- the .append() has no effect, and the last line should be a call to pam_auth: auth.settings.login_methods = [pam_auth()] Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/is

[web2py] Re: Other login methods

2018-06-14 Thread Anthony
ntless, as the next line completely overwrites auth.settings.login_methods. Second, in the final line, basic_auth is the function imported from the module, but should instead be a call to that function: auth.settings.login_methods = [basic_auth('https://one.one.com')] Anthony -- Resources: -

[web2py] Re: Other login methods

2018-06-14 Thread Anthony
account. The book should be corrected. 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 to th

[web2py] Re: Other login methods

2018-06-14 Thread Anthony
gt; auth.settings.login_methods = [GaeGoogleAccount] > > It should be gluon.contrib.login_methods.gae_google_account. The book should be updated. Anthony -- 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 do list: reference and list: interger work together

2018-06-14 Thread Anthony
ems from two different list fields, so you'll have to build your own custom input widget. You might also consider storing the product/quantity pairs as records in a separate table (though you would still need to figure out the user input workflow). Anthony -- Resources: - http://web2py.com - http://

[web2py] Re: IS_IN_DB and SQLFORM edition

2018-06-13 Thread Anthony
Please show you code and an example record. Is the existing value of product_id one that is no longer in the product.ref field? Anthony On Wednesday, June 13, 2018 at 5:35:37 PM UTC-4, Diego Tostes wrote: > > Hi, > > > i have a table and i am using: > > Show_Room.product_i

[web2py] Re: IS_IN_DB with 2 tables

2018-06-13 Thread Anthony
ternative is to retrieve the data you need for the validator/widget via a SQL join, and then use an IS_IN_SET validator with a manually generated set of items. Also, note that r.ID_Produto.ProdutoDescricao is roughly equivalent to db.Produto(r.ID_Produto).ProdutoDescricao. Anthony -- Resource

[web2py] Re: Is the web2py application upgrade or is it out of service?

2018-06-13 Thread Anthony
If you are asking whether web2py is still under active development, the answer is yes. Anthony On Wednesday, June 13, 2018 at 12:02:22 PM UTC-4, Mohammad Rostami wrote: > > Hello. > I am Mohammad from Iran. > > I became interested in web2py and I want to learn it com

[web2py] Re: Different values than expected in web2py.

2018-06-13 Thread Anthony
Please show your code and explain exactly how you are running it via spyder and web2py, as well as the Python versions you are using. Anthony On Wednesday, June 13, 2018 at 12:02:54 PM UTC-4, sai kanthu wrote: > > I have a python code which got executed through the spyder IDE. But, when

Re: [web2py] web2py with python3

2018-06-12 Thread Anthony
b2py.py' to run this booster > file. What would you recommend next move from my current situation. Thank > you! > To run web2py under Python 3 you must use the source version of web2py with your own Python 3 installation. The binary distribution of web2py comes with Python 2 only. Anthon

[web2py] Re: I have a file 'you.html' in static, how do I open it in my web2py app?

2018-06-12 Thread Anthony
hforward way to do so. Just do a redirect from the controller (though its not clear why you would create a controller whose sole purpose is to redirect to a static file). Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

Re: [web2py] Re: Improve HTML page load

2018-06-12 Thread Anthony
On Monday, June 11, 2018 at 10:58:01 PM UTC-4, Maurice Waka wrote: > > Selecting the last item in q or a ends up with: > > That is the Python representation of an entire Row object. Probably you want to get just a single field from within it. Anthony -- Resources: - http://web2p

[web2py] Re: "unarchive" a record?

2018-06-12 Thread Anthony
> > current.update_record(name=version.name, description=version.description) > > And note, if you have a lot of fields to update, the above can be simplified to: current.update_record(**db.record._filter_fields(version)) Anthony -- Resources: - http://web2py.com - http://web

<    1   2   3   4   5   6   7   8   9   10   >