cqlengine-relation-columns
==========================

Adds new relation columns to CQLengine storing pointers to other model instances.


History
-------

Originates from an private repository, to cover internal needs in my company.

This code was then released in the open while discussing issue
https://github.com/cqlengine/cqlengine/issues/230 in order to provide a proof of
concept for storing arbitrary pointers to CQLengine instances. 

cqlengine-relation-columns
==========================

Adds new CQLengine columns to store pointers to other model instances.


Example
-------

```python
import arrow
import uuid

# Importing module adds new columns to cqlengine.columns
import .relation-columns  # TODO: #1

from cqlengine import columns
from cqlengine.models import Model


class Dummy(Model):
    """ Dummy model, with arbitrarily complex primary key. """
    organization = columns.Text(partition_key=True)
    start_date = columns.DateTime(primary_key=True, default=arrow.utcnow)
    key = columns.UUID(primary_key=True, default=uuid.uuid4)
    info = columns.Text()


class PointingToDummy(Model):
    """ Model storing a pointer to a Dummy instance. """
    key = columns.UUID(primary_key=True, default=uuid.uuid4)
    dummy_key = columns.CompositeRelation(model='Dummy')


# Create dummy instance.
dummy_instance = Dummy.create(organization='Organization #1')

# Create a new instancepointing to the ``Dummy`` instance above.
pointing_instance = PointingToDummy.create(dummy_key=dummy_instance)

# Now the dummy instance can be fetched back from its reference stored in the
# pointing instance.
fetched_dummy = Dummy.get(**pointing_instance.dummy_key)
assert fetched_dummy == dummy_instance
```


History
-------

Originates from an private repository, to cover internal needs in my company.

This code was then released in the open while discussing issue
https://github.com/cqlengine/cqlengine/issues/230 in order to provide a proof of
concept for storing arbitrary pointers to CQLengine instances. 

Add example on the front page.
Add example on the front page.