# Path: yak/rest_core/models.py
# class CoreModel(models.Model):
#     created = models.DateTimeField(auto_now_add=True, null=True)
# 
#     def __repr__(self):
#         return '<{}:{} {}>'.format(self.__class__.__name__, self.pk, str(self))
# 
#     class Meta:
#         abstract = True
# 
# Path: yak/rest_notifications/models.py
# class NotificationType(CachingMixin, CoreModel):
#     name = models.CharField(max_length=32)
#     slug = models.SlugField(unique=True)
#     description = models.CharField(max_length=255)
#     is_active = models.BooleanField(default=True)
# 
#     objects = CachingManager()
# 
#     def __unicode__(self):
#         return "{}".format(self.name)
# 
# Path: yak/rest_user/models.py
# class AbstractYeti(AbstractBaseUser, PermissionsMixin):
#     username = models.CharField(_('username'), max_length=30, unique=True,
#         help_text=_('Required. 30 characters or fewer. Letters, digits and '
#                     '@/./+/-/_ only.'),
#         validators=[
#             validators.RegexValidator(r'^[\w.@+-]+$', _('Enter a valid username.'), 'invalid')
#         ])
#     # Field name should be `fullname` instead of `full_name` for python-social-auth
#     fullname = models.CharField(max_length=80, blank=True, null=True)
#     email = models.EmailField(blank=True, null=True, unique=True)
#     about = models.TextField(blank=True, null=True)
#     is_active = models.BooleanField(_('active'), default=True,
#                                     help_text=_('Designates whether this user should be treated as '
#                                                 'active. Unselect this instead of deleting accounts.'))
#     is_admin = models.BooleanField(default=False)
#     is_staff = models.BooleanField(_('staff status'), default=False,
#                                    help_text=_('Designates whether the user can log into this admin '
#                                                'site.'))
#     date_joined = models.DateTimeField(_('date joined'), default=timezone.now)
# 
#     SIZES = {
#         'thumbnail': {'height': 60, 'width': 60},
#         'small_photo': {'height': 120, 'width': 120},
#         'large_photo': {'height': 300, 'width': 300}
#     }
#     original_file_name = "original_photo"
# 
#     original_photo = models.ImageField(upload_to="user_photos/original/", blank=True, null=True)
#     small_photo = models.ImageField(upload_to="user_photos/small/", blank=True, null=True)
#     large_photo = models.ImageField(upload_to="user_photos/large/", blank=True, null=True)
#     thumbnail = models.ImageField(upload_to="user_photos/thumbnail/", blank=True, null=True)
# 
#     objects = UserManager()
# 
#     USERNAME_FIELD = 'username'
#     # Used for `createsuperuser` command and nowhere else. Include any fields that cannot be blank
#     REQUIRED_FIELDS = ['email']
# 
#     class Meta:
#         abstract = True
# 
#     def __unicode__(self):
#         return "{}".format(self.username)
# 
#     def save(self, force_insert=False, force_update=False, using=None,
#              update_fields=None):
#         self.username = self.username.lower()
# 
#         if self.email:
#             self.email = self.email.lower().strip()  # Remove leading or trailing white space
#         if self.email == "":  # Allows unique=True to work without forcing email presence in forms
#             self.email = None
#         super(AbstractYeti, self).save(force_insert, force_update, using, update_fields)
# 
# Path: yak/settings.py
# def perform_import(val, setting_name):
#     def __getattr__(self, attr):
# class YAKAPISettings(APISettings):
# USER_SETTINGS = getattr(settings, 'YAK', None)
# DEFAULTS = {
#     'USER_APP_LABEL': 'test_app',
#     'USER_MODEL': 'user',
#     'USER_SERIALIZER': "test_app.api.serializers.UserSerializer",
#     'API_SCHEMA': 'api-schema-1.0.json',
#     'SOCIAL_MODEL': "test_app.models.Post",
#     'ALLOW_EMAIL': True,
#     'ALLOW_PUSH': True,
#     'EMAIL_NOTIFICATION_SUBJECT': 'Test Project Notification',
#     'PUSHWOOSH_AUTH_TOKEN': "",
#     'PUSHWOOSH_APP_CODE': "",
#     'PUSH_NOTIFICATION_HANDLER': "yak.rest_notifications.utils.send_pushwoosh_notification",
#     'SOCIAL_SHARE_DELAY': 60,
#     'USE_FACEBOOK_OG': False,
#     'FACEBOOK_OG_NAMESPACE': "",
#     'SERIALIZER_MAPPING': {},
#     'FLAKE8_CONFIG': None,
# }
# IMPORT_STRINGS = (
#     "USER_SERIALIZER",
#     "SOCIAL_MODEL",
#     "SERIALIZER_MAPPING",
# )


import abc
import re
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.fields import GenericRelation, GenericForeignKey
from django.contrib.sites.models import Site
from django.utils.baseconv import base62
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.signals import post_save
from yak.rest_core.models import CoreModel
from yak.rest_notifications.models import NotificationType
from yak.rest_user.models import AbstractYeti
from yak.settings import yak_settings
        from yak.rest_notifications.models import create_notification


class FollowableModel(metaclass=abc.ABCMeta):
    """
    Abstract class that used as interface
    This class makes sure that child classes have
    my_method implemented
    """

    @abc.abstractmethod
    def identifier(self):
        return

    @abc.abstractmethod
    def type(self):
        return



