# Path: moto/moe/models.py
# IMAGE_SIZE = getattr(settings,  'IMAGE_SIZE', None)
# def uuid():
#     def __unicode__(self):
#     def get_image_url(self ):
#     def posted_datetime(self):
#     def admin_thumbnail(self):
#     def admin_thumbnail(self):
# class Post(models.Model):
#     class Meta:
# class Like(models.Model):
#     class Meta:
# class Board(models.Model):
# class User(AbstractUser):


from rest_framework import serializers
from moto.moe import  models
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.conf import settings
from six.moves.urllib.parse import urlparse
from django_comments_threaded.api.serializers import CommentSerializer as BaseCommentSerializer
from django_comments_threaded.utils import get_model
from rest_auth.serializers import TokenSerializer as BaseTokenSerializer
from django.utils import formats
from django.utils import timezone
from django.contrib.contenttypes.models import ContentType
import os
        return len(liked) if liked else 0

    def get_likes_count(self,obj):
        return getattr(obj,'likes_count',0)

    def get_date_posted(self,obj):
        user_local_time = timezone.template_localtime(obj.date_posted,use_tz=timezone.get_current_timezone())
        return user_local_time.isoformat()

    def get_id(self,obj):
        return str(obj.id)

    def get_image_url(self, obj):
        return obj.get_image_url()

    def get_date_posted2(self,obj):
        return formats.localize(obj.date_posted,use_l10n=True)


class PostListSerializer(PostBaseSerializer):
    author = UserSerializer()
    class Meta:
        model = models.Post
        fields =['key','description','image_url','author','date_posted','date_posted2','liked','likes_count']
        depth = 2


class CurrentPostDefault:
    def set_context(self, serializer_field):
        post_key = serializer_field.context['view'].kwargs['post_key']

# Path: moto/moe/models.py
# IMAGE_SIZE = getattr(settings,  'IMAGE_SIZE', None)
# def uuid():
#     def __unicode__(self):
#     def get_image_url(self ):
#     def posted_datetime(self):
#     def admin_thumbnail(self):
#     def admin_thumbnail(self):
# class Post(models.Model):
#     class Meta:
# class Like(models.Model):
#     class Meta:
# class Board(models.Model):
# class User(AbstractUser):


# Path: moto/moe/api/serializers.py
from rest_framework import serializers
from moto.moe import  models
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.conf import settings
from six.moves.urllib.parse import urlparse
from django_comments_threaded.api.serializers import CommentSerializer as BaseCommentSerializer
from django_comments_threaded.utils import get_model
from rest_auth.serializers import TokenSerializer as BaseTokenSerializer
from django.utils import formats
from django.utils import timezone
from django.contrib.contenttypes.models import ContentType
import os

        return len(liked) if liked else 0

    def get_likes_count(self,obj):
        return getattr(obj,'likes_count',0)

    def get_date_posted(self,obj):
        user_local_time = timezone.template_localtime(obj.date_posted,use_tz=timezone.get_current_timezone())
        return user_local_time.isoformat()

    def get_id(self,obj):
        return str(obj.id)

    def get_image_url(self, obj):
        return obj.get_image_url()

    def get_date_posted2(self,obj):
        return formats.localize(obj.date_posted,use_l10n=True)


class PostListSerializer(PostBaseSerializer):
    author = UserSerializer()
    class Meta:
        model = models.Post
        fields =['key','description','image_url','author','date_posted','date_posted2','liked','likes_count']
        depth = 2


class CurrentPostDefault:
    def set_context(self, serializer_field):
        post_key = serializer_field.context['view'].kwargs['post_key']

        self.post = models.Post.objects.get(key=post_key)