jang: (Default)
So I signed the contract of engagement (I'm not employed by them, with all that entails) with the University. The work's nothing like what I was doing (infrastructure architect / devops / geek without portfolio) and is actually letting me flex my coding muscles.
the day's geekery )
Saw the hot IT support girl in Pret; bought her a coffee. She took me out to lunch again. I think she likes me.
jang: (Default)
Whilst SQLAlchemy does it all automagically, nicely reminds me of Hibernate, and is basically more complete out-of-the-box, there was some whining from the local Django fanboy about dropping the ORM. So, I persisted: django-model-utils provides a cast() method that'll appropriately downcast on request.

Why you would ever not want to downcast is beyond me; however, there are cost implications to doing so (a join, perhaps a second DB roundtrip - it all depends on how clever your ORM is). Having said that, the cost in terms of this particular problem still looks low compared to what it's been doing before.

Since we're basically just using pgsql as a persistence tool, I don't really care how it may or may not split my object attributes across tables (the alternative is a big munged table with lots of NULLs; Postgres has a potential third alternative using its own inherited tables, but they all amount to much of the same thing). We're typically looking at pulling back anything from a dozen to a few hundred objects, none of which is huge; so this isn't too big a deal.

The non-geeky day

I had the damp people come and measure my kitchen again; a great deal drier, will need a repeat monitoring visit, though, and next time they'll come armed and ready to tent the party wall.

After that, I headed in late. Stopped off for the morning coffee. Louise (the Dutch girl in Pret) asked if I wanted anything with that. It wasn't clear if she was directing the question to me or the woman standing next to me, so I asked, "did you mean me, or her?" That sounds awfully brusque ("who's she, the cat's mother?") so I apologised and corrected myself: I should have said, "do you mean me or the young lady to my right?"

"Ooh," said she (the cat's mother), "I like the young part," and actually honest-to-god fluttered her eyelashes at me as she blushed. Clearly I still have it.

Anyway, having so improved someone's day, I headed into Berkeley Square. There was a chap lying on the pavement, looking up between his feet at the door to the library building. He seemed quite bemused. Having ascertained that he wasn't hurt, just embarrassed, I hauled him up slightly more carefully than I might a sack of spuds and headed inside to discover that my early-morning rant on the failings of Django's ORM had led to a mini IRC explosion. "Why would you need that?" Well, perhaps you're doing something marginally more complicated than writing yet another blog. Meanwhile, I kept a weather-eye out of the window on the old chap I'd helped up; whilst he had said he was alright (refused the offer of a sit-down, coffee/scotch, fetching any further help, etc.), he did seem to just wander around a little aimlessly for about forty minutes before picking a destination and sticking with it.

The end of the geeky day

I must confess that I was irritated by the "why would you ever want to do that?"s on IRC. The problem here is that the chap in question and I have a completely different notion of what KISS means. To me it means: express the problem simply and clearly using the tools available to you in your language of choice; to him it means: it's easier to just hack some more elifs in.

The discussion culminated with a "I'm not even sure what an abstract factory is, why would you ever want to use one of those?" to which I was, at least, able to say, "why don't you ask the Django guys why they used one for their ENGINE?"

That all is irrelevant, because now we need to figure out what approach we're going to take to support i18n in user-supplied content; this is a big deal, I think, and very hard to express in a sensible UI, too. We're pretty much at the point of being able to produce a first-pass import of the metadata from the old system into the new to figure out what's broken; it's pretty much an accident that it handles Korean at the moment.

I will probably use SQLAlchemy to cast the old system's data into an object model that our new system groks :-)

In other news, as a cunning approach to handling repeated instances of sub-forms, and the attendant issues with handling the resulting data analysis, we appear to have reinvented the computed goto.
jang: (Default)
looking downcast )

Having said that, my desktop was in place and working perfectly when I popped in last week to pre-install it, and everything that depends on the local sysadmin and/or the local IT support girl (who is a total fox, incidentally, and who invited me out to lunch on my first day) has been done in plenty of time with nary a hitch.

Oh, for what it's worth, I'm pretty much convinced that the right thing to do is to throw away Django's ORM in favour of SQLAlchemy, because it does all this - and so much more - out of the box. Yes, type discriminants are ugly; but they are a necessary evil if you want your ORM to go fast (the alternative is a bunch of speculative joins; an approach that SQLAlchemy supports for a single database round-trip). What we lose, principally, is the admin interface (for the bits that don't use Django's ORM), and perhaps some of the manage.py capability. But it still looks worth it..!

Profile

jang: (Default)
jang

October 2011

S M T W T F S
      1
2345678
9101112131415
16171819202122
23 242526272829
3031     

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 22nd, 2017 05:08 pm
Powered by Dreamwidth Studios