Well, I guess we should be happy that at least you used django's ORM to make the changes rather than just banging on the sqlite database directly. ;-)
I think you did the best you could under the circumstances, and I see nothing wrong with your approach. For more recent versions of FreeNAS, using the REST API is definitely the preferred method, since we may someday change the underlying django implementation and the web API provides the right abstraction layer.