[web2py] Re: Setting a header

2017-11-02 Thread Anthony
On Thursday, November 2, 2017 at 12:19:14 AM UTC-4, Dave S wrote: > > > > On Wednesday, November 1, 2017 at 7:15:11 PM UTC-7, Anthony wrote: >> >> It's response.headers. >> > > Indeed, but that isn't a sufficient correction. > > /dps > > >> &

[web2py] Re: Data Representation SQLFORM.factory /linked tables

2017-11-01 Thread Anthony
must specify the "represent" attribute of the field. The IS_IN_DB validator is used to generate a select widget in forms, so the "label" argument you specified in that validator controls that values shown in the select widget, but that has no effect on the representation in grids

[web2py] Re: Setting a header

2017-11-01 Thread Anthony
It's response.headers. Anthony On Wednesday, November 1, 2017 at 1:18:07 AM UTC-4, Dave S wrote: > > I wanted to set the refresh on a page according to how often an event is > occurring, and so I tried adding this to my controller function: > > response.header["meta&qu

[web2py] Re: crud.read labels

2017-11-01 Thread Anthony
combination of SQLFORM .process() and .grid(). Anthony On Wednesday, November 1, 2017 at 3:40:15 PM UTC-4, Andrea Fae' wrote: > > Is it possibile to manage crud.read field labels? > Thanks > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://githu

[web2py] Re: How to get rid if the /init/default/ in the URL?

2017-11-01 Thread Anthony
gt; It's possible that there is no routes.py set up for the web2py.com site. 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 m

[web2py] Re: How to get rid if the /init/default/ in the URL?

2017-11-01 Thread Anthony
re? > It should just be the usual folder structure: /web2py/applications/init 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

[web2py] Data Representation SQLFORM.factory /linked tables

2017-10-31 Thread Anthony Smith
. Thanks Anthony I have the following tables: db.define_table('product', Field('product_name'), Field('active_ingredient'), Field('batch_no'), Field('expiry_date','date',default = request.now), Field

[web2py] Re: How to get the last few records except the last record

2017-10-30 Thread Anthony
record via [:-1] gets >> you the records you want, then so does limitby(0, 9) with no slicing, >> regardless of the overall record count. >> >> Anthony >> > > What you say is true, but I took limitby(0,10) to be a specific example, > and that the general cas

Re: [web2py] Re: How to get the last few records except the last record

2017-10-30 Thread Anthony
that stores the update time (or creation time) for each record, you could use orderby=~db.post.id, which generally should sort based on creation time (assuming the IDs in your database are ascending). Anthony On Monday, October 30, 2017 at 2:24:44 PM UTC-4, Maurice Waka wrote: > > I had about 10 r

[web2py] Re: Update last web2py

2017-10-30 Thread Anthony
On Monday, October 30, 2017 at 4:15:04 AM UTC-4, Anatoli Hristov wrote: > > Hi Anthony, > > I have tried both, the stable and to clone the git. > > As I have my own routes, I had to put it in the root folder of web2py, and > then the problem persist. > The trace

[web2py] Re: Update last web2py

2017-10-29 Thread Anthony
is). Anthony On Sunday, October 29, 2017 at 12:48:48 PM UTC-4, Anatoli Hristov wrote: > > Hi, > > I updated to last web2py just now, and now I cannot start my apps. > > root@id1:/home/tol/web2py# python web2py.py -S mypcu -M > Traceback (most recent call last): > F

[web2py] Re: name 'average' is not defined

2017-10-29 Thread Anthony
a recursive select on a DAL record, it will generate an additional database query for every single record. You might be better off with a join to get all the related data in a single query. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py

[web2py] Re: How to get the last few records except the last record

2017-10-28 Thread Anthony
On Friday, October 27, 2017 at 7:37:40 PM UTC-4, Dave S wrote: > > > > On Thursday, October 26, 2017 at 7:26:48 AM UTC-7, Anthony wrote: >> >> There's no need to select the extra record and then drop it via Python. >> Instead you can just change the range of th

