Share a model through apps without API

2019-08-16 01:27发布

Is it possible to share a model through other apps? if possible, how to do this.

Yeah, maybe we can implement API for those apps, But if apps can share their models for each other without any external libs, it would be cool :-)

2条回答
该账号已被封号
2楼-- · 2019-08-16 02:17

You could possibly broaden your definition of "other applications" in the original question to include other versions of the same application (where these versions are really your "other applications"). If so, then this could be possible by deploying each of your "other applications" as a different version of the same application. That way they should be able to share the same data store. I've not yet attempted this myself but from what I read this should be possible. Might get some more info if anyone posts here, or if I end up trying this myself I'll let you know.

Update: I tried this out and it works but with one minor and one possibly significant issue. The minor issue is that you have to work out a way to duplicate the same data model across your two apps (or at least as much as you need). The bigger issue is that datastore commits made in one application may not be visible to the other application for quite some time, and that amount of time varies depending on where/how you're deploying.

查看更多
放荡不羁爱自由
3楼-- · 2019-08-16 02:30

There is no way (yet?) for an App to open its datastore to other Apps, if that is what you mean.

You'd have to go through an HTTP interface (which could probably be derived from the model classes directly, and thus shared). The remote_api standardizes this somewhat.

查看更多
登录 后发表回答