From 7420e8eea1496afe1d654a8aac6bee94bec08511 Mon Sep 17 00:00:00 2001 From: Krzysztof Klimonda Date: Fri, 22 Feb 2013 01:53:18 +0100 Subject: [PATCH] Use the proxy model for Pin.submitter so Tastypie uses a correct model for its FKs Tastypie's ModelResource makes use of the underlying Model class to figure out its fields. It obviously breaks when there is inconsistency with models, which is rather rare, but possible to accomplish (which I've proven with the previous commit). --- pinry/pins/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pinry/pins/models.py b/pinry/pins/models.py index 80c9e96..8c539b1 100644 --- a/pinry/pins/models.py +++ b/pinry/pins/models.py @@ -1,13 +1,14 @@ from django.db import models from django.core.files import File from django.core.files.temp import NamedTemporaryFile -from django.contrib.auth.models import User from taggit.managers import TaggableManager import urllib2 import os from PIL import Image +from pinry.core.models import User + class Pin(models.Model): submitter = models.ForeignKey(User)