Hi, I'm having trouble getting a FileField or ImageField to work.
The admin interface successfully validates the field, ensures that
it's an image if I use ImageField, etc. It even shows the normal
confirmation message upon a successful form submission. However, no
record appears in the database and no image is written anywhere.
Here's my simple models.py:
======================================
from django.db import models
# Create your models here.
class Gallery(models.Model):
class Admin:
pass
name = models.CharField('Gallery Name', maxlength=100)
class Meta:
verbose_name='Gallery'
verbose_name_plural='Galleries'
def __str__(self):
return self.name
class Image(models.Model):
gallery = models.ForeignKey(Gallery,
edit_inline=models.STACKED,
num_in_admin=3,
num_extra_on_change=3)
height = models.IntegerField(editable=False)
width = models.IntegerField(editable=False)
file = models.ImageField('Image File',
height_field=height,
width_field=width,
upload_to='gallery',
core=True)
when_uploaded = models.DateTimeField(auto_now_add=True, core=True)
photo_date = models.DateTimeField(auto_now_add=True, core=True)
description = models.TextField(core=True)
def __str__(self):
return self.file
==========================================
And here's a line from my settings.py:
MEDIA_ROOT = '/images/'
For testing purposes, /images/gallery/ has permissions 777 on my
filesystem, as does /images/.
Because no error message of any kind is printed anywhere, I'm having
trouble figuring out what's going wrong. Does anyone have an idea?
Thanks,
-Matt
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---