Re: [web2py] Re: to be or not to be... run by scheduler

2017-10-28 Thread Anthony
If you can't upgrade, as an alternative, see: https://groups.google.com/d/msg/web2py/JeE6jLP-qjI/MXS0MVdOCQAJ 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 Issu

[web2py] Re: _next-Parameter to become an array during login

2017-10-27 Thread Anthony
including the values from both get_vars and post_vars (which should be the same). So, if you just want _next from the URL query string, you can use request.get_vars._next. But why do you need that -- the auth.login() action already handles redirecting to the _next URL after successful login? Anthony

[web2py] Re: How to get the last few records except the last record

2017-10-26 Thread Anthony
There's no need to select the extra record and then drop it via Python. Instead you can just change the range of the limitby tuple to get exactly the records you want. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Re: New syntax error?

2017-10-25 Thread Anthony
you're using an older version of Python 3 and the message is different in that version). Anthony On Monday, October 23, 2017 at 6:38:27 PM UTC-4, Dave S wrote: > > In my 2.15.x testing, I've been concentrating on the https interface, but > I now tried to do a -M -S that would

Re: [web2py] confirm_registration form 'hardcoded' labels

2017-10-23 Thread Anthony
) by the SQLFORM code. 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] confirm_registration form 'hardcoded' labels

2017-10-23 Thread Anthony
Feel free to open an issue or submit a pull request. Note, looks like the submit button label is hard coded as well. 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

[web2py] Re: How can i change background picture of web2py site

2017-10-23 Thread Anthony
Have you tried doing a force refresh in the browser? On Monday, October 23, 2017 at 11:00:15 AM UTC-4, Dan Carroll wrote: > > It is not that easy. I replace the background.jpg with another image and > the old image replaces my new image. Over and over. Very frustrating. > > > On Wednesday, June

[web2py] Re: LOAD() component redirect destroys session

2017-10-23 Thread Anthony
Hard to say without seeing your code. Nothing about a redirect affects the session, so your code must be making the changes. Anthony On Monday, October 23, 2017 at 10:13:44 AM UTC-4, Auden RovelleQuartz wrote: > > if I am on page_one that has a LOAD() component on it that runs say ever

Re: [web2py] Re: migrating database and updating it

2017-10-23 Thread Anthony
. Anthony On Monday, October 23, 2017 at 6:54:22 AM UTC-4, Yebach wrote: > > Hello > > So as said I copied the whole app directory to my new server, also > restored my database on postgres. > First my settings for migrate and false_migrate are set to False and > immed

[web2py] Re: response view with markdown

2017-10-20 Thread Anthony
or be designed to return actual Markdown content). We could probably create a generic.md view that looks for a named view associated with the current requested function (perhaps with a different extension, such as .markdown), renders that view, and then converts it from Markdown to HTML

[web2py] Re: Bug with URL encoding?

2017-10-20 Thread Anthony
is '([\w@ =-]|(?<=[\w@ -])[.])*$'. Anthony On Thursday, October 19, 2017 at 1:30:09 PM UTC-4, Francisco Ribeiro wrote: > > Hi, > > I have found that when I do request.args(), colons ':' even when properly > URL encoded become an underscore '_' . > > def echo(): &g

[web2py] Re: to be or not to be... run by scheduler

2017-10-20 Thread Anthony
If it is a scheduler execution, request.is_scheduler will be True. Anthony On Friday, October 20, 2017 at 9:09:40 AM UTC-4, Manuele wrote: > > Hi *! > > Is there a way to distinguish from within a function if it's run from > the scheduler or not? > > tha

Re: [web2py] Re: migrating database and updating it

2017-10-18 Thread Anthony
*not* touch the production /databases folder (the *.table files there provide a record of the current state of the production database, so web2py knows what migrations to run to make the database match the new model code). Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documenta

[web2py] Re: Error ticket handling

