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

June 2025

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 28th, 2025 05:34 am
Powered by Dreamwidth Studios