[web2py] Re: A logged in page and a logged out page for the same url?

2016-09-24 Thread David Ripplinger
ption is the standard approach of decorating actions > that require login, which will automatically redirect to the login page for > anyone who is not logged in. > > Anthony > > On Saturday, September 24, 2016 at 12:37:37 PM UTC-4, David Ripplinger > wrote: >> >>

[web2py] A logged in page and a logged out page for the same url?

2016-09-24 Thread David Ripplinger
Does anyone know how I can have the same url return a totally different page depending on whether the user is logged in or not? I'd like the home page to display a simple "Sign up / log in" page when the user is logged out and display the actual app when logged out. I'd rather not have a

[web2py] Re: A new and easier way to test your apps

2016-06-28 Thread David Ripplinger
Thanks. I realized that I was assuming that when testing it out in the python shell the working directory would be translated, which apparently it was not. When instead I ran it as a script from within the web2py directory, it worked fine. On Saturday, June 25, 2016 at 11:20:59 AM UTC-6,

[web2py] Re: A new and easier way to test your apps

2016-06-25 Thread David Ripplinger
It exists in ~/web2py/gluon/contrib/. Should this be copied to a system directory? Should I have done another step to put the web2py folder on the python PATH? On Saturday, June 25, 2016 at 6:48:42 AM UTC-6, Anthony wrote: > > Is there a webclient.py file in your gluon/contrib folder? --

[web2py] Re: A new and easier way to test your apps

2016-06-25 Thread David Ripplinger
How come when I try `from gluon.contrib.webclient import WebClient` I get `No module named gluon.contrib.webclient`? On Wednesday, August 29, 2012 at 4:49:14 PM UTC-6, Massimo Di Pierro wrote: > > I think you are going to like this: >

[web2py] Re: routes.py causing loss of css

2015-08-26 Thread David Ripplinger
and function, the parameter-based rewrite system is a better option. Anthony On Wednesday, August 26, 2015 at 11:33:53 AM UTC-4, David Ripplinger wrote: Hi everyone, I know I'm doing something wrong here. I'm trying out app-specific routes.py files. I have an app that currently has

[web2py] routes.py causing loss of css

2015-08-26 Thread David Ripplinger
Hi everyone, I know I'm doing something wrong here. I'm trying out app-specific routes.py files. I have an app that currently has the default/index page unmodified, that is, it's equivalent to the welcome app. I have in the web2py base directory the following contents in my routes.py file:

[web2py] Re: Code organization help

2015-08-10 Thread David Ripplinger
Here's an update after I learned some more: It looks like I can have the best of both worlds, since web2py has routers that can translate between a public URL and a back-end URL (see the subsection titled URL Rewrite http://web2py.com/books/default/chapter/29/04/the-core#URL-rewrite in the

[web2py] Code organization help

2015-08-07 Thread David Ripplinger
Hi all, This is a request for ideas on good code organization for my application. I've been reading up on the preferred organization for web2py as well as typical REST HTTP conventions, and I'm trying to use some ideas of both where they make sense. If I understand correctly, web2py takes

[web2py] working directory and runtime directory when running web2py

2014-10-22 Thread David Ripplinger
I recently discovered there are a couple things about the working directory and the runtime directory when running web2py. - If you launch python web2py.py in Linux from a working directory other than web2py, the runtime directory is web2py and not your working directory. This works

[web2py] Re: working directory and runtime directory when running web2py

2014-10-22 Thread David Ripplinger
. investigating... On Wednesday, October 22, 2014 6:11:56 PM UTC+2, David Ripplinger wrote: I recently discovered there are a couple things about the working directory and the runtime directory when running web2py. - If you launch python web2py.py in Linux from a working directory other

[web2py] Re: working directory and runtime directory when running web2py

