# 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):


from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.db.models.query import QuerySet
from django.utils.functional import cached_property
from sequere.registry import registry
    def to_instance(self, instance):
        return self.get_queryset().to_instance(instance)


@python_2_unicode_compatible
class Follow(models.Model):
    created_at = models.DateTimeField(auto_now_add=True)

    from_object_id = models.PositiveIntegerField()
    from_identifier = models.CharField(max_length=50, db_index=True)

    to_object_id = models.PositiveIntegerField()
    to_identifier = models.CharField(max_length=50, db_index=True)

    is_mutual = models.BooleanField(default=False)

    objects = FollowManager()

    class Meta:
        ordering = ['-created_at', ]
        app_label = 'sequere'

    def __str__(self):
        return '[%s: %d] -> [%s: %d]' % (self.from_identifier,
                                         self.from_object_id,
                                         self.to_identifier,
                                         self.to_object_id)

    @cached_property
    def from_instance(self):

# 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/database/models.py
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.db.models.query import QuerySet
from django.utils.functional import cached_property
from sequere.registry import registry

    def to_instance(self, instance):
        return self.get_queryset().to_instance(instance)


@python_2_unicode_compatible
class Follow(models.Model):
    created_at = models.DateTimeField(auto_now_add=True)

    from_object_id = models.PositiveIntegerField()
    from_identifier = models.CharField(max_length=50, db_index=True)

    to_object_id = models.PositiveIntegerField()
    to_identifier = models.CharField(max_length=50, db_index=True)

    is_mutual = models.BooleanField(default=False)

    objects = FollowManager()

    class Meta:
        ordering = ['-created_at', ]
        app_label = 'sequere'

    def __str__(self):
        return '[%s: %d] -> [%s: %d]' % (self.from_identifier,
                                         self.from_object_id,
                                         self.to_identifier,
                                         self.to_object_id)

    @cached_property
    def from_instance(self):

        model = registry.identifiers.get(self.from_identifier)