Elf M. Sternberg

Full Stack Web Developer

Where one teaches, two learn.

Tag: #python

To all tags

Serializing SqlAlchemy to Json

During a recent "take-home exam" for a job interview, I was confronted with the common challenge of extracting information via SQLAlchemy, a popular ORM layer for Python, and converting it to JSON. The most popular answer on Stack Overflow involves writing some code to do a conversion that ought to be present natively in the SQLAlchemy library but apparently not.

After looking through the various answers, I was dissatisfied with all of them, so I fired up a Python REPL and started digging into SQLAlchemy itself from the outside. I dislike this sort of "empirical" software development but I dislike a raft of code when there must be a simpler solution.

There was.

Using Git Secrets

In my Using PDM posts, I mentioned that I was rebuilding the backup tools for my blog. Using such tools requires that I keep a couple of my passwords, the ones I use for databases, in plain text, which is clearly not ideal, especially not if I want to use GIT to manage them. I decided to try using git secret to store my credentials. Here's how it works.

Using PDM: The Python Dependency Manager

Since it looks as if Twitter's days are numbered, I've been looking at what it would take to move most of my on-line presence into my personal blog space and off of the various sites where I make various comments and such. One thing I haven't been doing well is backing up this site right here; my last backup was over two years ago. That's... not good.

Django Signals enable Aspect-Oriented programming.

How to post to a facebook user's Newsfeed via Python and Django

Django: Generating static javascript and CSS with reversed URLs via Templates

Perl is not Python, and other painfully obvious musings...

Bog-stupid Ajax round trips with Prototype and Django

Fixing an omission from Django's simplejson: iterators, generators, functors and closures

Template recursion in Django with Treebeard

Python can be just as ugly as PHP...

Doing basic tests with FireWatir and TDD

I've put up my resume.

Mass Gaffitter

C __LINE__ equivalent in Python

I write code the way I write prose.

Anything you can do, I can do better / I can do anything better than you...

Web development is game development minus two lines of code

Ruby, Python, and references to functions...

DWIM HTML Templating in Python

Toward a Web Application

Step 1: Install Webware