# Path: snippet/models.py
# class Snippet(models.Model):
#     code         = models.TextField()
#     description  = models.TextField()
#     slug         = models.SlugField()
#     lexer        = models.TextField()
#     key          = models.TextField()
#     created      = models.DateTimeField(auto_now_add=True)
#     user         = models.ForeignKey(User)
#     public       = models.BooleanField()
#     tags         = TagField()
#     
#     def __unicode__(self):
#         return u'%s' %(self.description)
#     
#     def get_tags(self):
#         return Tag.objects.get_for_object(self) 
#     
#     def get_absolute_url(self):
#         return "/%s/%s/" % (self.user.username, self.slug)
#     
#     def is_favorite(self, user):
#         from snipt.favsnipt.models import FavSnipt
#         try:
#             FavSnipt.objects.get(snipt=self, user=user)
#             return 'favorited'
#         except:
#             return ''


from django.contrib.auth.models import User
from django.db import models
from snippet.models import Snippet


class FavSnipt(models.Model):
    snipt    = models.ForeignKey(Snippet)
    user     = models.ForeignKey(User)
    created  = models.DateTimeField(auto_now_add=True)
    

# Path: snippet/models.py
# class Snippet(models.Model):
#     code         = models.TextField()
#     description  = models.TextField()
#     slug         = models.SlugField()
#     lexer        = models.TextField()
#     key          = models.TextField()
#     created      = models.DateTimeField(auto_now_add=True)
#     user         = models.ForeignKey(User)
#     public       = models.BooleanField()
#     tags         = TagField()
#     
#     def __unicode__(self):
#         return u'%s' %(self.description)
#     
#     def get_tags(self):
#         return Tag.objects.get_for_object(self) 
#     
#     def get_absolute_url(self):
#         return "/%s/%s/" % (self.user.username, self.slug)
#     
#     def is_favorite(self, user):
#         from snipt.favsnipt.models import FavSnipt
#         try:
#             FavSnipt.objects.get(snipt=self, user=user)
#             return 'favorited'
#         except:
#             return ''


# Path: favsnipt/models.py
from django.contrib.auth.models import User
from django.db import models
from snippet.models import Snippet



class FavSnipt(models.Model):
    snipt    = models.ForeignKey(Snippet)
    user     = models.ForeignKey(User)
    created  = models.DateTimeField(auto_now_add=True)
    

    def __unicode__(self):