Weblog | 2010
All articles published during 2010.
Using cron and rsync to easily backup your home directory without having to think about it.
A quick little snippet on scaling HTML hex colors.
Accessing an attribute of a record instance using the __dict__
UTF-8 just bombed my website! Remove UTF-8 BOM (byte-order-mark) with python.
How I was able to fix my clicking hard drive by freezing it!
A little trick to effectively stacking multiple decorators with python functions.
Information on my trip down the brazos, and the things I learned for the next time!
I have decided to share some of the libraries that I have found useful when creating web2py apps.
So you are ready to deploy your newly finished web2py app, but you don't like the idea of having to manually insert all of this fixture data again! Create a new model, and name it ``x_fixtures.py``. This way it will execute after all of your models.
Web2py has a nice built-in feature supported execution of byte-code compiled applications. When you compile your application, web2py actually will byte-code compile all models, controllers and views. Web2py is the only framework to date that will compile
If your web server supports the X-Sendfile header, you are able to stream your uploaded files from the web server, instead of through web2py. Here is a snippet from [Cherokee Website] explaining the X-Sendfile header. > X-Sendfile is a special, non
One of the nice things about MS Access is that you can define a query, and it will be accessible to your code anywhere else in the database. You can even base another query off of a query. Making queries inheritable properties. Another nice feature avail
As of web2py version 1.75.1 there is also another argument that can be passed to the DAL constructor to check table names and column names against reserved SQL keywords in target back-end databases. This argument is check_reserved; it defaults to None
Here are a couple of ways to expose any python file-like object as download-able in a web2py controller. You might want to do this if you have a generated pdf report, or allowing an export of the sites content. From your controller, you can stream
So you need to write a query to get rows that exist between dates. This is a situation where the simplicity of the web2py DAL really shows, and how close it is to SQL really shines.
It is possible to define common db columns, e.g. posted_by, posted_on, etc... once and define on theappropriate table to inherit these common columns. The DAL makes this quite easy. You define a Table with the common fields that you would like to i
In many cases you might need a query based on multiple sets of information. Think of a search box, where you would like to provide the option to search in multiple areas (title, content, authors) or exclude these areas. Or a customer management system, i