On 8/15/06, jelle <[EMAIL PROTECTED]> wrote: > > > Hi, > > Enjoying django while working on my new site. Things is that I'm > experiencing a freak error. When finishing an upload, the object > generated by the upload action is deleted. > Checking out the history in the admin interface gives the following: > > Aug. 15, 2006, 9:09 p.m. jelle Added paper image "PaperImage > object". Changed order for paper image "PaperImage object" and image > file for paper image "PaperImage object". Deleted paper image > "PaperImage object". > Aug. 15, 2006, 9:15 p.m. jelle Added paper image "PaperImage object". > Changed title of the image for paper image "PaperImage object", order > for paper image "PaperImage object" and image file for paper image > "PaperImage object". Deleted paper image "PaperImage object".
Hi Jelle, I haven't noticed this exact behaviour before, with objects being created and then immediately deleted, but it may be related to a ticket I filed a couple of days ago -- http://code.djangoproject.com/ticket/2534 -- basically, if the only core field in your model is an ImageField or a FileField, then the model won't work correctly in the admin interface. Looking at the Django souce code, I believe that what is happening is that Django is ignoring the "core=True" on your ImageField, and is saving the object (because no core fields were missed) and then immediately deleting it (because no core fields were given) As a workaround, try giving another field, such as the title, the attribute "core=True", and see if that help things. > Also I noticed that a directory media/paper_images was not created. > Also after having added the directory the upload fails... > Any ideas on how to avoid this issue? Is this a permissions issue? If you're running Django behind Apache, for instance, then the media directory needs to be writable by the user account that Apache is running under (www-data on my Debian systems, for example). Double-check the directory ownerships and permissions, and see if you can get it to work with a FileField in a simple model. Regards, Ian Clelland <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

