I am storing some number of records in python memcach. The object structure is as shown below. How can i access or get records just like querying a database.
class CartDetails(models.Model):
id = models.AutoField(primary_key=True)
item_name = models.CharField(max_length = 100)
location = models.CharField(max_length = 250)
item_type = models.ForeignKey(ItemType)
comments = models.TextField(max_length = 250,blank=True)
item_code = models.CharField(max_length = 100)
main_cat_id = models.ForeignKey(MainCategory)
i know i can access the memcache like this
cache.get(<some key>)
I want some thing just like we are quering in Django
<some model>.objects.filter(<conditions>)
i mean is there any way so that i can specify some condition and get the records from memcache. cache.get() #condition like item_name = "some item", item_type = 1 etc
What are the best practices. Any help will be appreciated greatly.
Thanks