fixes #630

I don't recall whether I've explained this pattern in a pull request or not.  By convention, we say ``id=None`` to indicate that something is a new row in the database, and we say ``id=<some_uuid>`` to indicate that it's already a row in the database.

Just saying ``event.id`` isn't good enough because our ``MagModel`` class automatically generates a uuid for its ``id`` fields even before they're saved.  So we have a ``db_id`` field which returns ``None`` if it's not been saved yet and returns the actual id if it has.