2017-10-18 Thread Anthony
Scroll down to the "Context" section and click the "Session" button -- if the user was logged in, there should be an "auth" key in the session, which will include the "user" record. Anthony On Wednesday, October 18, 2017 at 10:27:19 AM UTC-4, Ans

[web2py] Re: migrating database and updating it

2017-10-18 Thread Anthony
the proper migrations to make the production database match the new models. Anthony On Wednesday, October 11, 2017 at 7:49:07 AM UTC-4, Yebach wrote: > > Hello > > So based on all the material I have read about migration etc some of the > updates are not working. I will explain

[web2py] Re: How to get rid if the /init/default/ in the URL?

2017-10-15 Thread Anthony
te.com/robots.txt > <http://mysite.com/robots.txt>* > Are you sure you have created /web2py/routes.py as described above and either reloaded the routes via the button in the web2py admin app or reloaded the web app via the PythonAnywhere "Web" tab? Note that routes.py must b

[web2py] Re: How to get rid if the /init/default/ in the URL?

2017-10-15 Thread Anthony
On Friday, October 13, 2017 at 5:12:13 AM UTC-4, Joe wrote: > > Thanks very much Anthony for all your help with this one. I copied the > exact code you posted but nothing changed. > > I wonder if this has to do with having multiple apps in the web2py > directory. > No, t

[web2py] Re: New plugin: Authman

2017-10-15 Thread Anthony
-Management-via-privileged-users--Experimental-. Anthony On Sunday, October 15, 2017 at 9:12:40 AM UTC-4, Bernhard Radermacher wrote: > > I developed a little plugin to facilitate authorization management. It can > be found at: > > https://github.com/bradermacher/web2py-plugin-authman &

[web2py] Re: response view with markdown

2017-10-15 Thread Anthony
It should be: response.view = 'default/testmd.md' Also, anything outside the {{...}} delimiters in a view will simply be returned as is, so any markdown in the file will be sent to the browser untransformed. Anthony On Sunday, October 15, 2017 at 8:32:44 AM UTC-4, 黄祥 wrote: > >

[web2py] Re: directory structure of uploaded file

2017-10-12 Thread Anthony
Instead of having SQLFORM automatically insert the new record, you can create custom logic to first insert everything but the file, and then after getting the new record ID, use that to set the uploadfolder and update the record with the file. Anthony On Thursday, October 12, 2017 at 8:26:16

[web2py] Re: Issue with query with join and id in select field list

2017-10-12 Thread Anthony
On Thursday, October 12, 2017 at 12:45:05 PM UTC-4, Ricardo Oliveira wrote: > > Hi Anthony, > > Thanks for your excellent example and explanation. > You're right about the problem with the field names, luckily the problem > occurs only in this example, not in production

[web2py] Re: Issue with query with join and id in select field list

2017-10-12 Thread Anthony
, so in the combined dictionary, the second will overwrite the first. Anthony On Thursday, October 12, 2017 at 5:19:26 AM UTC-4, Ricardo Oliveira wrote: > > Hi Anthony, > > Thanks for your reply. > That was also my initial solution. > Problem is I need to use render() in order to fo

[web2py] Re: Issue with query with join and id in select field list

2017-10-11 Thread Anthony
check the types (the Row.as_dict method takes the latter approach). 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 becau

[web2py] Re: reference representatnion

2017-10-11 Thread Anthony
See https://stackoverflow.com/a/11275155/440323. On Wednesday, October 11, 2017 at 12:49:18 PM UTC-4, Baiyo Paulo wrote: > > > db.define_table('store', > Field('name', 'string'), > auth.signature, > format='%(name)s', > ) > >

[web2py] Re: SQLForm not processing everytime values in form are changed

2017-10-11 Thread Anthony
ut (used for CSRF protection), which means the subsequent form submission fails due to lack of _formkey. 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: Understanding the download function

2017-10-10 Thread Anthony
uploads', auth.user.client if auth.user else ''), uploadseparate=True, autodelete=True)), ...) 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 Issue

[web2py] component rebuild via anchor helper

2017-10-06 Thread Anthony
You might instead consider putting the data in the session and retrieving it from the session when the link is clicked. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] Re: Compile controller and module files only

2017-10-06 Thread Anthony
and the models. > Sure, just compile that app and delete all the compiled view files. CSS files aren't compiled, so no need to do anything with them. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.g

[web2py] Re: how to detect if any view exists

2017-10-05 Thread Anthony
On Thursday, October 5, 2017 at 7:21:58 PM UTC-4, Alex Glaros wrote: > can you give me a tip on checking file system? Google. ;-) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: how to detect if any view exists

2017-10-05 Thread Anthony
Just check if the file exists on the filesystem. On Thursday, October 5, 2017 at 6:21:23 PM UTC-4, Alex Glaros wrote: > > I have a bookmark on every page that appears via layout.html {{include > 'default/menu_favorites.html'}} that reads a small table > > If am testing a new function that does

[web2py] Re: OffTopic - Python help

2017-10-05 Thread Anthony
magic method, and (c) operator overloading (implemented via the magic method). Anthony On Thursday, October 5, 2017 at 4:48:43 PM UTC-4, Ramos wrote: > > Reading this > https://github.com/JulienPalard/Pipe > > i tried this simple code > > > import functools > &

[web2py] Re: Question regarding building dynamic queries

2017-10-05 Thread Anthony
d returns the following for query and query1. I want > query1 to be a Class > > > > Are you sure the above is your exact code? I tried the same and cannot reproduce your results (both are gluon.dal.Query objects). Anthony -- Resources: - http://web2py.com - http://web2py

[web2py] Re: update_or_insert -- I end up with duplicates

2017-10-04 Thread Anthony
a transaction in update_or_insert, that would prematurely close the transaction that is intended to remain open for the duration of the HTTP request). I suppose we could add an option to lock the table. Anthony On Wednesday, October 4, 2017 at 10:25:44 AM UTC-4, Brad Miller wrote: > >

[web2py] Re: Insert into reference:list not working - FOREIGN KEY constraint failed field:upload

2017-10-03 Thread Anthony
reign key constraint on the field, which implies the table was not deleted and re-created. 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

[web2py] Re: Insert into reference:list not working - FOREIGN KEY constraint failed field:upload

2017-10-02 Thread Anthony
On Monday, October 2, 2017 at 7:57:19 PM UTC-4, LoveWeb2py wrote: > > Yes... I believe so. > > On Monday, October 2, 2017 at 7:53:13 PM UTC-4, Anthony wrote: >> >> Was that field originally a regular reference field and then you changed >> it to a list:refere

[web2py] Re: Insert into reference:list not working - FOREIGN KEY constraint failed field:upload

2017-10-02 Thread Anthony
Was that field originally a regular reference field and then you changed it to a list:reference field? On Monday, October 2, 2017 at 3:45:38 PM UTC-4, LoveWeb2py wrote: > > Anyone have feedback? I have been banging my head against this all day... > > On Sunday, October 1, 2017 at 4:52:39 PM

[web2py] Re: syntax error in list join-to-db?

2017-10-02 Thread Anthony
It is already a list, so don't put it inside another list. Should be: mySet = db.auth_user.id.belongs(session.myConnectionsList) Anthony On Monday, October 2, 2017 at 6:40:10 PM UTC-4, Alex Glaros wrote: > > abbreviated display of creating list: > > session.myCon

[web2py] Re: left join and common_filter

2017-10-02 Thread Anthony
ck to this thread. 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 &q

[web2py] Insert into reference:list not working - FOREIGN KEY constraint failed field:upload

2017-10-01 Thread Anthony
Please show the full traceback. -- 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: Force load an injected LOAD(ajax=True) helper

2017-09-28 Thread Anthony
In Javascript, you can call: $.web2py.component('{{=URL(...)}}', 'my_component') where 'my_component' is the id of the component div. You can use the LOAD helper to generate the div (with LOAD(..., target='my_component')), or just create an empty div with that id. Anthony On Thursday

