Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6737673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:16:37+00:00 2026-05-26T11:16:37+00:00

Over here at the Django groups Tom Evans explains the method to do compare

  • 0

Over here at the Django groups Tom Evans explains the method to do compare and set in Django as shown below

You can access the memcached client via django though: 
>>> from django.core import cache 
>>> c=cache.get_cache('default') 
>>> help(c._client.cas) 

But somehow I couldn’t get it to work.

>>> from django.core import cache
>>> c=cache.get_cache('memcache')
>>> help(c._client.cas)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
AttributeError: 'MemcachedCache' object has no attribute '_client'

How can I get to do a compare and set in Django, if not the method shown above?

I use Django version 1.3.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:16:37+00:00Added an answer on May 26, 2026 at 11:16 am

    after looking at the source code! i find this at BaseMemcachedCache:

    @property
    def _cache(self):
        """
        Implements transparent thread-safe access to a memcached client.
        """
        if getattr(self, '_client', None) is None:
            self._client = self._lib.Client(self._servers)
    
        return self._client
    

    So, I would say that, this will work:

    c._cache.cas
    

    Try, and let me know!

    for more details: https://code.djangoproject.com/svn/django/trunk/django/core/cache/backends/memcached.py

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Referenced here and here ...Why would I use two's complement over an epsilon method?
Django newbie here, I need to do a count over a certain filter in
Mabye someone over here can explain to me what am I doing wrong. This
I'm using django-admin-tools 0.4. Following the docs here so that I can get a
Feature set over here claims that: Enable the development of apps that use very
Question over here is are design patterns specific to a programming language or technology,
This discussion started over here but I thought it would be nice to have
There is an interesting post over here about this, in relation to cross-application flow
Just like Carl's question over here I would like to ask you (because I
I was reading about refactoring a large slow SQL Query over here , and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.