popoto.backends.routing¶
popoto.backends.routing
¶
Field-layer routing to a non-Redis backend (#759 M2a).
The memory fields and mixins keep today's Redis code exactly as it is (gate (a): the Redis wire does not change) and branch to the model's backend only when that backend is not Redis. This module is the one place that branch is decided, so it reads the same everywhere.
non_redis_backend(model)
¶
The model's backend when it is not Redis, else None.
model is a Model class or instance. Resolving the backend binds it
lazily (no network: bind() only compiles the table spec) and issues no
Redis command, so a Redis-bound model's wire is unchanged by the check.
Source code in src/popoto/backends/routing.py
record_id_of(instance)
¶
The :class:~popoto.backends.RecordId of a saved (or keyable)
instance: the key it was last saved under, else its current key.