r4fek / django-cassandra-engine

Django Cassandra Engine - the Cassandra backend for Django
BSD 2-Clause "Simplified" License
365 stars 85 forks source link

When partition_key flag for a field is True fetching data is incorrect #111

Open mohsenjavidpanah opened 6 years ago

mohsenjavidpanah commented 6 years ago

Hi guys

I used django-cassandra-engine in my project, and for many times i confused about what is reason that i get post_id value equal to id ..!!! Below model is my model:

class Comment(NoSQLBaseModel):
    class Meta:
        get_pk_field = 'id'

    id = columns.UUID(primary_key=True, default=uuid4)
    post_id = columns.UUID(primary_key=True, partition_key=True)
    post_owner_id = columns.BigInt(primary_key=True)  # Maybe unique-id or internal-id
    writer_id = columns.BigInt()
    writer_vip_id = columns.Text(max_length=50)
    content = columns.Text()

I check my Cassandra keyspace but everything was correctly stored.