2014-10-22 Thread David Ripplinger
. On Wednesday, October 22, 2014 4:26:01 PM UTC-4, Niphlod wrote: whoopsy. it needs also the corresponding library.zip. stay tuned, I'll try to make something against 2.9.11. On Wednesday, October 22, 2014 10:12:34 PM UTC+2, David Ripplinger wrote: Tried it. It does the same thing. Sorry

[web2py] Re: working directory and runtime directory when running web2py

2014-10-22 Thread David Ripplinger
on 2.9.11 with the fix. https://www.dropbox.com/s/jmdy2qtt71i0snb/web2py_win.zip?dl=0 On Wednesday, October 22, 2014 10:27:33 PM UTC+2, David Ripplinger wrote: Here's some more information. You may have already figured this out, but just in case it helps: When I run web2py.exe from

[web2py] Re: unittest with multiple test files

2014-10-22 Thread David Ripplinger
(self): # put in whatever tests self.assertTrue(True) suite.addTest(unittest.makeSuite(TestFoo)) On Monday, October 20, 2014 4:48:11 PM UTC-4, David Ripplinger wrote: Hi, I'm using unittest in my app as suggested here http://www.web2py.com/AlterEgo/default/show/260, but I don't want

[web2py] Re: Web2py on Pythonanywhere

2014-10-21 Thread David Ripplinger
Are you comfortable posting a link to your website so I can see if it also loads as https on my end? On Thursday, October 9, 2014 3:33:37 PM UTC-4, clara wrote: Hello all, I have used python anywhere to deploy simple web2py applications. In the last few I updloaded onto pythonanywhere I

[web2py] unittest with multiple test files

2014-10-20 Thread David Ripplinger
Hi, I'm using unittest in my app as suggested here http://www.web2py.com/AlterEgo/default/show/260, but I don't want all my tests to be in one file. As far as I can tell, my options are: 1. Bite the bullet and put all tests in one file. 2. Run each test file separately and have a shell

Re: [web2py] Re: Two databases with an auth in each

2013-08-19 Thread David Ripplinger
into the same situation, can you tell me which route you took? did you decide to have two applications or the other way? On Saturday, April 13, 2013 10:53:47 AM UTC-7, David Ripplinger wrote: Okay, that makes sense. It might not be worth modifying web2py for this behavior when there may

[web2py] Type-checking error messages built into the DAL insert() function

2013-07-25 Thread David Ripplinger
Currently, the DAL insert() function allows one to insert a record with a DATE field containing a string type using sqlite as the database. My guess is that there are other types that also go unchecked within the insert() function. I think it would be a good idea to raise an exception or

[web2py] Re: Type-checking error messages built into the DAL insert() function

2013-07-25 Thread David Ripplinger
Hmm. I admit I made a few assumptions based on the incident I experienced and how I saw things done in a couple examples in the book. To be precise, I created a form using the FORM function, where one field was meant to be used as a date (had a requires=is_date() on it). I then passed the

Re: [web2py] online web2py book inaccessible

