Archives 2011

Requests Library is nice

Experimented with replacing a few urllib2 calls in a product today with the requests library.  Yes, requests really is nice (sat down and read through the code last night).  One thing that's not obvious from the docs, to do digest auth, you pass (username, password, 'digest') as the auth parameter.  There are a number ...

Continue reading

Run coverage of your Django test suite...

Since there is a 4-year old still-open ticket on this, thought I'd provide a simple recipe for getting a coverage report on your Django project:

pip install coverage
coverage run path/to/django-admin.py test myapp
coverage report -m --include="*myapp*"
coverage erase # clean up afterward/between runs

Sure, it's not --with-coverage, but it does seem to work.

Choices for Foo?

The choices_for_FOO hook would allow a model to restrict the choices for a given field based on e.g. another field (common requirement where you have row-level authorization and need to restrict choices to the set of records accessible by the auth-row attached to this object).  It's currently a patch attached to a 5 year old ...

Continue reading

FakeLion rides the PyPI

Put a bit more work into FakeLion (L10N, get it) this afternoon to see how a particular project is doing on getting i18n coverage.  I added some quick flags so you can suppress HTML-code escaping, suppress Python string-subs escaping, disable the reversing of strings, and use full-width-latin substitution characters (which does a pretty good job ...

Continue reading

Quick Hack to do Psuedo-Localization (l10n)

Pseudo-localization lets you easily see which strings in your site are not yet marked for translation.  That's pretty useful if you don't yet have a real translation, but want to check whether someone could do a translation if you paid them to do so.  Didn't find a good package freely available (though I imagine there ...

Continue reading

Kubuntu 11.04 Install on Dell XPS 8300

Just some notes on the install:

  • live cd boots and runs perfectly well
  • needed to reboot into windows, run chkdsk /f (with administrator privileges) and then reboot twice into windows to get the disk into consistent state
  • installed image fails trying to log into KDE, installed image appears to use the open-source ati drivers; these ...

Continue reading

Scotland Street School by Charles Rennie Mackintosh

As mentioned a long time ago in the midst of some speculation; we were able to tour the Scotland Street School while in Glasgow.  This was Mackintosh's last built work (during his life).  I've uploaded our photos from the School to a Picasa album so that people wanting a reference to what's being discussed ...

Continue reading

Django + JQuery Mobile Quick Start Tutorial

I've uploaded a tutorial and a very minimal library for creating JQuery Mobile sites with Django.  It's actually the first time I've used PyPI's documentation hosting system, mostly because Launchpad doesn't have a web-page hosting mechanism.  The library (django-jqm) is not intended to be a platform for creating "real" sites, it's just a bunch of ...

Continue reading

JQuery Mobile Django Baseline

Playing with a JQuery Mobile baseline template for Django this afternoon. Just a set of templates, urls, static files, etceteras which give a "mobile app-like" base from which to begin development in a new project. I'm not particularly satisfied with it yet; I coded it directly into a "regular" app, and it really should have ...

Continue reading

Monthly archives

Previous year

2010

Next year

2012