2013-02-23 20:33:10 +01:00
|
|
|
from django.db import models
|
2013-02-24 00:15:59 +01:00
|
|
|
|
2013-02-25 04:08:35 +01:00
|
|
|
from django_images.models import Image
|
2012-09-28 04:42:13 +00:00
|
|
|
from taggit.managers import TaggableManager
|
2012-04-26 03:44:16 +00:00
|
|
|
|
2013-02-24 00:15:59 +01:00
|
|
|
from ..core.models import User
|
2013-02-22 01:53:18 +01:00
|
|
|
|
2012-04-26 03:44:16 +00:00
|
|
|
|
|
|
|
|
class Pin(models.Model):
|
2012-07-24 23:26:38 +00:00
|
|
|
submitter = models.ForeignKey(User)
|
2012-07-03 02:24:34 +00:00
|
|
|
url = models.TextField(blank=True, null=True)
|
2012-04-26 15:38:21 +00:00
|
|
|
description = models.TextField(blank=True, null=True)
|
2013-02-25 04:08:35 +01:00
|
|
|
image = models.ForeignKey(Image, related_name='pin')
|
2012-07-12 22:49:19 +00:00
|
|
|
published = models.DateTimeField(auto_now_add=True)
|
2012-09-28 04:42:13 +00:00
|
|
|
tags = TaggableManager()
|
2012-04-26 03:44:16 +00:00
|
|
|
|
|
|
|
|
def __unicode__(self):
|
2012-04-26 15:38:21 +00:00
|
|
|
return self.url
|
2012-04-26 03:44:16 +00:00
|
|
|
|
2012-05-11 02:08:46 +00:00
|
|
|
class Meta:
|
|
|
|
|
ordering = ['-id']
|