Sep. 30th, 2009

elfs: (Default)
Oh, mightly LJ brain, riddle me this:

I have a table in a MySQL (well, okay, it's Sqlite3 right now, but it'll my MySQL in production) database, and the primary keys are known to not be contiguous. That's important.

It's possible to construct a WHERE clause giving you a single item, if that items qualties are unique enough. Is it possible, using some magic combination of WHERE and ORDER BY and something I don't know, to say "give me unique item N, and using the rule of the ORDER BY clause, also give me the next and previous objects?"
elfs: (Default)

In my “real life,” I’m a programmer with a taste for Python and Django.  For years, the narrator engine that’s run most of my story site has been a hacked-up set of CGI programs, and most recently it was a collection of eruby scripts.

I’ve finally decided to bite the bullet, and convert all of it to Django.  It’s actually quite a coup; it took me less than eight hours to do the whole conversion, and the site’s a hell of a lot easier to manage.  I mean, like insanely so.  I lost a bit of sleep putting this together, which isn’t healthy, but hey.  Anything for the fans.  A consistent sidebar is always a plus.

I should probably write a script to dump a single story as text, so I can edit it in my favorite editor, and then read it back in.

We’ll see if it all actually works when the Yowler stories automagically appear Friday morning, right?  Tests say they should, but time-based controls are hard to test correctly.  The stories are showing up in the sidebar of the home page, so that’s a good sign, but that’s just PHP getting the material out of the cross-database handler.  Tricky, but not the point.  The point is to publish!

So give it a bang, see what’s borked.  The media is being served out of the NginX front-end directly, routing around the Apache handler (which runs php and wsgi for me), so the only performance holes are the WSGI daemon and its calls to the database.

Real Artists Ship. I’m totally making that my mantra.

This entry was automatically cross-posted from Elf's writing journal, Pendorwright.com. Feel free to comment on either LiveJournal or Pendorwright.

Profile

elfs: (Default)
Elf Sternberg

May 2025

S M T W T F S
    123
45678910
111213141516 17
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 28th, 2025 09:31 pm
Powered by Dreamwidth Studios