Re: [web2py] Re: web2py ajax function in py4web

2020-11-09 Thread Tom Campbell
Also, Stifan, could you post a few use cases? py4web includes vue.js by default and I am trying to understand the most common use cases of this for documentation purposes. I am guessing: - Instant form update on client side when a value is changed (for example, a star rating or even a compli

[web2py] TOMORROW: Talk to py4web's creator! Live Chat with Massimo DiPierro discussing py4web live 7/25/2020 10am PST

2020-07-24 Thread Tom Campbell
The hardest working man in the web framework business will be here for you to answer questions via interactive text. There will be a copy of the transcript available on FreeNode, plus I'll attempt to put together a polished version in article form. So the inevitable mistakes in my transcript wi

[web2py] Massimo discussing py4web live 7/11/2020 10am PST on freenode

2020-07-12 Thread Tom Campbell
No login needed. Text-based. https://webchat.freenode.net/#py4web -- 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 ar

[web2py] Re: Tables in Appadmin/index have disappeared

2019-08-14 Thread Tom Campbell
If you can imagine a version of the old song "Strumming My Pain" but about programming ("I felt he'd found my letters and read each one out loud"), yeah, you just told the story of my programming life too. I feel for you! Also you still have hair so that's good -- Resources: - http://web2py.com

[web2py] Re: Thank you Web2py community - I have completed a live application, ViewBase.com, using Web2py

2019-04-05 Thread Tom Campbell
Amazing piece of work. Congratulations! -- 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

[web2py] Git: save init application as separate repo from web2py, and exclude the init directory?

2019-03-17 Thread Tom Campbell
My (soon to be production) code is in the application named init. Obviously init is surrounded by the web2py installation itself. We will want to preserve the working version of web2py in a git repo since it's likely we will update web2py separately from the init app. I assume the best practice is

[web2py] .gitignore and just backing up one application

2019-02-18 Thread Tom Campbell
Want to get version control right for this one. It will be just one item in the /applications directory, the /applications/init project. Some questions. - Is there any reason to backup more than just /applications/init? I assume it is best simply to note the version of /web2py I'm using an

[web2py] Is there such a thing as a reliable, managed web2py/PostgreSQL host with good support?

2019-02-16 Thread Tom Campbell
Need managed, reliable hosting for a mission critical app that hits the eBay API at specified times. It's a generic CRUD app except that scheduled tasks (written in Go) must be run with 1 second accuracy, no more than 200/second at peak times. I am a pretty terrible sysadmin so my strong prefer

[web2py] Can we commit the codes from web2py to Git

2018-09-03 Thread Tom Campbell
Yes it works fine with Git. In fact... https://github.com/web2py -- 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

[web2py] Re: Unable to override Bootstrap in layout.html

2018-05-03 Thread Tom Campbell
On Thursday, May 3, 2018 at 9:30:56 PM UTC-7, pbreit wrote: > > I think the property you want is background-color > Not sure what you mean... the bootstrap source at https://github.com/twbs/bootstrap/blob/v4-dev/dist/css/bootstrap.css defines attributes like this: .navbar-dark .navbar-brand {

[web2py] Re: "Installed applications" list now missing my applications

2018-05-03 Thread Tom Campbell
Thanks for the response! Seemed that way to me too, but that wasn't the issue (because the list of applications was unique). I solved it the old-fashioned way--git pull on web2py itself -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (

[web2py] Unable to override Bootstrap in layout.html

2018-05-03 Thread Tom Campbell
Goal is to change the color, size, and eventually default font of Bootstrap 4 navbar. The following seemed to have no effect in web2py-bootstrap4.css (not the final colors! Just wanted contrasting ugly ones to make sure the experiment worked!) file: web2py-bootstrap4.cs .navbar-dark { c

[web2py] SOLVED: Where does configuration.get() look for files? Or does it?

2018-05-03 Thread Tom Campbell
Ah. It's AppConfig (see http://web2py.com/books/default/chapter/29/13/deployment-recipes?search=AppConfig#AppConfig-module). The values are stored in .ini format in the /private directory, which is not supposed to be part of the Git repo. On Thursday, May 3, 2018 at 1:40:44 AM UTC-7

[web2py] Where does configuration.get() look for files? Or does it?

2018-05-03 Thread Tom Campbell
Trying to set up the mailer for Gmail. After a spell a way from web2py I see code like this in db.py mail.settings.login = configuration.get('smtp.login') 1. What is "configuration.get()"? I'm assuming it's a function that reads a file with configuration info? When I searched the web2py source <

[web2py] SQLite data file in production-backing up

2018-05-03 Thread Tom Campbell
SQLite is more than enough for my needs, I think. In the best of worlds we will have no more than a few thousand customers after we get up and running. But I'm not sure what to do about the database file, which is of course unencrypted. I will place it in a directory that is not accessible to w

[web2py] Re: Things to do to secure server running purely web2py?

2017-02-16 Thread Tom Campbell
As usual the web2py book has tons of great info in the Deployment chapter. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.co

[web2py] Re: Why doesn't web2py create a PostgreSQL database automatically (curiosity, not criticism)

2017-02-16 Thread Tom Campbell
Thanks, Stifan, you rock as always. I thought I had tried & failed with this but I trust you on these matters more than myself. Can't wait to get to my db machine to re-test -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code

[web2py] Why doesn't web2py create a PostgreSQL database automatically (curiosity, not criticism)

2017-02-16 Thread Tom Campbell
As a database admin newb last year I had trouble deploying a PostgreSQL site because I forgot that "real" DBMSes require you create a database first, unlike SQLite. So I was trying to create tables in a nonexistent database. Is there some reason web2py doesn't just create a PostgreSQL database

[web2py] Re: Probably very naive question from new user

2016-02-10 Thread Tom Campbell
www.pyguy.com has a few beginner-level tutorials that probably answer those questions -- 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] class 'psycopg2.ProgrammingError'> relation "auth_user" already exists

2016-01-29 Thread Tom Campbell
App is on pythonanywhere, using Postgres. Connect string is: db = DAL('postgres://web2pydbadmin:mypassw...@memberable-96.postgres.pythonanywhere-services.com:10096/mydatabase') Existing topics like https://groups.google.com/forum/#!topic/web2py/p740UJkR3Ao do not seem to have helpful info.

[web2py] Re: SQLFORM.factory() - Display name instead of integer for user_id?

2016-01-13 Thread Tom Campbell
On Wednesday, January 13, 2016 at 3:38:56 PM UTC-8, Tom Campbell wrote: > > Creating a custom form that relates first name and last name fields to the > db.auth_user's user_id field. In the form below the user ID shows as an > integer in the dropdown but I'd like it to s

[web2py] SQLFORM.factory() - Display name instead of integer for user_id?

2016-01-13 Thread Tom Campbell
Creating a custom form that relates first name and last name fields to the db.auth_user's user_id field. In the form below the user ID shows as an integer in the dropdown but I'd like it to show as the user's name. How do I do that? form = SQLFORM.factory( Field('fi

[web2py] Re: Failing at Google Cloud SQL again: missing MySQLdb import somewhere?

2016-01-05 Thread Tom Campbell
So the problem was that on the latest OS X, libraries are now prohibited from using relative pathnames . I am testing, re-testing, and re-re-testing the document I'm writing up on every machin

[web2py] Re: Failing at Google Cloud SQL again: missing MySQLdb import somewhere?

2016-01-02 Thread Tom Campbell
Argh, I should have updated this. Thank you for answering! Adding the import to dev_appserver.py did not work. But I had to learn about pip (ahem) and imported Python-MySQL, which definitely helped (now there's another problem I'm tracking down). I am so used to web2py coming with everything it

[web2py] Failing at Google Cloud SQL again: missing MySQLdb import somewhere?

2016-01-02 Thread Tom Campbell
I think I may have lied. When I asked the question $100 reward to get a simple web2py app runnnig on GAE with Google Cloud SQL , I was either incompetent or dishonest in my answer! Masssimo asked me to document the process. I have been

web2py@googlegroups.com

2015-12-26 Thread Tom Campbell
Cleaner versions in tutorial style at pyguy and and web2pyslices . Criticism warmly welcom

[web2py] Re: datatables.net fail: "Uncaught SyntaxError: Unexpected token &" ANSWERED

2015-12-26 Thread Tom Campbell
After a day of messing this, *of course I answered it myself moments after posting!*Answer was to define columns used and to use {{=XML}} helper:a $(document).ready(function(){ $("#person-table").DataTable({ "data": {{=XML(results)}}, columns: [

web2py@googlegroups.com

2015-12-26 Thread Tom Campbell
Trying to display rows using the datatables.net DataTable() function by converting query results to JSON, but getting error "Uncaught SyntaxError: Unexpected token &". Though the raw data displays correctly in the view below, when I look at the results in the web console debugger I see that the

[web2py] Re: $100 reward to get a simple web2py app runnnig on GAE with Google Cloud SQL

2015-12-19 Thread Tom Campbell
IT WORKS! Cannot tell you what a relief that was. I will absolutely write it up in a web2pyslice, a blog post, and a book section! THANK YOU -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/we

[web2py] Re: $100 reward to get a simple web2py app runnnig on GAE with Google Cloud SQL

2015-12-18 Thread Tom Campbell
Thank you! Soon as I get back I can't wait! On Saturday, December 12, 2015 at 7:05:04 PM UTC-8, Tom Campbell wrote: > > I want to get a minimal web2py app running on Google Application Engine, > using Google Cloud SQL as the backing store. Have not succeeded. Obviously > beca

[web2py] $100 reward to get a simple web2py app runnnig on GAE with Google Cloud SQL

2015-12-12 Thread Tom Campbell
I want to get a minimal web2py app running on Google Application Engine, using Google Cloud SQL as the backing store. Have not succeeded. Obviously because I have a much bigger app running locally and want to get that up and running. If anyone can show me how to do this via Skype, a well-writte

[web2py] GAE: "UserWarning: There are too many files in your application..." Which files to hide?

2015-12-11 Thread Tom Campbell
While attempting to another GAE problem , I'm running into this GAE error: 15: UserWarning: There are too many files in your application for changes > in all of them to be monitored. You may have to restart the development

[web2py] GAE app running locally can't open Google Cloud SQL database: "Failure to connect, tried 5 times"

2015-12-11 Thread Tom Campbell
Can someone tell me what I'm doing wrong in my attempt to use Google Cloud SQL? My GAE app runs successfully on local machine without database support. Goal is to use Google Cloud SQL database. Remote Google Cloud SQL database is accessible via mysql on the command line. Google SDK is the latest

[web2py] GAE problems cont'd--Library not loaded: libmysqlclient.18.dylib

2015-10-23 Thread Tom Campbell
Have been unable to connect to Cloud SQL so far in Python (I can do it in raw Go). Sébastien reminded me about installing the Python MySQLdb lib . Still no luck, but it got me thi

[web2py] Re: Google Cloud SQL: Unable to connect

2015-10-23 Thread Tom Campbell
Thank you, Sébastien. I indeed had not used MySQLdb in app.yam, nor had I included credentials on the tried what you suggested and still get an error on the dev_appserver.py command line. Log files say this: ERROR2015-10-23 21:47:10,581 restricted.py:174] Traceback (most recent call last):

[web2py] Consultant needed for GAE, testing, single page app issues

2015-10-21 Thread Tom Campbell
google-app-engine-with-google-cloud-sql-and/details> in a free book on deploying web2py apps on GAE with Cloud SQL. Cheers, Tom Campbell tomcampb...@gmail.com. Seattle area. My (already) publicly available phone # is (425) 260-5292 -- Resources: - http://web2py.com - http://web2py

[web2py] Google Cloud SQL: Unable to connect

2015-10-21 Thread Tom Campbell
My app is named todo. I want to deploy it to GAE using Google Cloud SQL. Connection looks like this: if not request.env.web2py_runtime_gae: db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', cast=int), check_reserved=['all']) else: db = DAL('google:sql://gigcity-1951:db

Re: [web2py] Re: OS X Permissions question: echo works in ../web2py but not ../web2py/applications?

2015-10-20 Thread Tom Campbell
Ah, relief. You have diagnosed the issue exactly. Thank you so much. -- 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 yo

Re: [web2py] Re: OS X Permissions question: echo works in ../web2py but not ../web2py/applications?

2015-10-20 Thread Tom Campbell
an use chmod and chown to restore those permissions. This could also > be a problem with the filesystem. Some time permissions go bad in OSX and > you have to use the Disk Utils to fix permissions and then reboot. > > > On Monday, 19 October 2015 20:53:28 UTC-5, Tom Campbell wrote: &g

[web2py] OS X Permissions question: echo works in ../web2py but not ../web2py/applications?

2015-10-19 Thread Tom Campbell
In the most recent version of Mac OS X, if I'm in the web2py directory this works fine: echo "# todo" >> README.md Yet if I'm in web2py/applications or any of its subdirectories I get a "Permission denied" error. What incredibly stupid thing am I doing wrong? -- Resources: - http

[web2py] GAE app works locally, not deployed to cloud

2015-10-16 Thread Tom Campbell
Plan is to host my app on GAE eventually. I have a small demo app named todo that works fine this way, deployed using the GAE local server: $ cd /usr/local/web2py $ python web2py.py -G GAE $ dev_appserver.py ../web2py But when I deploy it to the cloud: $ dev_appserver.py ../web2py and vist ht

[web2py] Re: 0.db naming convention?

2015-10-15 Thread Tom Campbell
Thank you, Leonel. AppConfig seems to be totally undocumented. Is this my cue to contribute to the docs by rooting around in the source and asking you folks stupid questions about AppConfig? -- Resources: - http://web2py

[web2py] 0.db naming convention?

2015-10-14 Thread Tom Campbell
I notice there seems to be a convention that application-specific models go in a file named 0.db. Any particular reason for that or inside info that makes it easier to work with later? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

[web2py] Re: Version control: web2py and my application in separate repos?

2015-10-09 Thread Tom Campbell
Thank you, Leonel and Vincinius. So it seems that the canonical way to do this would be as follows? # Create a git repo of web2y and pydal on your local machine $ git clone --recursive https://github.com/web2py/web2py.git # Inside the web2py directory... $ cd web2py # ...check out version

[web2py] Re: Version control: web2py and my application in separate repos?

2015-10-09 Thread Tom Campbell
Me too. I have to be honest, the reason I'm using my own web2py repo is because I don't understand the WARNING: DO NOT DOWNLOAD RELEASES FROM THIS GITHUB PAGE at https://github.com/web2py/web2py/releases thing. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://

[web2py] Version control: web2py and my application in separate repos?

2015-10-09 Thread Tom Campbell
My app is under version control at Github. It will be deployed on Google App Engine. There's a chance that web2py could be updated and render some of my app's behavior unpredictable, or, more likely, GAE could screw something up and break web2py. I think the obvious choice, then, is to have a s

[web2py] Re: A helper callback not working as expected

2015-10-07 Thread Tom Campbell
Thank you, Anthony. I was working with a much older version of web2py. I updated to 2.12.3-stable and it appears to be working fine. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issu

[web2py] A helper callback not working as expected

2015-10-06 Thread Tom Campbell
I would expect this to link to default/completed. My app is named ajaxtodo. I have controller() defined in default.py. However, the A helper below only links to http://127.0.0.1:8000/ajaxtodo/default/index#null {{=A('Completed', callback=URL(c='default', f='completed'))}} How can I get that to

Re: [web2py] Re: How to demonstrate LOAD() working properly?

2015-10-02 Thread Tom Campbell
ogged in, > try visiting the link and copy-pasting from the browser URL. Or maybe > provide the example of your app by uploading it to github/bitbucket. > > > On Friday, October 2, 2015 at 7:05:24 PM UTC-4, Tom Campbell wrote: >> >> I am working on a simplified single-p

[web2py] How to demonstrate LOAD() working properly?

2015-10-02 Thread Tom Campbell
I am working on a simplified single-page app demo. I think I have it working, but I'm not sure because I need to demonstrate that only part of the page is reloading. Most of the code is shown in this post: https://mail.google.com/_/scs/mail-static/_/js/k=gmail.main.en.Pryf_O7ZHDs.O/m=m_i,t/am=Pi

[web2py] Re: console.log on page reload?

2015-10-01 Thread Tom Campbell
Thank you, Derek, but I'm still flummoxed. I added this new script tag to web2py_ajax.html: console.log('loaded ' + Date.now()) But I'm getting this message even when I use LOAD(). So I'm trying to understand whether I am placing this code in the wrong location or what, because I think it shou

[web2py] console.log on page reload?

2015-10-01 Thread Tom Campbell
Working on a single-page app and trying to ensure that only part of the page gets refreshed. Doing some tests using LOAD() that look like this: *file default/new.html:* {{extend 'layout.html'}} {{=LOAD('default', 'new.load',ajax=True)}} *file default/new.load:* {{if 'message'in globals():}} {{

[web2py] GAE/Google AppEngine problem with web2py: "Deployment successful" but GAE does not launch

2015-07-30 Thread Tom Campbell
My AppEngine ID is memberable0. I copied examples/app.example.yaml to web2py root as app.yaml Only change I made was: application: memberable0 Web2py lives in /Users/tom/Dropbox/work/m/web2py and that path shows successfully in GoogleAppEngineLauncher, which shows port 8081 for the web server (no

[web2py] Silly out of band question about deploying web2py

2015-06-01 Thread Tom Campbell
I am building a SaaS business and am not yet able to hire someone to do the hard stuff (which is everything but the programming). Is there some kind of managed solution I should be looking at, maybe GAE? This message by Lewis

[web2py] Replacing layout.html with an AdminLTE dashboard

2015-05-10 Thread Tom Campbell
AdminLTE is a beautiful dashboard template. Using it in my current project, and I've posted it to Github at AdminLTE-web2py . Let me know what egregious mistakes I've made. I did follow along with my tutorial to

[web2py] Re: Tutorial: Populating a Handsontable Grid using web2py

2015-05-09 Thread Tom Campbell
Done and done, Ken--another blog post floating in the wind. Fixed the CRUD thing and a few other items. PyGuy web2py Handsontable tutorial #1: Populating a Handsontable grid using web2py

[web2py] Re: LOAD() problem: Yes, I am bungling the world's smallest web2py app.

2015-04-25 Thread Tom Campbell
MAGIC! Thank you, Anthony and Dmitry. I misread Dmitry's code for the view and retained the dict() when returning a value from showtasks(), and removed showtasks.load. That is completely wild! Thought I had read the book thoroughly before bugging you folks. Thank you. -- Resources: - http://w

[web2py] Re: LOAD() problem: Yes, I am bungling the world's smallest web2py app.

2015-04-25 Thread Tom Campbell
Thanks, Dmitry--some questions. 1. What does "will take no view" mean for the showtasks() method? 2. Why are .load extensions not recommended? There seems to be some history on the list but I don't understand the issues. -- Resources: - http://web2py.com - http://web2py.com/book (Docum

[web2py] Re: LOAD() problem: Yes, I am bungling the world's smallest web2py app.

2015-04-23 Thread Tom Campbell
Anthony, thank you thank you thank you! I made these changes as follows and it works like a charm. In default.py def index(): return locals() def showtasks(): return dict(grid=SQLFORM.grid(db.task,user_signature=False)) I never considered for a second I would require a controller. I s

[web2py] LOAD() problem: Yes, I am bungling the world's smallest web2py app.

2015-04-23 Thread Tom Campbell
When I run the following no error gets logged but index.html gets the message "invalid function (default/showtasks)" rendered in the view. Controller in default.py: def index(): return dict(grid=SQLFORM.grid(db.task,user_signature=False)) index.html: {{extend 'layout.html'}} {{=LOAD('default

[web2py] Best way to display table columns in correct order using a Handsontable

2015-04-08 Thread Tom Campbell
I have a query result named todos I am loading into a Handsontable in the view. The code below populates the Handsontable, but columns do not appear in the order they are defined in db.define_table(). In this case, while the database columns are 'id','title'.'description','priority', and 'compl

[web2py] Difference between response.files.insert() and URL(), and congratulations on v2.10

2015-04-01 Thread Tom Campbell
(First--congrats on v2.10 and thanks to all you contributors for an incredible framework.) What's the difference between these two lines of code? response.files.insert(1,URL('static','adminlte/bootstrap/css/bootstrap.min.css')) -- Resources: - http://web2py.com - http://web2py.com/book (Docu

[web2py] "internal error: [Errno 1] Operation not permitted" when attempting Pack All

2015-03-17 Thread Tom Campbell
Attempting to do a Manage > Pack All on a project but I get this message: messageinternal error: [Errno 1] Operation not permitted: I am attempting to save to the Dropbox directory in which web2py lives. What should to do to get it to pack correctly? -- Resources: - http://web2py.com - ht

[web2py] Re: Creating my own layout.html, but errors not displaying

2015-02-23 Thread Tom Campbell
Ugh, I thought I copyedited. For clarification: On Monday, February 23, 2015 at 3:58:52 PM UTC-8, the idiot Tom Campbell wrote: > > Creating my own layout.html based on the AdminLTE theme > <https://github.com/almasaeed2010/AdminLTE>. It works, but errors are not > being disp

[web2py] Creating my own layout.html, but errors not displaying

2015-02-23 Thread Tom Campbell
Creating my own layout.html based on the AdminLTE theme . It works, but errors are not being displayed. For example, I have a notnull*=*True validation rule in the 'description' field of the model model but if a description isn't displayed, not error

[web2py] Re: Force authentication to whole app

2015-02-12 Thread Tom Campbell
> > To take advantage of the decorators at a file level, you can also do this > at the top level of a file: > > auth.requires_login()(lambda: None)() > > The decorators ultimately call auth.requires, which itself returns a > decorator. The above passes a dummy function to that decorator and then

[web2py] Re: Adding entry to the printed book index

2015-02-12 Thread Tom Campbell
To the printed book index. -- 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 "web

Re: [web2py] Re: Adding entry to the printed book index

2015-02-11 Thread Tom Campbell
inning?) On Wed, Feb 11, 2015 at 11:30 PM, Niphlod wrote: > please give an example of what you're trying to add ^_^ > > > On Wednesday, February 11, 2015 at 11:33:04 PM UTC+1, Tom Campbell wrote: >> >> I'd like to add terms to the book's index. Looked at the

[web2py] Re: Is SQLFORM hardcoded to use layout.html?

2015-02-11 Thread Tom Campbell
Um... I put the view in /views/new.html, not /views/default/new.html. TIME TO GET SOME SLEEP -- 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] Is SQLFORM hardcoded to use layout.html?

2015-02-11 Thread Tom Campbell
I'm sure it's not, that title was just click bait :-O I have created a file called ltelayout.html, based on layout.html. My new() method in default.py is: def new(): return dict(form=SQLFORM(db.todo, submit_button='Save')) My view new.html is: {{extend 'ltelayout.html'}} NEW!! {{=form}}

[web2py] Adding entry to the printed book index

2015-02-11 Thread Tom Campbell
I'd like to add terms to the book's index. Looked at the book source on github but couldn't figure out where that would happen so I could issue a pull request. Can someone give me a brief description of where I'd find it? Thanks! -

[web2py] Re: Why is the world's smallest web2py app failing?

2015-01-17 Thread Tom Campbell
Took a while to respond because I'm embarrassed. I somehow thought that omitting the @auth.requires_login() decorator would eliminate that default behavior and did not bother to test my assumption. Thank you. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://gi

[web2py] Why is the world's smallest web2py app failing?

2015-01-17 Thread Tom Campbell
Having problems with grid and smartgrid not showing Add and buttons. So I created the smallest possible app and they still don't show up. Here is the code. # append to db.py db.define_table('supplier', Field('name')) # file index.html {{extend 'layout.html'}} {{if 'message' in globals():}}

[web2py] Why can I peek but not edit some existing files?

2015-01-15 Thread Tom Campbell
I created a file called default/view.html using the web interface. It looks as expected when I peek at it: {{extend 'layout.html'}} This is the default/view.html template {{=BEAUTIFY(response._vars)}} However, when I choose to edit that file using the web interface I get a blank, uneditable pa

[web2py] Re: Smartgrid: Display name as string instead of id?

2014-02-26 Thread Tom Campbell
Thanks, Stifan! Turns out I was working too hard. This is the modern way to do it. model db_pos.py: db=DAL('sqlite://storage.sqlite') db.define_table('supplier', Field('name'), format='%(name)s') db.define_table('item', Field('name'), Field('supplied_by', db.supplier)) controller default.py:

[web2py] Smartgrid: Display name as string instead of id?

2014-02-25 Thread Tom Campbell
An Item has a supplier as shown in the schema below. I would like smartgrid to diplay a supplier as 'Costco' rather than its id, which is 3. What's wrong with this picture? db_foo.py: db=DAL('sqlite://storage.sqlite') db.define_table('supplier', Field('name', unique=True, requires=IS_NOT_EM

[web2py] Re: web2py on windows 7

2011-11-20 Thread Tom Campbell
I would avoid this by putting Python on the path, then web2py somewhere outside of Program Files, which I would claim is bad form anyway. Like a web2py directory off root, maybe? I can post a little tutorial for a manual Windows install of web2py illustrating this if you like.

[web2py] "Simple query" suffers nasty case of user error...

2011-11-02 Thread Tom Campbell
...but I'm too much of a noob to get it. # file models/db_todo.py db.define_table('todo', Field('summary','string',requires=IS_NOT_EMPTY()), Field('priority',requires=IS_IN_SET([1,2,3,4,5])), Field('complete','boolean',default=False)) # file views/main/index.html {{extend

[web2py] Advantage to requires clause in controller vs model?

2011-10-30 Thread Tom Campbell
In the building a minimalist facebook clone video at around 7:30 I see this in default.py: def search() # make a form where to type a name form = SQLFORM.factory(Field('name',requires=IS_NOT_EMPTY())) Question about the requires. This no difference between putting

[web2py] Re: Where's the applications directory on OSX filesystem?

2010-11-04 Thread Tom Campbell
Of course I figured this out moments after I posted, even though I'd pondered it for some time before. Sorry for wasting your intellectual bandwidth.

[web2py] Where's the applications directory on OSX filesystem?

2010-11-04 Thread Tom Campbell
I'm changing to OSX from Windows and can't browse to the applications directory. If I search for the view file customer.html from the command line I see it easily: $ find . -name customer.html ./osx/1.88.2/web2py/web2py.app/Contents/Resources/applications/ scheduler/views/customer.html However

[web2py] Re: Newb question: How to handle multiple controller levels?

2010-10-30 Thread Tom Campbell
Never mind. Crushingly brilliant chap that I am, immediately after posting that I realized I have the luxury of constructions like: _href=URL('appointment','edit',args=[customer,appointment]))

[web2py] Newb question: How to handle multiple controller levels?

2010-10-30 Thread Tom Campbell
I have an app that supports multiple organizations. Each organization has many customers. Each customer has many appointments. I think that means organizations, while controllers, employ a customer controller, which employes an appointment controller. In my head the URL for editing an appointment

[web2py] Best way to update schedule with multiple users/locations?

2010-10-26 Thread Tom Campbell
I'm writing a scheduling system in web2py. It can be used by multiple users in multiple locations. If one user adds an appointment, I'd like other users to see it within 10 seconds or so. What is the preferred mechanism for this? My poorly educated guess is: 1. An updater runs as a single backgrou

[web2py] Confirm deletion of record

2010-10-01 Thread Tom Campbell
I have a 'Delete' link in my edit view. The controller looks like this: def delete(): task=db.tasks[request.args[0]] form = crud.delete(db.tasks, task.id, next=URL(r=request,f='index'), message=T('Deleted'),deletable=True) return dict(form = form) what I want is before the crud.delete

[web2py] Re: Why the pattern return dict(form=form)?

2010-09-17 Thread Tom Campbell
Wow, huge help. Thanks a TON, Bruno and Jonathan. You're both awesome members of the community. I hope to be the same one day. Cheers, TC

[web2py] Why the pattern return dict(form=form)?

2010-09-16 Thread Tom Campbell
New to Python & web2py. Searched for but could not find an explanation of why so much code looks like: return(form=form) What makes the assignment necessary?

[web2py] web2py_vs_others missing T() section!

2010-09-08 Thread Tom Campbell
I just learned about http://www.web2py.com/examples/static/web2py_vs_others.pdf on StackOverflow a few minutes ago so maybe this is old news, but the Internationalization section doesn't talk about web2py's elegant T() object. That section doesn't mention web2py at all! Just discovered web2py Fri