The way I handled this kind of thing in edx-platform was to simply create a new `class LocalId(object): pass`. That way, generating ids was just a matter of instantiating an object.

If you did that, then you could just use a local `FieldData` that just stores things in an in-memory dictionary, and then when you actually want to push things to the database, you can generate some ids in whatever form the database actually uses.