I\'m trying to atomically increment a simple counter in Django. My code looks like this:
from models import Counter from django.db import transaction @trans
Django 1.7
from django.db.models import F counter, created = Counter.objects.get_or_create(name = name) counter.count = F('count') +1 counter.save()