This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
David Cramer (author)
Mon Sep 14 18:11:27 -0700 2009
commit db1c368fc5c7ffce5d4a99df73b7f7b1408e65b1
tree f7bfedc8c061699ded8a5182066f0d0416b1159d
parent b963155d317ab3c66b4b251ed262e883b68407b3
tree f7bfedc8c061699ded8a5182066f0d0416b1159d
parent b963155d317ab3c66b4b251ed262e883b68407b3
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Fri Sep 04 19:46:45 -0700 2009 | |
| |
LICENSE | Fri May 22 10:50:41 -0700 2009 | |
| |
MANIFEST.in | Fri Sep 04 19:46:47 -0700 2009 | |
| |
README.rst | Fri Sep 04 19:46:45 -0700 2009 | |
| |
idmapper/ | Tue Sep 08 11:33:11 -0700 2009 | |
| |
setup.py | Mon Sep 14 18:11:27 -0700 2009 |
README.rst
Django Identity Mapper
======================
A pluggable Django application which allows you to explicitally mark your models to use an identity mapping pattern.
This will share instances of the same model in memory throughout your interpreter.
Please note, that deserialization (such as from the cache) will *not* use the identity mapper.
Usage
-----
To use the shared memory model you simply need to inherit from it (instead of models.Model). This enable all queries
(and relational queries) to this model to use the shared memory instance cache, effectively creating a single instance
for each unique row (based on primary key) in the queryset.
For example, if you want to simply mark all of your models as a SharedMemoryModel, you might as well just import it as
models.
::
import idmapper as models
class MyModel(models.SharedMemoryModel):
name = models.CharField(...)
Because the system is isolated, you may mix and match SharedMemoryModel's with regular Model's.
::
import idmapper as models
class MyModel(models.SharedMemoryModel):
name = models.CharField(...)
fkey = models.ForeignKey('Other')
class Other(models.Model):
name = models.CharField(...)
References
----------
Original code and concept: http://code.djangoproject.com/ticket/17






