From the announcements for Rails 3:
The upcoming version 3 of Ruby on Rails will feature a sexy new querying API from ActiveRecord. Here is an example:
User.order(‘users.id DESC’).limit(20).includes(:items)
In other words, Rails is now Django.
Also:
Each application now has it’s own name space, application is started with YourAppName.boot for example, makes interacting with other applications a lot easier.
Rails [...]
07 Dec
Posted by Elf Sternberg as programming, python
Java is Pass-By-Value, Dammit!
Quite possibly the most important article I’ve ever read, because it finally, finally explains to me what Java’s object-passing model is really all about. I’ve never understood it, and now I do: it’s exactly backwards from pass-by-reference, so it’s exactly backwards from the languages with which I grew up. The [...]
24 Nov
Posted by Elf Sternberg as django, programming, python, web development
So, I got tired of the way Django-SocialAuth was borked and not working for me, so I forked the project and have put up my own copy at GitHub.
There are three things I noticed about the project right away: First, it forces you to use a broken templating scheme. I haven’t fixed that, but [...]
20 Nov
Posted by Elf Sternberg as programming, python, ruby, web development
This is part 4 of a series.
So far, we’ve written a basic Django application, written some tests for it, checked everything into a central repository, and then integrated those tests with the Hudson continual integration server.
But Django’s tests run in a kind of pseudo-server mode, with both the tests and the application running inside the [...]
20 Nov
Posted by Elf Sternberg as django, programming, python
For the past few days, this has been bugging the Hell out of me and I finally decided today to knuckle down and figure out how the hell Python decorators-with-arguments work.
Basic Decoration
The basics: A python function takes arguments, performs a task, and returns a value. A decorator takes as its argument a function, [...]
16 Nov
Posted by Elf Sternberg as programming, python
Google last week released Google Go, a new programming language designed to be “more C-like” (a kind of python/C#/Java mash-up of a language) with support for Erlang’s excellent concurrency management, which allows you to write programs that can do lots of different little things at the same time on machines that have multiple CPU’s. [...]
12 Nov
Posted by Elf Sternberg as django, programming, python, web development
This is part 3 of a series.
In part 1 we set up a Hudson test server, and in part 2 I introduced a simple Django application with some simple tests.
Now we’re going to make Hudson run those simple tests. Prerequisites: Your box for running this application must be able to run both Hudson and [...]
12 Nov
Posted by Elf Sternberg as django, programming, python, web development
This is Part 2 of a series.
Before I demonstrate how to do continual integration testing, I need a demonstration application. I’ve chosen a simple Django application, your basic echo program, with no styling or media at all. This ought to be more than enough to demonstrate base functionality.
A New Django Project
Start by building [...]
20 Oct
Posted by Elf Sternberg as personal, programming, python
Do you have that one thing that you have to constantly look up?
In python, to replace elements of a string, there are two operators. One is a strictly linear search, the other uses regular expressions. The regexp call to replace part of a string with another string is sub, and the string call to replace [...]
We frequently write little functions that populate the Django context, and sometimes we want that context to be site-wide, and we want every page and every Ajax handler, basically everything that takes a request and spews a response, in our application to have access to that information. It might the user’s authentication, or his authorization, [...]