Files
Pinry/pinry/pins/models.py
Krzysztof Klimonda d0a71244b5 Another major Pinry model rewrite
Generate thumbnail and standard image on request, and use
http://github.com/mirumee/django-images for generating them. Also,
remove the CreatePin page as pin creation is going to be done
in JavaScript. Create UploadImage view for uploading images from
computer.
2013-02-25 04:08:35 +01:00

22 lines
558 B
Python

from django.db import models
from django_images.models import Image
from taggit.managers import TaggableManager
from ..core.models import User
class Pin(models.Model):
submitter = models.ForeignKey(User)
url = models.TextField(blank=True, null=True)
description = models.TextField(blank=True, null=True)
image = models.ForeignKey(Image, related_name='pin')
published = models.DateTimeField(auto_now_add=True)
tags = TaggableManager()
def __unicode__(self):
return self.url
class Meta:
ordering = ['-id']