r4fek / django-cassandra-engine

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

How to i can make a wide-table by TTL time? #121

Open mohsenjavidpanah opened 6 years ago

mohsenjavidpanah commented 6 years ago

Hi guys i have a wide-table for store verification codes, i want auto delete this data after some minutes I don't find any documentation about how to do it, guide me to set TTL of my model

Thank You

oneandonlyonebutyou commented 6 years ago

Me too. I wonder how I could use TTL settings.

mdczaplicki commented 4 years ago

You can set the TTL in model's __options__ dictionary.

Add this to your model:

    __options__ = {
        "default_time_to_live": 2
    }
pawel1830 commented 4 years ago

If found https://github.com/r4fek/django-cassandra-engine/blob/5dd19276728b896850d39b709375095fd5c9cb28/django_cassandra_engine/models/__init__.py#L212

So what is an alternative for "default_time_to_live" ?