# Path: common/models.py
# class Product(models.Model):
#     """
#     product model for the items etc.
#     """
#     name = models.CharField(max_length=64)
#     description = models.CharField(max_length=1024, unique=True)
#     wholesale_price = models.PositiveIntegerField(default=0)
#     retail_price = models.PositiveIntegerField(default=0)
#     img = models.ImageField(upload_to = 'prod_imgs/', default = 'prod_imgs/default.png')
#     created_at = models.DateTimeField(auto_now_add=True)
# 
#     def __unicode__(self):
#         """
#         function returns unicode representation of a product
#         """
#         return self.name
# 
# Path: notes/models.py
# class Category(models.Model):
#     """
#     category for a note
#     """
#     name = models.CharField(max_length=64)
#     user = models.ForeignKey(User)
# 
#     def __unicode__(self):
#         """
#         function returns unicode representation of a category
#         """
#         return self.name
# 
#     class Meta:
#         verbose_name_plural = "categories"
# 
# class Note(models.Model):
#     """
#     model for a note
#     """
#     title = models.CharField(max_length=64)
#     user = models.ForeignKey(User)
#     details = models.TextField()
#     category = models.ForeignKey(Category)
#     is_active = models.BooleanField(default=True)
#     created_at = models.DateTimeField(auto_now_add=True)
# 
#     def __unicode__(self):
#         """
#         function returns unicode representation of a note
#         """
#         return self.title


from django.contrib.auth.models import User
from rest_framework import serializers
from common.models import Product
from notes.models import Category, Note



class UserSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = User
        fields = ('id', 'url', 'username', 'email', 'is_staff')


class ProductSerializer(serializers.ModelSerializer):
    class Meta:
        model = Product
        fields = ('id', 'name', 'wholesale_price', 'retail_price')


class CategorySerializer(serializers.ModelSerializer):
    class Meta:

# Path: common/models.py
# class Product(models.Model):
#     """
#     product model for the items etc.
#     """
#     name = models.CharField(max_length=64)
#     description = models.CharField(max_length=1024, unique=True)
#     wholesale_price = models.PositiveIntegerField(default=0)
#     retail_price = models.PositiveIntegerField(default=0)
#     img = models.ImageField(upload_to = 'prod_imgs/', default = 'prod_imgs/default.png')
#     created_at = models.DateTimeField(auto_now_add=True)
# 
#     def __unicode__(self):
#         """
#         function returns unicode representation of a product
#         """
#         return self.name
# 
# Path: notes/models.py
# class Category(models.Model):
#     """
#     category for a note
#     """
#     name = models.CharField(max_length=64)
#     user = models.ForeignKey(User)
# 
#     def __unicode__(self):
#         """
#         function returns unicode representation of a category
#         """
#         return self.name
# 
#     class Meta:
#         verbose_name_plural = "categories"
# 
# class Note(models.Model):
#     """
#     model for a note
#     """
#     title = models.CharField(max_length=64)
#     user = models.ForeignKey(User)
#     details = models.TextField()
#     category = models.ForeignKey(Category)
#     is_active = models.BooleanField(default=True)
#     created_at = models.DateTimeField(auto_now_add=True)
# 
#     def __unicode__(self):
#         """
#         function returns unicode representation of a note
#         """
#         return self.title


# Path: api/serializers.py
from django.contrib.auth.models import User
from rest_framework import serializers
from common.models import Product
from notes.models import Category, Note




class UserSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = User
        fields = ('id', 'url', 'username', 'email', 'is_staff')


class ProductSerializer(serializers.ModelSerializer):
    class Meta:
        model = Product
        fields = ('id', 'name', 'wholesale_price', 'retail_price')


class CategorySerializer(serializers.ModelSerializer):
    class Meta:

        model = Category