Skip to content

Create mapper object, instead of monkey-patching the model class #37

@lowinger42

Description

@lowinger42

Pros:
A model instance is not tied to a specific sql driver, so working with for example a local db and a remote over json gets easier

Example:
customer = remotedb.load(Customer(22))
localdb.store(customer[0])

This is also the reason the model object should not have .load/.store methods, it would lock the instance to a specific database driver.

The mapper can be used in custom code, for example in the wsgi api.py

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions