The key is doing so in multiple files and expecting a model to be defined before it actually is. Maybe the message should be clearer.