[web2py] Re: how to keep response.headers after redirect

2017-09-28 Thread Anthony
even use a 303 response -- you can simply return a 200 response with a flag (in the headers or body) indicating the external app should be called next. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - h

[web2py] Re: DAL question db(db.table.id>0,db.table.field=='x').select()

2017-09-28 Thread Anthony
the alternative syntax to support both cases. So, I would prefer the current approach because it is more explicit and doesn't result in yet another way to do the same thing. Note, if you prefer, you can do: db(db.table.id>0)(db.table.field=='x').select() Anthony -- Resources: -

[web2py] Re: most simple way to change the "page=" parameter in grids

2017-09-27 Thread Anthony
You're on the right track -- you would have to use the pattern-based rewrite system, as the "page" identifier is hard-coded in the grid code. On Wednesday, September 27, 2017 at 3:29:21 AM UTC-4, Thomas Wimmer wrote: > > *push* > > Nobody? No Idea at all? > -- Resources: - http://web2py.com -

[web2py] Re: directory structure of uploaded file

2017-09-27 Thread Anthony
On Wednesday, September 27, 2017 at 5:04:27 AM UTC-4, Rudy wrote: > > Dave / Anthony, > > Thanks for your input and confirmation. I will look into the code to see > how i can use the uuid to separate files for multi-tenant purpose. > If you're going to be accessing the up

Re: [web2py] Re: "object_type" reserved word in web2py?

2017-09-26 Thread Anthony
, if it has been working so far, there is no reason it would suddenly stop working. Anthony On Tuesday, September 26, 2017 at 10:38:13 AM UTC-4, Alex Glaros wrote: > > it is a key table in my app and would be difficult to rename in the future > if there were naming issues > >

[web2py] Re: "object_type" reserved word in web2py?

2017-09-26 Thread Anthony
No, why do you ask? On Tuesday, September 26, 2017 at 1:30:43 AM UTC-4, Alex Glaros wrote: > > "object_type" reserved word in web2py? > > thanks > > Alex Glaros > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: directory structure of uploaded file

2017-09-26 Thread Anthony
9/06/the-database-abstraction-layer#Field-constructor. The subfolders have the form /tablename.fieldname/[first 2 letters of UUID from fielname]. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.googl

[web2py] Re: pyDAL - query records newer than a certain date

2017-09-26 Thread Anthony
Answered: https://stackoverflow.com/a/46428432/440323 On Tuesday, September 26, 2017 at 7:25:25 AM UTC-4, Terrence Brannon wrote: > > Since there has been no response here, I have posted my question at Stack > Overflow: > >

[web2py] Re: web2py-15, how to access table name from class ExporterXLS ?

2017-09-24 Thread Anthony
The same issue caused a bug in the TSV export, which was fixed by this pull request: https://github.com/web2py/web2py/pull/1766. Check out that code to see the fix. Anthony On Sunday, September 24, 2017 at 12:38:02 PM UTC-4, Alex Beskopilny wrote: > > Thanks for you answer ! > (it's c

[web2py] Re: smartgrid request

2017-09-24 Thread Anthony
Use the constraints argument, as described here: http://web2py.com/books/default/chapter/29/07/forms-and-validators#smartgrid-signature Anthony On Sunday, September 24, 2017 at 10:14:41 AM UTC-4, LC LC wrote: > > Hello, > > def index(): > records = > SQLFORM.smartg

[web2py] Re: web2py-15, how to access table name from class ExporterXLS ?

2017-09-23 Thread Anthony
Please show the full traceback as well as the rest of the relevant code (i.e., table definition and grid code). Anthony On Saturday, September 23, 2017 at 3:17:24 PM UTC-4, Alex Beskopilny wrote: > > > Hi All, > Why It's code work from controller and does error from class Expo

[web2py] Re: Kaspersky problem with web2pyslices.com