# Path: yak/rest_core/models.py
# class CoreModel(models.Model):
#     created = models.DateTimeField(auto_now_add=True, null=True)
# 
#     def __repr__(self):
#         return '<{}:{} {}>'.format(self.__class__.__name__, self.pk, str(self))
# 
#     class Meta:
#         abstract = True
# 
# Path: yak/rest_notifications/models.py
# class NotificationType(CachingMixin, CoreModel):
#     name = models.CharField(max_length=32)
#     slug = models.SlugField(unique=True)
#     description = models.CharField(max_length=255)
#     is_active = models.BooleanField(default=True)
# 
#     objects = CachingManager()
# 
#     def __unicode__(self):
#         return "{}".format(self.name)
# 
# Path: yak/rest_user/models.py
# class AbstractYeti(AbstractBaseUser, PermissionsMixin):
#     username = models.CharField(_('username'), max_length=30, unique=True,
#         help_text=_('Required. 30 characters or fewer. Letters, digits and '
#                     '@/./+/-/_ only.'),
#         validators=[
#             validators.RegexValidator(r'^[\w.@+-]+$', _('Enter a valid username.'), 'invalid')
#         ])
#     # Field name should be `fullname` instead of `full_name` for python-social-auth
#     fullname = models.CharField(max_length=80, blank=True, null=True)
#     email = models.EmailField(blank=True, null=True, unique=True)
#     about = models.TextField(blank=True, null=True)
#     is_active = models.BooleanField(_('active'), default=True,
#                                     help_text=_('Designates whether this user should be treated as '
#                                                 'active. Unselect this instead of deleting accounts.'))
#     is_admin = models.BooleanField(default=False)
#     is_staff = models.BooleanField(_('staff status'), default=False,
#                                    help_text=_('Designates whether the user can log into this admin '
#                                                'site.'))
#     date_joined = models.DateTimeField(_('date joined'), default=timezone.now)
# 
#     SIZES = {
#         'thumbnail': {'height': 60, 'width': 60},
#         'small_photo': {'height': 120, 'width': 120},
#         'large_photo': {'height': 300, 'width': 300}
#     }
#     original_file_name = "original_photo"
# 
#     original_photo = models.ImageField(upload_to="user_photos/original/", blank=True, null=True)
#     small_photo = models.ImageField(upload_to="user_photos/small/", blank=True, null=True)
#     large_photo = models.ImageField(upload_to="user_photos/large/", blank=True, null=True)
#     thumbnail = models.ImageField(upload_to="user_photos/thumbnail/", blank=True, null=True)
# 
#     objects = UserManager()
# 
#     USERNAME_FIELD = 'username'
#     # Used for `createsuperuser` command and nowhere else. Include any fields that cannot be blank
#     REQUIRED_FIELDS = ['email']
# 
#     class Meta:
#         abstract = True
# 
#     def __unicode__(self):
#         return "{}".format(self.username)
# 
#     def save(self, force_insert=False, force_update=False, using=None,
#              update_fields=None):
#         self.username = self.username.lower()
# 
#         if self.email:
#             self.email = self.email.lower().strip()  # Remove leading or trailing white space
#         if self.email == "":  # Allows unique=True to work without forcing email presence in forms
#             self.email = None
#         super(AbstractYeti, self).save(force_insert, force_update, using, update_fields)
# 
# Path: yak/settings.py
# def perform_import(val, setting_name):
#     def __getattr__(self, attr):
# class YAKAPISettings(APISettings):
# USER_SETTINGS = getattr(settings, 'YAK', None)
# DEFAULTS = {
#     'USER_APP_LABEL': 'test_app',
#     'USER_MODEL': 'user',
#     'USER_SERIALIZER': "test_app.api.serializers.UserSerializer",
#     'API_SCHEMA': 'api-schema-1.0.json',
#     'SOCIAL_MODEL': "test_app.models.Post",
#     'ALLOW_EMAIL': True,
#     'ALLOW_PUSH': True,
#     'EMAIL_NOTIFICATION_SUBJECT': 'Test Project Notification',
#     'PUSHWOOSH_AUTH_TOKEN': "",
#     'PUSHWOOSH_APP_CODE': "",
#     'PUSH_NOTIFICATION_HANDLER': "yak.rest_notifications.utils.send_pushwoosh_notification",
#     'SOCIAL_SHARE_DELAY': 60,
#     'USE_FACEBOOK_OG': False,
#     'FACEBOOK_OG_NAMESPACE': "",
#     'SERIALIZER_MAPPING': {},
#     'FLAKE8_CONFIG': None,
# }
# IMPORT_STRINGS = (
#     "USER_SERIALIZER",
#     "SOCIAL_MODEL",
#     "SERIALIZER_MAPPING",
# )


# Path: yak/rest_social_network/models.py
import abc
import re
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.fields import GenericRelation, GenericForeignKey
from django.contrib.sites.models import Site
from django.utils.baseconv import base62
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.signals import post_save
from yak.rest_core.models import CoreModel
from yak.rest_notifications.models import NotificationType
from yak.rest_user.models import AbstractYeti
from yak.settings import yak_settings
        from yak.rest_notifications.models import create_notification



class FollowableModel(metaclass=abc.ABCMeta):
    """
    Abstract class that used as interface
    This class makes sure that child classes have
    my_method implemented
    """

    @abc.abstractmethod
    def identifier(self):
        return

    @abc.abstractmethod
    def type(self):
        return



class Tag(CoreModel):