Possible bug with multi-db changes

4 views
Skip to first unread message

Sean Brant

unread,
Dec 26, 2009, 11:22:41 PM12/26/09
to Django developers
I just upgraded to the latest trunk today and the admin now throws an
exception http://dpaste.com/138130/ when I try and save to a
ImageField. I messed with it a bit to make sure that it was not
something else in my code that could be causing the error. It looks
like the error only occurs when I have inlines defined on my
ModelAdmin and I try and save an image. He is the simplest thing that
fails for me. I only tested this on sqlite.

# admin.py
from django.contrib import admin
from django.contrib.auth.models import User

from models import Account, Membership

class MembershipInline(admin.TabularInline):
model = Membership

class AccountAdmin(admin.ModelAdmin):
model = Account
inlines = [
MembershipInline,
]

admin.site.register(Account, AccountAdmin)


# models.py
from django.contrib.auth.models import User
from django.db import models

class Account(models.Model):
name = models.CharField(max_length=100)
logo = models.ImageField(upload_to='logo')
users = models.ManyToManyField(User, through='Membership')

class Membership(models.Model):
user = models.ForeignKey(User)
account = models.ForeignKey(Account)

Russell Keith-Magee

unread,
Dec 27, 2009, 8:11:27 PM12/27/09
to django-d...@googlegroups.com
On Sun, Dec 27, 2009 at 12:22 PM, Sean Brant <brant...@gmail.com> wrote:
> I just upgraded to the latest trunk today and the admin now throws an
> exception http://dpaste.com/138130/ when I try and save to a
> ImageField. I messed with it a bit to make sure that it was not
> something else in my code that could be causing the error. It looks
> like the error only occurs when I have inlines defined on my
> ModelAdmin and I try and save an image. He is the simplest thing that
> fails for me. I only tested this on sqlite.

Hi Sean

Thanks for the report. I'll try and take a look at this today and work
out what is going on. In the meantime - if you could open this as a
ticket, I'd be much obliged.

Yours,
Russ Magee %-)

Sean Brant

unread,
Dec 27, 2009, 9:03:19 PM12/27/09
to Django developers
> Thanks for the report. I'll try and take a look at this today and work
> out what is going on. In the meantime - if you could open this as a
> ticket, I'd be much obliged.

Russ

I created a ticket for you http://code.djangoproject.com/ticket/12453.

Thanks for looking into this.
- Sean

Reply all
Reply to author
Forward
0 new messages