2017-09-23 Thread Anthony
The site should be fine. Likely just a false positive by Kaspersky. Anthony On Saturday, September 23, 2017 at 3:17:18 PM UTC-4, fernandisc...@gmail.com wrote: > > Kaspersky is alerting of phising URL when accessing any web2pyslices URL, > and therefore it dennies the access. &

[web2py] Re: Basic question about app compile

2017-09-21 Thread Anthony
On Thursday, September 21, 2017 at 11:25:38 AM UTC-4, Jordan Ladora wrote: > > > Thank you both very much for the help. I didn't find that thread you > mentioned, Anthony, before I posted my question yesterday. Thanks for > mentioning all that. > > Incidentally, is the

[web2py] Re: Build query without DB connection

2017-09-21 Thread Anthony
well as the model/controller code in order to define the same tables on the real DAL object as well as the dummy object. Finally, you should consider whether there is really much benefit to defining the queries in a module in this way. Anthony On Thursday, September 21, 2017 at 2:30:10 AM U

[web2py] Re: Basic question about app compile

2017-09-20 Thread Anthony
r of > these attempts worked, throwing 'invalid controller' errors. > This approach will not work and is not intended to. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/

[web2py] Re: Compiled and installed apps throw error after updating a folder that is outside web2py

2017-09-20 Thread Anthony
he web2py scheduler to handle running the task. Anthony On Wednesday, September 20, 2017 at 7:54:24 AM UTC-4, Lisandro wrote: > > Hi, I'm having a hard time to figure out why web2py throws this error in > this scenario. > > I have one web2py installation, with the same app installed **a l

[web2py] Re: the way to return json

2017-09-19 Thread Anthony
, it just calls response.json. 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: caching variable data sample

2017-09-18 Thread Anthony
che the results of a function. Instead, you can just do something like this: from mymodule import cache_this myrows = cache.redis('myrows', cache_this, time_expire=myvariable) Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2

[web2py] Re: How to get rid if the /init/default/ in the URL?

2017-09-18 Thread Anthony
init". The only reason to use "init" is if you are not using the rewrite system and want a default application when accessing a URL with the domain name only. Anthony On Monday, September 18, 2017 at 10:05:31 AM UTC-4, Anthony wrote: > > On Monday, September 18, 2017 at 9:30:

[web2py] Re: the way to return json

2017-09-18 Thread Anthony
json > As noted, you must request 'application/json', for example: curl -H "Accept: application/json" Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/li

[web2py] Re: How to get rid if the /init/default/ in the URL?

2017-09-18 Thread Anthony
On Monday, September 18, 2017 at 9:30:26 AM UTC-4, Joe wrote: > > Thanks Anthony, when you say "*specify the functions in the default > controller* ", what do you mean exactly? I just want to make sure I > understand you correctly. > See https://groups.google.com

[web2py] Re: How to get rid if the /init/default/ in the URL?

2017-09-17 Thread Anthony
? What happens if you just go to http://yourdomain.com? Anthony On Sunday, September 17, 2017 at 9:24:31 AM UTC-4, Joe wrote: > > Yes, I reloaded the app. Nothing happens, it doesn't change the URL. > > I tried several different ways to change the routes.py. > > In the current situat

[web2py] Re: the way to return json

2017-09-17 Thread Anthony
erializing (i.e., row.as_dict, gluon.serializers.json, and json.dumps). And of course, if you really want to know, you should just test it. Anthony On Sunday, September 17, 2017 at 7:42:50 PM UTC-4, 黄祥 wrote: > > just testing several code that return json > *e.g.* > > *

[web2py] Re: request.requires_https() while using taskqueue.add() in GAE possible?

2017-09-17 Thread Anthony
come from IP address 0.1.0.2 <https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/creating-handlers#writing_a_push_task_request_handler>. So, the code would be: if request.env.remote_addr != '0.1.0.2': request.requires_https() Anthony On Sunday, September 17, 2017 a