2013-07-23 Thread David Ripplinger
Is there anywhere else that I can view a copy of the book for the meantime? On Tuesday, July 23, 2013 1:15:42 PM UTC-4, Jonathan Lundell wrote: On 23 Jul 2013, at 9:59 AM, David S dsie...@gmail.com javascript: wrote: It seems the online web2py book (http://web2py.com/book) isn't working

Re: [web2py] online web2py book inaccessible

2013-07-23 Thread David Ripplinger
Nevermind. Found another thread that addresses this: https://groups.google.com/forum/#!topic/web2py/Gzj1GbzJ7lk On Tuesday, July 23, 2013 4:49:26 PM UTC-4, David Ripplinger wrote: Is there anywhere else that I can view a copy of the book for the meantime? On Tuesday, July 23, 2013 1:15:42 PM

[web2py] Re: stop form from reposting with refresh

2013-04-20 Thread David Ripplinger
How do I make it so that the form does not resubmit upon clicking the browser reload button even when the form has errors, but still display the errors? I just hate form resubmissions popping up ever. Nobody ever uses that feature of browsers intentionally. On Tuesday, September 28, 2010

[web2py] Re: stop form from reposting with refresh

2013-04-20 Thread David Ripplinger
Furthermore, since I am using custom checks on the validity of data (i.e. I'm doing checks that go way beyond putting a requires object in a Field object), I am currently creating a custom FORM object, and then after form.accepts passes, I check if adding in the data raises exceptions. If an

[web2py] Re: stop form from reposting with refresh

2013-04-20 Thread David Ripplinger
Here is an example form created and handled in the controller's index() function: addCategoryForm = FORM('Add category:', INPUT(_name='category', requires=IS_NOT_EMPTY()), INPUT(_type='submit')) if addCategoryForm.accepts(request, session, formname='addCategory'):

[web2py] Re: Will web2py support database view? When?

2013-04-18 Thread David Ripplinger
I'm not familiar with the Django way. Web2py is my first serious attempt at web programming. What is the Django way, or (alternatively) what is the cleanest way, to use database views in web2py? Should I just do the define_table with migrate=False described by Vasile in this thread, or is

[web2py] Re: gluon.contrib.stripe not working: No JSON object could be decoded

2013-04-13 Thread David Ripplinger
I thought I'd let other people know what I'm doing for a workaround. Until it comes time for me to purchase a paid account with pythonanywhere, I plan to add a variable to my app called FREE_PA_ACCOUNT and set it to true. Then any time I have code that attempts to do a charge, refund, check, or

[web2py] Where do I change the size of the editor object in admin?

2013-04-13 Thread David Ripplinger
In the latest version of webpy (2.4.6), when I use the web-based editor in the admin application, it places the editable code in an html object with fixed size and a scroll bar. I can only see 15 lines of code at a time, which makes it harder to work with the code. I would like to increase the

[web2py] Re: Where do I change the size of the editor object in admin?

2013-04-13 Thread David Ripplinger
@Anthony: I observed the same thing with an older version of web2py before upgrading. But after the upgrade, it is a fixed size inner window with a scroll bar that behaves as expected. Are you running a version of web2py older than 2.4.6? If so, you probably won't observe the behavior I'm

[web2py] Re: Where do I change the size of the editor object in admin?

2013-04-13 Thread David Ripplinger
Update: This is weird. I just logged in again and it is reverting to the old behavior. Strange that even in the same version it sometime behaves one way and sometimes another. Oh well. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To

[web2py] Two databases with an auth in each

2013-04-13 Thread David Ripplinger
In my project, it makes a lot of sense to have two separate databases: one for the users of the app and another for partners who pay to advertise to those users. The data they manipulate are completely different sets. I have created an auth object (named auth) for the users database (called db)

[web2py] Re: Two databases with an auth in each

2013-04-13 Thread David Ripplinger
with this approach). Anyway, this is exactly what the roles and permissions aspects of the Auth system are designed to address. Why not just create user and partner roles and use @auth.requires_membership(...)? Anthony On Saturday, April 13, 2013 12:32:36 PM UTC-4, David Ripplinger wrote: In my project

[web2py] Re: gluon.contrib.stripe not working: No JSON object could be decoded

2013-04-12 Thread David Ripplinger
://stackoverflow.com/questions/14390605/python-requests-ssl-issue). Pythonanywhere seems to want to close this issue, but I will see if something better can be worked out. On Thursday, April 11, 2013 10:29:34 PM UTC-4, David Ripplinger wrote: I found the message from the u.read(). It is an html

[web2py] gluon.contrib.stripe not working: No JSON object could be decoded

2013-04-11 Thread David Ripplinger
Just to see if I could get it to work, I tried the simple example of using Stripe found here in the online bookhttp://web2py.com/books/default/chapter/29/14#Stripe.com. Even for the default welcome app, with the code added to the index controller, I get the error No JSON object could be

[web2py] Re: Broken links on web2py.com downloads page?

2013-04-11 Thread David Ripplinger
Me too. Please somebody fix this. On Thursday, April 11, 2013 2:33:59 PM UTC-4, Michael Ellis wrote: Just tried downloading web2py from web2py.com and repeatedly got 502 Bad Gateway. Tried from 2 different machines, including the one from which I'm sending this post. -- --- You

[web2py] Re: Broken links on web2py.com downloads page?

2013-04-11 Thread David Ripplinger
I just tried it again and it is working now (at least the win version for normal users). If somebody did something to fix it, thank you. On Thursday, April 11, 2013 2:47:44 PM UTC-4, David Ripplinger wrote: Me too. Please somebody fix this. On Thursday, April 11, 2013 2:33:59 PM UTC-4

[web2py] Re: gluon.contrib.stripe not working: No JSON object could be decoded

2013-04-11 Thread David Ripplinger
Update: I just downloaded web2py onto my local machine and ran it with the gluon.contrib.stripe code successfully. So it seems that my error is specific to running it on pythonanywhere. On Thursday, April 11, 2013 1:55:49 PM UTC-4, David Ripplinger wrote: Just to see if I could get it to work

[web2py] Re: gluon.contrib.stripe not working: No JSON object could be decoded

2013-04-11 Thread David Ripplinger
Here's the traceback: Traceback (most recent call last): File /home/davidrip/web2py/gluon/restricted.py, line 212, in restricted exec ccode in environment File /home/davidrip/web2py/applications/budget1/controllers/default.py

[web2py] Re: gluon.contrib.stripe not working: No JSON object could be decoded

2013-04-11 Thread David Ripplinger
I found the message from the u.read(). It is an html message: --- ERROR The requested URL could not be retrieved -- The

[web2py] integrating the stripe library into web2py

2013-04-10 Thread David Ripplinger
I'm recently learning about Stripe, and so far it seems like a great option for credit card processing. I noticed that there is a very simple add-on Massimo wrote to do Stripe charges and similar actions, but it does not seem to at all follow the pattern Stripe was intended to be used.

[web2py] Re: integrating the stripe library into web2py

2013-04-10 Thread David Ripplinger
UTC-5, David Ripplinger wrote: I'm recently learning about Stripe, and so far it seems like a great option for credit card processing. I noticed that there is a very simple add-on Massimo wrote to do Stripe charges and similar actions, but it does not seem to at all follow the pattern Stripe

[web2py] Query with multiple constraints

2013-03-25 Thread David Ripplinger
I want to create a query object with multiple constraints, just like adding commas in the WHERE clause of an sql query. I tried the intuitive constraint1 and constraint2 but it just took constraint2 and ignored constraint1 (probably because the key word and isn't overridden and when applied to

Re: [web2py] Query with multiple constraints

2013-03-25 Thread David Ripplinger
Python-like complex boolean expressions by overriding the key words and, or, and not. On Monday, March 25, 2013 12:15:26 PM UTC-4, Jonathan Lundell wrote: On 25 Mar 2013, at 9:13 AM, David Ripplinger dal...@gmail.comjavascript: wrote: I want to create a query object with multiple constraints

Re: [web2py] Query with multiple constraints

2013-03-25 Thread David Ripplinger
Ok, I found it in the book. For any who might come across this post and be wondering where it is, it is not actually under the Queries section. It is in a subsection of Select, under the heading Logical Operators (in the chapter on the Data Abstraction Layer):

[web2py] How to exclude some fields from a form for a database record?

2013-03-22 Thread David Ripplinger
I recently found out how to add an additional field to the auth_user table, but then I found that the registration page for a new user has a spot in the form to input a value for the extra field. In many cases, this is desired, but I want this particular field to not appear in the registration

[web2py] Re: How to exclude some fields from a form for a database record?

2013-03-22 Thread David Ripplinger
in the registration form. On Thursday, March 21, 2013 4:34:47 PM UTC-4, David Ripplinger wrote: I recently found out how to add an additional field to the auth_user table, but then I found that the registration page for a new user has a spot in the form to input a value for the extra field. In many