redis-db
ORM for managing cache of django models using redis. Models data can be cached just once and as per requirements it can be fetched using filters.
No-Sql in retrieval of model objects.
Dependencies:
[django >=1.3](https://www.djangoproject.com/)
[redis-py](https://github.com/andymccurdy/redis-py)
[redis](http://redis.io/)
User Manual :
from redis_db.manager import CacheManager
- class Person(models.Model):
“”” Person model, contains basic details. “”” name = models.CharField(max_length = 255) email = models.EmailField(max_length = 100) gender = models.ChoiceField(choices = ((‘M’, ‘Male’), (‘F’, ‘Female’)))
#custom managers objects = models.Manager() cache_objects = CacheManager(key = ‘person-cache’)
Creating Cache Data (one time process)
qs = Person.objects.all() Person.cache_objects.store(qs) # qs can be anything, filtered queryset or model object itself
Retrieving Objects from cache (No-SQL)
1- All objects
- objs = Person.cache_objects.all() # returns list of Person Objects. Note - Gives back list not queryset,
# because querysets itself is lazy query
2 - Filters usage
objs = Person.cache_objects.filter(gender = ‘M’) # all male Person’s Objects
3 - Get a specific object based on id
obj = Person.cache_objects.get(id= 10)
Note :
For non reference objects there is no query at all but in case of ForiegnKey retreival it makes a query to get that object.
Metadata
Release files for Redis-DB 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Redis-DB-0.1.5.tar.gz | 3.7 kB | Without provenance | Details for Redis-DB-0.1.5.tar.gz |
Release files / Redis-DB-0.1.5.tar.gz
| Download URL | Redis-DB-0.1.5.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d8f84cbe26f9ae33f072e00e764c2eff3d0c33ee75b2851505ee6b18b0d3e07e
|
|
BLAKE2b-256 checksum How to use checksums |
728dd0253b2b5ee0c030107522b7537446a7606a1a60d6331eb424f5ade05574
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for Redis-DB 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.