[web2py] Re: How to get rid if the /init/default/ in the URL?

2017-09-17 Thread Anthony
Did you reload routes or restart the server? -- 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

[web2py] Re: How to customize widgets to act like Onsen UI components

2017-09-16 Thread Anthony
On Saturday, September 16, 2017 at 4:23:43 PM UTC-4, Bernardo Leon wrote: > > Awesome as always Anthony Thank you! > > Yes I am talking about the SQLFORM Field objects. > > So I will need to create a Widget by subclassing FormWidget and return the > Ons tag object and

[web2py] Re: How to customize widgets to act like Onsen UI components

2017-09-16 Thread Anthony
our custom classes -- then your custom widgets will be the defaults used by SQLFORM. Anthony On Friday, September 15, 2017 at 10:46:38 PM UTC-4, Bernardo Leon wrote: > > I have been researching about UI Frameworks and stumbled upon Onsen UI > <https://onsen.io/>. It seems easy

Re: [web2py] Re: web2py 2.15.4 is OUT

2017-09-15 Thread Anthony
Looks like there's already an issue about that: https://github.com/web2py/pydal/issues/480 Anthony On Thursday, September 14, 2017 at 11:56:26 PM UTC-4, 黄祥 wrote: > > *e.g.* > *models/db.py* > def __before_insert_cash_in(f): > chart_of_account = int(f['chart_of_account'] ) &g

[web2py] Re: Storing stuff on request object

2017-09-15 Thread Anthony
It should be OK. The only potential issue is if the framework adds request.some_stuff in the future -- then your app code would be overwriting an attribute used by the framework (unlikely to be an issue if you avoid generic names). Anthony On Friday, September 15, 2017 at 1:10:06 AM UTC-4

[web2py] Re: caching variable data sample

2017-09-15 Thread Anthony
Forgot about that. It's documented here: http://web2py.com/books/default/chapter/29/04/the-core?search=lazy_cache#Warning--Do-not-use-the-current-object-in-global-scope-in-a-module. Yes, that would be the way to go if you want to move the function to a module. Anthony On Friday, September 15

[web2py] Re: caching variable data sample

2017-09-15 Thread Anthony
ction in a module -- it can go in a model or even in the controller (if the function takes no arguments, start its name with a double underscore to prevent it from being exposed as an action). You can even define the function inside the controller function that calls it if that's the onl

[web2py] Re: How to get rid if the /init/default/ in the URL?

2017-09-15 Thread Anthony
=['list', 'of', 'functions', 'in', 'default', 'controller'] ), ) Anthony On Friday, September 15, 2017 at 2:43:11 AM UTC-4, Joe wrote: > > I've been trying to do this for so long, but with *pythonanywhere* > hosting, it doesn't seem to be possible to get rid of the *init/default/

Re: [web2py] Re: web2py 2.15.4 is OUT

2017-09-14 Thread Anthony
On Thursday, September 14, 2017 at 9:20:55 PM UTC-4, 黄祥 wrote: > > before_insert callback that insert value to table with required = True is > still error (temporary solution is set required = False, while in 2.14.6 it > works with required = True). > Can you show an example? -- Resources: -

Re: [web2py] Re: web2py 2.15.4 is OUT

2017-09-14 Thread Anthony
This is a bug. I just submitted a pull request: https://github.com/web2py/web2py/pull/1766 Anthony On Thursday, September 14, 2017 at 4:43:24 AM UTC-4, 黄祥 wrote: > > test SQLFORM.grid() export TSV, return error: > Traceback (most recent call last): > File "/Users/MacBookPro/

Re: [web2py] Re: web2py 2.15.4 is OUT

2017-09-14 Thread Anthony
I cannot reproduce the problem. In general, though, code from newer apps should not necessarily be expected to work on older versions of web2py (that is referred to as "forward compatibility", and web2py only promises "backward compatibility"). Anthony On Thursday, Septem

[web2py] Re: Access to github book repositoy

