mirror of
https://github.com/pinry/pinry.git
synced 2025-11-14 00:55:43 +01:00
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.
22 lines
558 B
Python
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']
|