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)

--

You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.


Reply via email to