Aug. 27th, 2009

bouteillebleu: (Default)
(Expropriating memes is fun.)

If there is someone on your friends list you would like to take, sit down, offer a biscuit or some cake, prepare some tea for, then have tea and conversation with until the teapot is empty, then wait until you've brewed another pot and do it all over again, then repost this sentence in your journal.

Filk

Aug. 27th, 2009 04:15 pm
bouteillebleu: (Pomowned)
Filk below the cut. Just as with the song it's filking, the title character bears no resemblance to [livejournal.com profile] oxfordgirl's character beyond having a very Fidelian name. Written out because it started earworming me on the cycle back from lunch today. (Also crossposted to [livejournal.com profile] lrpdrabbles.)

Read more... )
bouteillebleu: (Pocket watch)
And this is why I like Django, since after all this struggling and "how does this work" and "my brain hurts" fighting against a somewhat complex database query I thought would be simple, here is the function that does it with Django's own API:

def can_study_orm(self):
        skills_known = self.skills.all()
        skills_unknown = Skill.objects.exclude(id__in=skills_known)
        can_study = Skill.objects.exclude(prereqs__in=skills_unknown).exclude(id__in=skills_known)
        return can_study


Five lines, which could have been four if I'd combined the last two. That's compared to the nineteen lines for nicely formatting the SQL query equivalent. And best of all, the way it's set out means it makes *sense*.[1]

Now I have the method working, it's time to get the template it displays in working. Next up is the very simplified downtime system.

[1] The main thing I had problems with was the naming schemes for the manytomany relations in either direction. Need to have a look at renaming those.

Profile

bouteillebleu: (Default)
bouteillebleu

April 2014

S M T W T F S
  12345
6789101112
13141516171819
20212223242526
272829 30   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 17th, 2025 06:34 pm
Powered by Dreamwidth Studios