# Path: sequere/registry.py
# class SequereRegistry(dict):
#     def __init__(self):
#     def for_model(self, model):
#     def get_identifier(self, instance):
#     def identifiers(self):
#     def unregister(self, name):
#     def register(self, *args, **kwargs):
#     def _register_model(self, model, sequere=None,
#                         name=None, **kwargs):
#     def _register(self, sequere):
# def autodiscover():
# def register(*args, **kwargs):
# 
# Path: sequere/backends/redis/utils.py
# def get_key(*args, **kwargs):
#     separator = kwargs.pop('separator', get_setting('KEY_SEPARATOR'))
# 
#     key = separator.join(['%s' % arg for arg in args if arg is not None])
# 
#     return key


import six
import uuid
from collections import defaultdict
from sequere.registry import registry
from .utils import get_key





class Manager(object):
    def __init__(self, client, prefix=None):
        self.client = client
        self.prefix = prefix or ''

    def add_prefix(self, key):
        return get_key(self.prefix, key)

    def make_uid(self, data, client=None):
        client = client or self.client

        uid = str(uuid.uuid4()).replace('-', '')

        data['uid'] = uid

        key = self.add_prefix(get_key('uid', uid))

        client.hmset(key, data)

        return uid

    def get_data_from_uid(self, uid):

# Path: sequere/registry.py
# class SequereRegistry(dict):
#     def __init__(self):
#     def for_model(self, model):
#     def get_identifier(self, instance):
#     def identifiers(self):
#     def unregister(self, name):
#     def register(self, *args, **kwargs):
#     def _register_model(self, model, sequere=None,
#                         name=None, **kwargs):
#     def _register(self, sequere):
# def autodiscover():
# def register(*args, **kwargs):
# 
# Path: sequere/backends/redis/utils.py
# def get_key(*args, **kwargs):
#     separator = kwargs.pop('separator', get_setting('KEY_SEPARATOR'))
# 
#     key = separator.join(['%s' % arg for arg in args if arg is not None])
# 
#     return key


# Path: sequere/backends/redis/managers.py
import six
import uuid
from collections import defaultdict
from sequere.registry import registry
from .utils import get_key






class Manager(object):
    def __init__(self, client, prefix=None):
        self.client = client
        self.prefix = prefix or ''

    def add_prefix(self, key):
        return get_key(self.prefix, key)

    def make_uid(self, data, client=None):
        client = client or self.client

        uid = str(uuid.uuid4()).replace('-', '')

        data['uid'] = uid

        key = self.add_prefix(get_key('uid', uid))

        client.hmset(key, data)

        return uid

    def get_data_from_uid(self, uid):

        key = self.add_prefix(get_key('uid', uid))