Closed muminoff closed 9 years ago
Take a look at https://github.com/cqlengine/cqlengine/issues/195. This is purely related to cqlengine. Django-cassandra-engine is just a database wrapper, so you should probably address issues like this in cqlengine project.
I also am not able to use post_save with MySQL backend. This block of code works fine in Django 1.6.10 but is broken in 1.7.3:
import logging
from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
log = logging.getLogger(__name__)
class UserProfile(models.Model):
uuid = models.CharField(max_length=36)
user = models.OneToOneField(User)
@receiver(post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
"""
When a new user is created, add a UserProfile
"""
log.debug('received post save signal: {}'.format(instance))
if created:
UserProfile.objects.create(user=instance)
You're saing that with mysql as primary backend and django_cassandra_engine as secondary post_save signal does not work? Does it work if you remove django_cassandra_engine from settings?
I have tried to implement
post_save
signal, but failed.Here is my simple code:
This works:
Last code works but I needed
post_save
notpre_save
.