BlogFeed

Categories

  • Default/Other
  • Computers
  • Friends
  • Family
  • Blog Code
  • Website
  • Programming
  • Open source
  • Scouts
  • School/Educational
  • Math
  • Athletics
  • Journal
  • Quasi-philosophic ramblings
  • Site news
  • Informational
  • Quotes
Protection no

Versioning objects in a Django application

For a project that I've been working on, one thing that I've wanted was the ability to version objects in a Django application, and then go back to old versions and revert or see who made changes. I did a bit of research on what's available to this so I didn't have to implement it myself. In the hopes of saving other people even that effort, I'm posting those (somewhat cleaned up) notes for others to use. The short form is that I picked django-reversion. I haven't yet regretted that, though I definitely haven't used it much yet.

The main things I was considering are:

  • License: if I'm going to use something, I'd kinda prefer it not be "all rights reserved". Just about any OSS license would work, though.
  • Activity and sustainability: I'd like a project that isn't going to break in a couple of years when Django makes a backwards-incompatible change. To this end, I prefer something with recent changes, but also one that's been around for a while (it's hard to tell the difference between "one month old project that will be around in two years" and "random weekend project", but it's a little less likely to disappear if somebody has been actively developing it for years).
  • Documentation: while I'm willing to read the source (and often will when I find bugs or just want to figure out how to do something weird), when getting started I like to have documentation available.
  • Design: this one's a bit wishy-washy. Does the design feel clean, performant, etc.? More than anything else, this is an attribute that I found without really expecting to use it to pick my system.

