[web2py] Re: Setting default function in default controller with parametric router

2014-02-18 Thread HittingSmoke
I only just realized that I can set a routes.py file in the application directory. Got it all set up using the examples contained in applications/app/routes.example.py. On Monday, February 17, 2014 8:31:58 PM UTC-8, HittingSmoke wrote: I would like to change my 'index' function to 'page' so

[web2py] Pagination example from book. Make pages start at 1?

2014-02-18 Thread HittingSmoke
I followed the pagination tutorial in the web2py book and I have the following controller: def index(): if len(request.args): page=int(request.args[0]) else: page=0 items_per_page=6 limitby=(page*items_per_page,(page+1)*items_per_page+1) posts=db().select(db.post.ALL,

[web2py] Re: View does not display datetime in format chosen in database.

2014-02-17 Thread HittingSmoke
It was {{=P(post.date)}} but I've since changed it to prettydate. I'm still curious what the solution is though. On Monday, February 17, 2014 3:13:33 AM UTC-8, Niphlod wrote: how is it called in the view ? On Sunday, February 16, 2014 8:23:53 PM UTC+1, HittingSmoke wrote: I have

[web2py] If session cookie exists /user/register redirects to /user/profile even if user has been deleted.

2014-02-17 Thread HittingSmoke
This appears to be a bug. You can recreate it by creating a user with auth then logging in with the remember me box checked. Then empty the user table in the database. Go to /user/register and you will be redirected to /user/profile with an Object not found error. Clearing cookies fixes the

[web2py] View performance. Helpers vs raw HTML?

2014-02-17 Thread HittingSmoke
I'm curious if there's any notable performance overhead with using helpers. I have the following to list database entries on my home page: ul class=thumbnails {{for i,post in enumerate(posts):}} {{if i==items_per_page: break}} {{=LI( DIV( A(IMG(_src=URL('static', 'content', 'thumbs',

[web2py] Re: View performance. Helpers vs raw HTML?

2014-02-17 Thread HittingSmoke
://stackoverflow.com/a/8095585/440323). Anthony On Monday, February 17, 2014 5:19:19 PM UTC-5, HittingSmoke wrote: I'm curious if there's any notable performance overhead with using helpers. I have the following to list database entries on my home page: ul class=thumbnails {{for i,post in enumerate

[web2py] Setting default function in default controller with parametric router

2014-02-17 Thread HittingSmoke
I would like to change my 'index' function to 'page' so that when someone calls a specific page and the router doesn't remove the controller name from the url it will say 'page/1' instead of 'index/1'. I found this answer via a search:

[web2py] Apply class to MARKMIN helper?

2014-02-16 Thread HittingSmoke
So with other helpers I can do things like P(db.table.field, _class=text-centered) to center the text in a paragraph tag generated by the P helper. Is there any way to do the same with the MARKMIN helper? I have {{=MARKMIN(post.caption)}} set for a photo blog app so I can easily style my

[web2py] View does not display datetime in format chosen in database.

2014-02-16 Thread HittingSmoke
I have the following in my model: Field('date', 'date', default=datetime.date.today(), requires = IS_DATE( format=('%B %-d, %Y')), writable=False,readable=False), ...and in the appadmin database entry form the date displays in the format I've chosen. However when db.mytable.date is called

[web2py] Re: Serving images uploaded with Field('file', 'upload') as static assets?

2014-02-15 Thread HittingSmoke
Pierro wrote: def index(): form=SQLFORM(db.post).process() if form.accepted: redirect(URL('download',args=form.vars.file)) return dict(form=form) def download(): return response.download() # already in scaffolding app! On Friday, 14 February 2014 18:08:25 UTC-6, HittingSmoke

[web2py] Simple optimize image on upload

2014-02-15 Thread HittingSmoke
I've found a few scripts around the web for this but all of them seem far more complicated than needed and don't fit into my image upload script. Here is what I'm trying: def optimizeImage(rawImage): import os, uuid from PIL import Image postImage =

[web2py] Re: Simple optimize image on upload

2014-02-15 Thread HittingSmoke
I stramlined the upload script to: def new(): form=SQLFORM(db.post).process() if form.accepted: from PIL import Image rawImage = Image.open(db.post.file) resImage = rawImage.resize((800,600),Image.ANTIALIAS) resImage.save(db.post.file, quality=70)

[web2py] Serving images uploaded with Field('file', 'upload') as static assets?

2014-02-14 Thread HittingSmoke
I'm building my first public facing app with web2py using the basic image blog example from the docs but I'm concerned about performance. I'd like to have an upload form so I can post images to a blog with basic captions. I don't need any security for viewing so I'd like to have them served

[web2py] Not indexable error when disabling app from admin

2013-09-18 Thread HittingSmoke
I'm getting: type 'exceptions.TypeError' not indexable ...when trying to disable my Welcome app from the admin interface. Code listing: 577. 578. 579. 580. 581. 582. 583. 584. 585. 586. return [] def keys(self): Dictionary style keys() method. if self.list is

[web2py] Editing menu.py giving errors

2013-09-18 Thread HittingSmoke
. Traceback (most recent call last): File /home/hittingsmoke/web2py/gluon/restricted.py, line 217, in restricted exec ccode in environment File /home/hittingsmoke/web2py/applications/Community_Deployment/models/menu.py https://communitydeployment.com/admin/edit/Community_Deployment/models

[web2py] Re: Not indexable error when disabling app from admin

2013-09-18 Thread HittingSmoke
Apologies. It is: 2.6.3-stable+timestamp.2013.09.15.17.01.20 On Wednesday, September 18, 2013 4:08:48 PM UTC-7, Massimo Di Pierro wrote: Which version? On Wednesday, 18 September 2013 15:56:28 UTC-5, HittingSmoke wrote: I'm getting: type 'exceptions.TypeError' not indexable ...when

[web2py] Re: Version in admin lists (Running on %s) instead of providing server info

2013-08-21 Thread HittingSmoke
Interesting. I'm not sure if it's is relevant, but I'm using a very barebones nginx+uwsgi setup compiled from source. I may be misinterpreting your comment but it sounds like you're saying it should work with nginx+uwsgi. That's exactly what I'm using. On Tuesday, August 20, 2013 11:19:52 PM

[web2py] Re: Version in admin lists (Running on %s) instead of providing server info

2013-08-21 Thread HittingSmoke
tracker. Thanks. On Wednesday, August 21, 2013 12:20:13 AM UTC-7, Niphlod wrote: do you have that line in yout nginx config ? On Wednesday, August 21, 2013 9:12:50 AM UTC+2, HittingSmoke wrote: Interesting. I'm not sure if it's is relevant, but I'm using a very barebones nginx+uwsgi setup

[web2py] Serving static assets in nginx.

2013-08-21 Thread HittingSmoke
I've been going back over my configuration compared to various other deployment recipes after realizing I was missing some non-critical uwsgi related parameters. I noticed my static location block in nginx was different than the one recommended in the web2py nginx+uwsgi setup script. Here's

[web2py] Re: Serving static assets in nginx.

2013-08-21 Thread HittingSmoke
/default/chapter/29/13/deployment-recipes#Compress-static-files On Wednesday, August 21, 2013 8:59:18 PM UTC+2, HittingSmoke wrote: I've been going back over my configuration compared to various other deployment recipes after realizing I was missing some non-critical uwsgi related parameters

[web2py] Re: Serving static assets in nginx.

2013-08-21 Thread HittingSmoke
It looks like the zip_static_files.py script only gzips css and js files. There's a lot more that can be compressed, such as web fonts and vector graphics. I understand why jpg and png images are left out, but why only css and js? On Wednesday, August 21, 2013 11:59:18 AM UTC-7, HittingSmoke

[web2py] Version in admin lists (Running on %s) instead of providing server info

2013-08-20 Thread HittingSmoke
Long ago web2py used to provide which python version it was running on in the admin interface. Now all I see is (Running on %s) in the admin console under the web2py version. How can I fix this to see which python version web2py is using? -- --- You received this message because you are

[web2py] Re: Version in admin lists (Running on %s) instead of providing server info

2013-08-20 Thread HittingSmoke
Submitted. Thanks. On Monday, August 19, 2013 11:26:08 PM UTC-7, Massimo Di Pierro wrote: Good point. Please open a ticket about this. On Tuesday, 20 August 2013 01:00:02 UTC-5, HittingSmoke wrote: Long ago web2py used to provide which python version it was running on in the admin

[web2py] Re: bootstrap 3

2013-08-20 Thread HittingSmoke
Bootstrap has gone to flat design for its default theme. This is generally the direction web design is taking. It's more sleek and clean out of the box. If people want a raised theme BS 3 offers themes to return to the original design so the new version is more about choice and easier

[web2py] Re: Version in admin lists (Running on %s) instead of providing server info

2013-08-20 Thread HittingSmoke
is provided from the underlying server, but it's not required. However I'll send a patch for having Running on unknown, Python 2.7.3 to leave out the %s. On Tuesday, August 20, 2013 8:30:34 PM UTC+2, HittingSmoke wrote: Submitted. Thanks. On Monday, August 19, 2013 11:26:08 PM UTC-7, Massimo Di

[web2py] Re: bootstrap 3

2013-08-20 Thread HittingSmoke
I'm just glad to see this is being looked into. I think BS3 is an improvement over 2. I know it's not just a simple flip of the switch but it would be nice to see official support some time in the future. On Monday, July 29, 2013 7:01:47 AM UTC-7, Niphlod wrote: just to inform everybody that

[web2py] anyserver.py gevent to socket.io/sockjs

2013-05-13 Thread HittingSmoke
I know chat has been beaten to death around here but IMO there hasn't been any quality implementations or answers yet. There are dozens of blogs and posts about it, most of which are solutions that no longer work or are ridiculously overcomplicated solutions with duplicated code between python

[web2py] Specify python version for web2py

2013-05-13 Thread HittingSmoke
I thought this would be simple but I can't seem to find the answer. I run web2py on Webfaction via uWSGI and a shared Nginx instance. Web2py runs on the default 2.6.6 python install which I have no control over. I would like it to run on python 2.7 where I install my modules. I'm having issues

Re: [web2py] anyserver.py gevent to socket.io/sockjs

2013-05-13 Thread HittingSmoke
Pedroso wrote: On Mon, May 13, 2013 at 9:18 PM, HittingSmoke hittin...@gmail.comjavascript: wrote: I know chat has been beaten to death around here but IMO there hasn't been any quality implementations or answers yet. There are dozens of blogs and posts about it, most of which

[web2py] Are there any future plans for native social login in auth?

2013-03-28 Thread HittingSmoke
I know web2py supports Janrain but they charge for what's basically an inert layer of code between your app and the login system. It seems silly to use it. It would be nice to see these features baked into auth, where one could put in an API key for the most popular social login services

Re: [web2py] Changed date to datetime. Now I get: invalid literal for int() with base 10:

2013-01-07 Thread HittingSmoke
January 2013 20:45:34 UTC-6, HittingSmoke wrote: Yep, SQLITE. But I completely wiped the database from the disk in web2py/applications/application/databases and let web2py write a completely new one. Wouldn't I not need to alter anything if web2py has created a fresh database with the proper

[web2py] Is it possible to define how a field is rendered in the DB model?

2013-01-07 Thread HittingSmoke
For instance, could I set a field in the database to be always rendered in Markmin or sanitized HTML instead of in the view every time it's queried? --

[web2py] Re: Is it possible to define how a field is rendered in the DB model?

2013-01-07 Thread HittingSmoke
UTC+1, HittingSmoke wrote: For instance, could I set a field in the database to be always rendered in Markmin or sanitized HTML instead of in the view every time it's queried? --

[web2py] IS_EMPTY_OR for spam bot filtering?

2013-01-06 Thread HittingSmoke
Can I use IS_EMPTY_OR to require a field is completely empty, basically leaving out the OR part? I'd like to make a hidden field in a form that is required to be empty to help filter out spam bots on a form. --

[web2py] Re: IS_EMPTY_OR for spam bot filtering?

2013-01-06 Thread HittingSmoke
:39 PM UTC+1, HittingSmoke wrote: Can I use IS_EMPTY_OR to require a field is completely empty, basically leaving out the OR part? I'd like to make a hidden field in a form that is required to be empty to help filter out spam bots on a form. --

[web2py] Can't get auth_user.first_name from referenced comment author field.

2013-01-06 Thread HittingSmoke
I'm trying to get my comment page to show the comment author by first and last name. Unfortunately I can't get it to display anything but user ID. My db model: db.define_table('comments', Field('author', db.auth_user, default=auth.user_id, writeable=False), Field('postedon', 'date',

[web2py] Changed date to datetime. Now I get: invalid literal for int() with base 10:

2013-01-06 Thread HittingSmoke
I changed date to datetime in my comments database model and now after submitting a comment I can't load the comment function. I figured I just broke the database with the switch and tried to wipe it to start over. That didn't work though. In appadmin if I go to the comments table I get the

Re: [web2py] Changed date to datetime. Now I get: invalid literal for int() with base 10:

2013-01-06 Thread HittingSmoke
Yep, SQLITE. But I completely wiped the database from the disk in web2py/applications/application/databases and let web2py write a completely new one. Wouldn't I not need to alter anything if web2py has created a fresh database with the proper field types? On Sunday, January 6, 2013 6:37:48 PM

[web2py] jqueryui and bootstrap.js

2013-01-01 Thread HittingSmoke
I have some experience with Boostrap and the associated javascript tools it comes with. I just stumbled across the jQueryUI lines in layout.html last night so I thought I'd look it up. It would seem to me there's quite a bit of overlap in the functionality of the two. I'm curious why jQueryUI

[web2py] routes.py rules giving intermittent incorrect controller calls to /default

2012-12-31 Thread HittingSmoke
I've been seeing this over the past week or so since I started separating my apps into subdomains using the parametric router. My entries are simple: routers = dict( BASE = dict( domains = { 'domain.com' : 'blog', 'chat.domain.com' : 'chat',

Re: [web2py] routes.py rules giving intermittent incorrect controller calls to /default

2012-12-31 Thread HittingSmoke
, December 31, 2012 11:00:19 AM UTC-8, Jonathan Lundell wrote: On 31 Dec 2012, at 10:36 AM, HittingSmoke hittin...@gmail.comjavascript: wrote: I've been seeing this over the past week or so since I started separating my apps into subdomains using the parametric router. My entries

[web2py] Has anyone made a simple chat system with websocket_messaging.py? General questions about chat.

2012-12-30 Thread HittingSmoke
I was randomly tinkering around and discovered websocket_messaging.py I've got that running and it appears to be receiving messages from the sample functions but I can't seem to get them to actually display in the browser. I was wondering if there was some sort of nice, canned websocket

Re: [web2py] Can the parametric router 301 redirect from www?

2012-12-28 Thread HittingSmoke
of the parametric router so I was hoping it would be possible there. Maybe it's something that could be added to the newer router at some point. On Friday, December 28, 2012 7:39:36 AM UTC-8, Jonathan Lundell wrote: On 27 Dec 2012, at 10:31 PM, HittingSmoke hittin...@gmail.comjavascript: wrote: Pretty

[web2py] Re: Can the parametric router 301 redirect from www?

2012-12-28 Thread HittingSmoke
. On Thursday, December 27, 2012 10:31:01 PM UTC-8, HittingSmoke wrote: Pretty straight forward question. Can I use the parametric routes.py language to 301 redirect from www.domain.com to domain.com for proper search engine crawling? --

[web2py] Can the parametric router 301 redirect from www?

2012-12-27 Thread HittingSmoke
Pretty straight forward question. Can I use the parametric routes.py language to 301 redirect from www.domain.com to domain.com for proper search engine crawling? --

[web2py] Re: Script for nginx/uWSGI/web2py install on Webfaction

2012-12-18 Thread HittingSmoke
Then, in my web2py/applications/[my_app]/ folder, I put a symbolic link called static to the above folder. Seems to do the trick. On Monday, December 17, 2012 7:17:35 PM UTC, HittingSmoke wrote: Bah, I actually asked a Webfaction staff member if this were possible and I was told

[web2py] Re: Script for nginx/uWSGI/web2py install on Webfaction

2012-12-17 Thread HittingSmoke
, HittingSmoke wrote: I've been learning web2py on Webfaction off and on for a while now. The web2py install script on the Webfaction wiki is quite outdated and runs on an Apache instance that can barely stay within the default memory limits without serious tweaking. Responsiveness with web2py

[web2py] Re: Script for nginx/uWSGI/web2py install on Webfaction

2012-12-17 Thread HittingSmoke
, 2012 7:17:35 PM UTC, HittingSmoke wrote: Bah, I actually asked a Webfaction staff member if this were possible and I was told no, that the frontend Nginx server could only be used on static/PHP sites. Now that I'm looking into it I'm seeing one major issue that without proper configuration

[web2py] Re: Webfaction Deployment and Tuning Web2py Slice.

2012-12-16 Thread HittingSmoke
How do you do this on Webfaction (use web2py/uwsgi with the native nginx instance)? I've asked for this specifically and been told by Webfaction staff that it's not actually possible to use a framework with the native nginx instance, only with static and PHP apps. Right now I'm using a custom

[web2py] Script for nginx/uWSGI/web2py install on Webfaction

2012-12-16 Thread HittingSmoke
I've been learning web2py on Webfaction off and on for a while now. The web2py install script on the Webfaction wiki is quite outdated and runs on an Apache instance that can barely stay within the default memory limits without serious tweaking. Responsiveness with web2py/apache out of the box

[web2py] Re: Getting an error in auth.wiki()

2012-10-27 Thread HittingSmoke
() to work? I am sure that I am missing something here, or there is a bug in the way auth.wiki() is supposed to work. Simon On Saturday, 27 October 2012 04:18:09 UTC+1, HittingSmoke wrote: Default is your controller. You're running auth.wiki under the index function of the default controller

[web2py] Re: WIKI or plugin wiki?

2012-10-26 Thread HittingSmoke
I feel like I read Massimo say somewhere that plugin_wiki will be deprecated when auth.wiki is more complete and documented but don't quote me on that. On Friday, October 26, 2012 1:57:29 PM UTC-7, Niphlod wrote: can't say if plugin_wiki is going to be updated further, but auth.wiki() is

[web2py] Re: Getting an error in auth.wiki()

2012-10-26 Thread HittingSmoke
Default is your controller. You're running auth.wiki under the index function of the default controller. Your auth.wiki pages are called with auth.wiki so you need your index function which is where auth.wiki is. You could hide the function part of the URL using routing if you want. On Friday,

Re: [web2py] page min height

2012-10-26 Thread HittingSmoke
Sticky footers are not well supported in CSS. There are several popular implementations and are all hacked together workarounds, most of which use javascript and nearly all of which break very easily and have poor cross-browser compatibility. I wouldn't want to see something like this baked

[web2py] Is it possible to modify user_identifier from auth.navbar in a model?

2012-10-24 Thread HittingSmoke
I'm trying to get auth.navbar to display a username after Welcome instead of trying to display first_name which does not exist in my auth table. I'm not a python wiz, I'm learning it as I learn web2py. I see this in the source code: def

[web2py] Re: Is it possible to modify user_identifier from auth.navbar in a model?

2012-10-24 Thread HittingSmoke
-4, HittingSmoke wrote: I'm trying to get auth.navbar to display a username after Welcome instead of trying to display first_name which does not exist in my auth table. I'm not a python wiz, I'm learning it as I learn web2py. I see this in the gluon.tools source code: def navbarhttp

[web2py] Re: Multiple domains on the same application

2012-10-22 Thread HittingSmoke
I'm pretty sure you can do this with routes.py routers = dict( BASE = dict( domains = { 'domain1.com' : 'app/contoller1', 'domain2.com' : 'app/controller2', } ), ) On Monday, October 22, 2012 10:48:19 AM UTC-7, Tito Garrido wrote: Hi Folks!

[web2py] auth.wiki suggestion: Don't automatically display article title

2012-10-21 Thread HittingSmoke
Markmin includes the markup to display the title where you want it. I believe the title being automatically displayed should be removed so we can choose whether to include it using *#Markmin* or add a way to disable it, such as MediaWiki's __NOTITLE__ flag. --

[web2py] Re: Where does auth.wiki save pages to?

2012-10-21 Thread HittingSmoke
see an option under the [wiki] menu that says manage pages. On Friday, October 19, 2012 11:47:55 PM UTC-5, HittingSmoke wrote: I can't find them in my database... I'm trying to build a basic blog using auth.wiki but without documentation and without database references I have no way

[web2py] Re: Where does auth.wiki save pages to?

2012-10-21 Thread HittingSmoke
I was thinking more like a db call that would display previews of the ten most recently submitted articles. Sorted by db.wiki_page.created_on On Sunday, October 21, 2012 4:06:26 PM UTC-7, Bill Thayer wrote: Ok, Actually i am just getting there myself on my application. There is a cloud()

[web2py] auth.wiki search is case sensitive, only works with all lower-case?

2012-10-20 Thread HittingSmoke
I was about to submit this as an issue but I figured since it's experimental still I should ask if there's something more behind this behavior that I'm not understanding. I made a wiki page with tags. The tags start with a capital letter (Youtube) because I'm anal about such things. When I

[web2py] Re: auth.wiki search is case sensitive, only works with all lower-case?

2012-10-20 Thread HittingSmoke
. Massimo On Saturday, 20 October 2012 19:25:44 UTC-5, HittingSmoke wrote: I was about to submit this as an issue but I figured since it's experimental still I should ask if there's something more behind this behavior that I'm not understanding. I made a wiki page with tags. The tags start

[web2py] Re: Removing need for first and last name in auth

2012-10-19 Thread HittingSmoke
-5, HittingSmoke wrote: I'd like to use auth with only a username instead of first and last name. I defined my own tables without a first and last name but it still causes issues throughout the app. For instance, when I try to use appadmin to add a user to a new auth group I get an error

[web2py] Where does auth.wiki save pages to?

2012-10-19 Thread HittingSmoke
I can't find them in my database... --

[web2py] Plugin_wiki, auth.wiki clarification and routing.

2012-10-18 Thread HittingSmoke
This is a sort of two part question, the second part being conditional on the answer to the first. 1. Is plugin_wiki deprecated for auth.wiki or am I misinterpreting what's going on? I can find some documentation on plugin_wiki but most current discussion seems to be on doing the same things

[web2py] auth.wiki documentation?

2012-10-18 Thread HittingSmoke
I'm trying to build a simple blog with web2py. I see auth.wiki and plugin_wiki are two different entities which as far as I can tell fulfill much the same functions. Is there any advanced documentation on auth.wiki similar to the plugin_wiki chapter in the book? --

[web2py] Subdomain routing with plugin_wiki

2012-10-18 Thread HittingSmoke
I tried installing plugin_wiki for a simple blog app and I can't get it to work with subdomain routing. I had routes.py setup to direct blog.domain.com to my app 'blog'. When I installed plugin_wiki in the blog app I couldn't access it though. Whenever I tried to load

[web2py] Re: Odd behavior with domain routes. Can't undo them.

2012-10-17 Thread HittingSmoke
On Wednesday, October 17, 2012 12:09:51 AM UTC-4, HittingSmoke wrote: I set up my Webfaction hosting with a single web2py install that I intend to use for a couple of subdomains pointing to separate apps using routes.py. I pointed domain.com and blog.domain.com to my web2py app and through

[web2py] Odd behavior with domain routes. Can't undo them.

2012-10-16 Thread HittingSmoke
I set up my Webfaction hosting with a single web2py install that I intend to use for a couple of subdomains pointing to separate apps using routes.py. I pointed domain.com and blog.domain.com to my web2py app and through routes.py told web2py to point blog.domain.com to my blog app that I plan

[web2py] Re: Change redirect if Delete is checked on update form

2012-03-03 Thread HittingSmoke
Wow... I was really overthinking that. Still trying to transition from Javascript to this. Thanks! On Mar 3, 12:25 am, Bruno Rocha rochacbr...@gmail.com wrote: if form.process().accepted:     if request.vars.delete:         redirect(URL('index')) On Sat, Mar 3, 2012 at 4:41 AM, HittingSmoke

[web2py] Re: Change redirect if Delete is checked on update form

2012-03-03 Thread HittingSmoke
...@gmail.com wrote: if form.process().accepted:     if request.vars.delete:         redirect(URL('index')) On Sat, Mar 3, 2012 at 4:41 AM, HittingSmoke hittingsm...@gmail.com wrote: I created a very simple blog and when done editing a post, I am redirected to the updated post. This works great

[web2py] Re: Change redirect if Delete is checked on update form

2012-03-03 Thread HittingSmoke
)    if editBlog.process().accepted:         if request.vars.*delete_record:*            redirect(URL('index'))         else:            redirect(URL(f=view, args=editBlog.vars.idhttp://editblog.vars.id/ ))    return dict(editBlog=editBlog, post=post) On Sat, Mar 3, 2012 at 4:35 PM, HittingSmoke

[web2py] 404 on 'list index out of range' errors?

2012-03-03 Thread HittingSmoke
I'm learning Python and web2py together (I know, not recommended but I'm having fun) by writing a small and simple blog. I've run into a problem with 404s. When my app tries to pull up an invalid blog ID I get a 'list index out of range' error ticket. Ideally these should be 404 pages. Same goes

[web2py] Re: 404 on 'list index out of range' errors?

2012-03-03 Thread HittingSmoke
routes_on_error in routes.py: http://web2py.com/books/default/chapter/29/4#Routes-on-error. Anthony On Saturday, March 3, 2012 4:04:05 PM UTC-5, HittingSmoke wrote: I'm learning Python and web2py together (I know, not recommended but I'm having fun) by writing a small and simple blog

[web2py] Re: Change redirect if Delete is checked on update form

2012-03-03 Thread HittingSmoke
if request.vars.delete_this_record works. If not, add request.toolbar() to the page and inspect request.vars to see all the variable names (don't do a redirect). Anthony On Saturday, March 3, 2012 3:52:50 PM UTC-5, HittingSmoke wrote: Somehow it's still not catching it. I edited the function a bit to make sure

Re: [web2py] Re: 404 on 'list index out of range' errors?

2012-03-03 Thread HittingSmoke
I tried this change and it returns a new error: 'type 'exceptions.AttributeError' 'NoneType' object has no attribute 'title''. The blow example fixed it up though. Thanks. On Saturday, March 3, 2012 7:57:45 PM UTC-8, rochacbruno wrote: On Sun, Mar 4, 2012 at 12:55 AM, HittingSmoke wrote

[web2py] Re: 404 on 'list index out of range' errors?

2012-03-03 Thread HittingSmoke
Thanks. The technical aspects go a bit above my head but this is a good post for me to bookmark and use as a jumping off point for some reading. After switching out .first() but before adding the 404 redirect I was getting a 'type 'exceptions.AttributeError' 'NoneType' object has no

[web2py] Change redirect if Delete is checked on update form

2012-03-02 Thread HittingSmoke
I created a very simple blog and when done editing a post, I am redirected to the updated post. This works great unless I'm deleting a post, in which case it spits out an error because the post no longer exists. How can I tell my controller to check the status of the deleted checkbox before

[web2py] Parse HTML from the database?

2012-01-31 Thread HittingSmoke
Sorry if this is a dumb question. I'm working on a very basic blog and I'd run into a hurdle which I thought would be very trivial. I've skimmed the book looking for an answer but I can't seem to find one. Google searching turns up nothing but dozens of unrelated results. How do I get web2py

[web2py] Re: Parse HTML from the database?

2012-01-31 Thread HittingSmoke
Thanks! At the moment this is just a personal blog that only I'm going to be posting on so security isn't an issue. Once I start expanding it out feature wise then I'll get more into security. I plan on eventually branching it off as a forum app as well so it will be important eventually.

[web2py] Re: Help with auth extra fields

2012-01-31 Thread HittingSmoke
If you're just looking to add fields and not completely redefine your auth table this is really simple. From the web2py book: ## after auth = Auth(db) auth.settings.extra_fields['auth_user']= [ Field('address'), Field('city'), Field('zip'), Field('phone')] ## before

[web2py] Re: Removing need for first and last name in auth

2012-01-30 Thread HittingSmoke
Thank you. The issue has been submitted with a link back to this thread. On Jan 30, 6:51 am, Anthony abasta...@gmail.com wrote: On Sunday, January 29, 2012 7:36:07 PM UTC-5, HittingSmoke wrote: I'd like to use auth with only a username instead of first and last name. I defined my own tables

[web2py] Removing need for first and last name in auth

2012-01-29 Thread HittingSmoke
I'd like to use auth with only a username instead of first and last name. I defined my own tables without a first and last name but it still causes issues throughout the app. For instance, when I try to use appadmin to add a user to a new auth group I get an error (type 'exceptions.KeyError'

[web2py] Re: Remove first and last name from Auth.

2011-11-30 Thread HittingSmoke
Thanks, I'll use this for now.

[web2py] Re: web2py hosting

2011-11-30 Thread HittingSmoke
+1 for Webfaction. It takes a bit of tweaking and configuration to get your app running with the cheapest plan without hitting the RAM limit (which is what I suspect some of the mentioned issues were) but once it's up and running, it works great. I have my apps running on Lighttpd and couldn't

[web2py] Remove first and last name from Auth.

2011-11-29 Thread HittingSmoke
I'd like to remove the first and last name fields from auth but I can't seem to find an easy way to do this. It would seem a more common sense approach to me to keep the defaults to the basics (email, password and username) and let the user decide what to include in their app for optional fields.

[web2py] Web2py plus standard LAMP server functionality?

2011-06-22 Thread HittingSmoke
Is there any way to run a standard PHP web app like vBulletin along side web2py? i.e. www.domain.com would load the web2py site and www.domain.com/vbulletin would load the separate web app without web2py being involved?

[web2py] Re: Web2py plus standard LAMP server functionality?

2011-06-22 Thread HittingSmoke
So I would just use something like the code below in my httpd.conf file? Would this work if I'm using a local IP address instead of a domain as well? NameVirtualHost * VirtualHost * ServerName www.domain.com DocumentRoot /home/web2py /VirtualHost VirtualHost * ServerName