Router¶
- class heroku_connect.db.router.HerokuConnectRouter[source]¶
Router that prevents write actions on read-only Heroku Connect tables.
The router will raise a
WriteNotSupportedError
error whensave
,create
,delete
,update
or other model or QuerySet methods are called on read-only tables.Note
You will need to add the router to your
DATABASE_ROUTERS
setting. For example:DATABASE_ROUTERS = ['heroku_connect.db.router.HerokuConnectRouter']
See also
- db_for_write(model, **hints)[source]¶
Prevent write actions on read-only tables.
- Raises:
WriteNotSupportedError – If models.sf_access is
read_only
.