2017-09-14 Thread Anthony
back to your own fork, and then make a pull request from your fork to the web2py repo. Anthony On Thursday, September 14, 2017 at 11:01:58 AM UTC-4, Bernhard Radermacher wrote: > > I tried to upload a small correction to the book as described in chapter > 15 but got the follow

[web2py] Re: Get Row Count in Restful Web Services

2017-09-14 Thread Anthony
ather than parser.count because the latter would cause an error if there is no "count" returned. Anthony On Wednesday, September 13, 2017 at 9:03:16 PM UTC-4, Carlos A. Armenta Castro wrote: > > Hi folks > > I want to get the total rows (count) of a query (get reque

[web2py] Re: caching variable data sample

2017-09-14 Thread Anthony
, and then just cache the resulting Rows object using cache.ram() with whatever key you like. > this gives me nerve crisesIt should be simple to do a simple thing > however one week digging this and I didn't move 1 inch ahead > Maybe you should have asked a week ago. ;-) Antho

[web2py] Re: caching variable data sample

2017-09-14 Thread Anthony
rue, which will make the entire Rows object cacheable. Anthony On Wednesday, September 13, 2017 at 4:09:23 PM UTC-4, Pierre wrote: > > purpose is to keep a single renewable pseudo-random data sample live > > the w2p books describes a situation of a constant query : > http://web2py

[web2py] Re: Possible problem with loading and installing compiled applications in web2py

2017-09-13 Thread Anthony
then pack the whole app (not just the compiled files). In that case, the compiled views will be executed, but the non-compiled views need to be present (the problem is that the code checks for the existence of the non-compiled view even though it will ultimately execute the compiled view)

[web2py] Re: Has the result of a datetime Field changed?

2017-09-12 Thread Anthony
', 'datetime')) Anthony On Monday, September 11, 2017 at 3:53:52 PM UTC-4, mweissen wrote: > > What is the type of the result of a Field(...;'datetime') ? > > I think, it should be "datetime" (and I am shure it has been in version > 2.14.x), but web2py 2.15.4 delivers

[web2py] Re: data represent in views is loaded faster using for loop python rather than using response json

2017-09-12 Thread Anthony
> > *views/default/index.html* > ... >

[web2py] Re: How to use flatpickr in web2py in a custom form

2017-09-12 Thread Anthony
2py calender.js file (otherwise, the default web2py picker will interfere). Anthony On Tuesday, September 12, 2017 at 5:54:08 AM UTC-4, Oasis Agano wrote: > > > I have created a custom html form and i want to use flatpickr as the > datepicker inside it, > then send the data to web2py in

Re: [web2py] Re: web2py 2.15.4 is OUT

2017-09-12 Thread Anthony
or should i just used maxtextlength = 350 ? > Most of the smartgrid arguments that correspond to grid arguments are actually dictionaries with table names as keys, so it should be: maxtextlengths = {'tablename': {'field_name': 350}} Anthony -- Resources: - http://web2py.com - http://web2py

[web2py] Re: Possible problem with loading and installing compiled applications in web2py

2017-09-11 Thread Anthony
Did you reload routes or restart the web server? On Monday, September 11, 2017 at 8:31:32 PM UTC-4, benjaminato...@gmail.com wrote: > > Today I came across some unusual behaviour in web2py when I tried to > install a compiled web2py application. Coming home I decided to see if I > could

[web2py] Re: Has the result of a datetime Field changed?

2017-09-11 Thread Anthony
d I am shure it has been in version >> 2.14.x), but web2py 2.15.4 delivers a "str". >> >> > Which DB engine are you using? In SQLite, a string is the native > implementation, no? > There's no DB here -- it's SQLFORM.factory. Anthony -- Resources: - http://we

[web2py] Re: HTML5 widgets on SQLFORM.factory

2017-09-11 Thread Anthony
nteger", which would activate web2py's built-in integer validator, which you may not want. 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) --- Yo

<    4   5   6   7   8   9   10   11   12   13   >