The information in here is largely from late May, though I did check "latest commit" dates (with the exception of django-reversion, they hadn't really changed --- AuditTrail did grow a partial copyright statement, though).

django-revisions

This app is sometimes known as django-versioning instead (e.g., in the docs), which probably isn't a great sign.

  • License: Berkeley 2-clause (?)
  • Activity and sustainability: First commit August 2010, last commit March 2011. My pull request from May to fix the names in the docs hasn't been acted on at all (as of posting this in July).
  • Somewhat limited documentation

In terms of the technical aspects:

  • Store every version in the table with the model
  • Provide accessors for getting the most recent version
  • Appears not to support linking to a "bundle" (an object, not a version) --- see https://github.com/stdbrouw/django-revisions/issues/5
  • Performance may be an issue --- https://github.com/stdbrouw/django-revisions/issues/9
  • It's not immediately clear to me how to make the admin also save the old version

AuditTrail

  • License: unknown
  • Never had a real website or source code repo, AFAICT --- just a page on the Django wiki
  • Activity and sustainability: first "commit" August 2007, last "commit" August 2010 (except a comment clarifying the license of a bit of the code)
  • Very limited documentation --- just the aforementioned Django wiki page
  • Design: store versions in a shadow table per-model

django-fullhistory

  • Listed under "Models, database, history, trails" on Django resources page
  • License: GPLv2
  • Activity: first commit August 2008, last January 2010

On the technical front:

  • Store all versions of all models in a single table, using JSON
  • Metadata (time, editor, some other stuff) stored unpickled

django-reversion

  • License: Berkeley 3-clause
  • Activity: first commit September 2008, last July 2011 (was April 2011 in May)
  • Decent-looking documentation

On the technical front:

  • Store all versions of all models in a single table, pickled
  • Metadata (time, editor, comment) stored unpickled
  • I'm a bit concerned that the "here are the changes that have been made" view might be too slow; as long as we limit to editor and time this should be fine

Conclusion

As I mentioned, I picked django-reversion (after a brief trial of django-revisions, which I decided wasn't working out). I think the high-looking chances of actually being updated and decent docs convinced me. In terms of design, I think I prefer the shadow-table-per-model approach of AuditTrail, but...

So far, the django-reversion upstream looks active and responsive, which is nice (though I haven't had to file any bugs or pull requests yet, so I could be mistaken).

Categories:

  • Computers
  • Programming
  • Open source
  • Informational
Protection no

UChicago Splash: Splash itself

A couple months ago was UChicago Splash. I already wrote a post about the logistics of the visit, but I promised to write something about the event itself.

Splash itself was very different from MIT Splash.

I taught the same Copyright class that I taught a couple years ago at MIT Splash. It went much worse than the first one had. I failed to really get the people who'd shown up interested in the material, which was unfortunate. I've heard since that that's a really common at UChicago Splash (and, in partial contrast to that, that it has been getting much less of a problem more recently). I'm inclined to think that a lot of it was lack of preparation, and my general suckiness at teaching, but who knows.

UChicago Splash felt much more... authoritarian... than MIT Splash has to me. One of the things that I frequently hear people (admittedly, mostly admins, since that's who I interact with most) say is cool about Splash is how much freedom the students have. They're left on a college campus for a day, with no real commitments. There are classes, of course, and the photo... but nobody's taking attendance at anything, and nobody will really yell at them if they go wandering around Kendall Square.

UChicago held a snack in the middle of the program, and dispatched volunteers to help guide the students to it. So far, so good --- I figured this was just a "go stand in the hall, and tell people where it is when they ask, and make some occassional announcements for people who didn't realize snack was next". I got the impression, however, that the UChicago folks intended to be more... assertive, however. One of the UChicago admins drew her foot across the hallway and said to one cluster of students something along the lines of "Y'all are guests here. This is my school, and you need to do what I say. You're not to cross this line. You should go to snack, down there." I really can't imagine one of the volunteers doing something at MIT --- much less one of the senior MIT ESP admins.

UChicago Splash had a lot of visitors, too. In addition to Diyang and I from MIT, Dan (LU CEO), mshaw (Stanford ESP and Chair of the LU Board of Directors), J.D. (some sort of Stanford ESP affiliation?), and two more Stanford folks came. At seven people, it would not surprise me at all if the visitor's travel cost more than the rest of UChicago Splash did (the latter being budgeted for about three thousand dollars). I'm not really sure who was funding all the travel. Diyang and I were funded by MIT ESP. I assume the last two Stanford folks were funded by Stanford ESP. I assume that J.D. was self-funded (though Stanford is possible), and Dan was presumably funded by LU (self-funded is conceivable, though seems unlikely). For mshaw, I'm really not sure --- any of LU, Stanford ESP, and self-funded seem reasonably likely.

I can definitely believe that Dan's travel was worthwhile --- I think he spent most of the week before in Chicago helping out, which seems likely to be worthwhile, not to mention getting to know one of the chapters better. For the rest of us, it's a lot less clear to me. I don't really feel like I contributed much in the way of useful insight or needed labor to UChicago, nor did I really feel like I got much in the way of useful insight out of the visit. Admittedly, some of that may have been due to grumpiness about the logistics and my teaching leaving me not particularly predisposed to taking good ideas away, and not having put much of an effort into talking to people. Similarly, it's certainly possible that the other six visits were more useful.

Part of the reason that I felt like I wasn't contributing very much is because I felt like I didn't have much to do. Check-in was pretty hectic, and I felt useful then (or, at least, for the part of it that I wasn't frantically doing last minute class prep for...). After my class (which was during the first period), I rarely felt like I had much to do. Partially, I think UChicago just had plenty of volunteers --- the teacher lounge / volunteer HQ seemed to generally have tons of people. Partially, on the occasions when they needed volunteers and I offered, they just couldn't use me --- I'm not totally sure why. I think there was some component of not knowing may way around campus and thus being less able to do stuff; there was also, I think, so vibe that the visitors were too important to use on simple stuff, I think. I'm not sure why that was. Admittedly, I suppose there's been a similar vibe at MIT Splash sometimes --- that if there's any security volunteers around, admins are "too valuable" to send off on some task, even if the admin seems happy to do it and the security volunteer seems uninterested. It's sort of vaguely bothered me, though I don't know if there's anything to do about it (or if we should --- maybe we really are too valuable to squander...?). (Relatedly, I feel like at MIT Splash there's a tendency for admins to stand around chatting, leaving the useful work to volunteers. It seems sorta rude to the volunteers, but, again, I'm not sure what to do about it. Also, I'm far from blameless...)

Anyway, UChicago Splash. It was... kinda fun?

[ The first half of this post was written months ago; I finally got around to finishing it off tonight. ]

Categories:

  • School/Educational
  • Journal
Protection no

CAPTCHA's

I think I tend to be entertained by things that work, but seem sorta ridiculous. For example, I remember being entertained by some of the proofs in the Mathcamp complexity theory classes, where you prove that, say, multiple tapes aren't very useful (which in complexity tends to mean something like "doesn't change whether something is polynomial or not"), because you can simulate them while "merely" squaring the running time of your algorithm. Sure, it's still polynomial, but... that seems like a big difference practically...

Anyway... Today's paper for my security class, which talks about the economics of CAPTCHA's, amused me for somewhat similar reasons --- I'm not used to papers for my security class focusing on cost, even if in practice human labor is cheap enough that "how much do CAPTCHA's make accounts cost" is much more important than the basic "can you make computers break them at all" (answer: maybe, but people don't really bother, because that costs more than using humans).

Categories:

  • Computers
  • School/Educational
  • Journal
Protection no

ET Retreat

This weekend 'twas ET retreat. It was pretty fun. Unfortunately, I spent Friday night and Saturday morning tooling on 6.828 (much spent finding a stupid bug where I wrote roughly "n > NDIRECT" instead of "n >= NDIRECT"...), so I didn't get to do fun stuff Friday night, and didn't do the Saturday afternoon activities (due to a mixture of still tooling and being tired from staying up the night before).

A highlight of the trip was Alioth teaching a bunch of Thetans how to contra dance. It was sorta fun to help out with that a bit, but helping people who hadn't done Contra before. It went... reasonably well. There were definitely some false starts in teaching some calls, and the calling wasn't as smooth as some I've heard, but given the inexperience of the dancers and the teacher/caller, it went pretty well. Everyone seemed to enjoy it, too.

I also spent some time in the hot tub with Alioth and Sally (and, for some of the time, Mark), which was fun.

Categories:

  • Journal
Protection no

Tech Squares!

On Tuesday, I finally went back to Tech Squares. It was my first time dancing there in about a year, I think. As predicted, it didn't go great --- I was struggling a bit towards the end of the class when I took it, and a year without practice didn't help any... I danced in two tips. The first went fairly disastrously. Some of that was me sucking, though I think a decent amount was that it was a square with seven people and a phantom, and two of the people were dancing flipped gender. I sat out the last club tip, and then danced a class tip, which went quite smoothly. I definitely had trouble sometimes, but the squares never really broke down. I think I may resume going to Squares most weeks, and hopefully relearn how to square dance...

Categories:

  • Journal

Alex·Dehnert