#8774: ImageField errors in admin inline editing
--------------------------------------+-------------------------------------
Reporter: ramin | Owner: nobody
Status: reopened | Milestone: 1.0
Component: Template system | Version: SVN
Resolution: | Keywords: imagefield admin inline
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
--------------------------------------+-------------------------------------
Comment (by ramin):
The following models are used:
{{{
class Entry(models.Model):
pub_date = models.DateTimeField('date published')
created = models.DateTimeField(auto_now_add=True, editable=False)
edited = models.DateTimeField(auto_now=True, editable=False)
title = models.CharField(max_length=200, blank=True)
title_fi = models.CharField(max_length=200, blank=True)
is_memorial = models.BooleanField('Use special layout?',
default=False)
class Image(models.Model):
entry = models.ForeignKey(Entry, related_name='images')
file = models.ImageField(upload_to="%Y")
caption = models.TextField()
caption_fi = models.TextField()
And forms:
class ImageForm(forms.ModelForm):
file = forms.ImageField()
caption = forms.CharField(label='Default caption',
widget=forms.Textarea)
caption_fi = forms.CharField(label='Caption in Finnish',
required=False, widget=forms.Textarea)
class ImageInline(admin.TabularInline):
model = Image
extra = 1
form = ImageForm
class EntryForm(forms.ModelForm):
pub_date = forms.DateField(label='Publication date',
initial=datetime.date.today() + datetime.timedelta(1))
title = forms.CharField(max_length=200, required=False)
title_fi = forms.CharField(label='Finnish title', max_length=200,
required=False)
is_memorial = forms.BooleanField(label='Use special layout?',
initial=False, required=False)
tags = forms.CharField(max_length=200,required=False)
class EntryAdmin(admin.ModelAdmin):
date_hierachy = 'pub_date'
list_display = ('pub_date', 'title')
list_filter = ('pub_date',)
ordering = ('-pub_date',)
search_fields = ('pub_date', 'title')
inlines = [
ImageInline,
]
form = EntryForm
}}}
The same error also occurs without a custom admin form for the Image
model. In fact I created the custom form when I first encountered the
error. I also tried creating a formset to see if it would have solved the
issue.
--
Ticket URL: <http://code.djangoproject.com/ticket/8774#comment:6>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---