Opened 16 years ago

Closed 16 years ago

#6244 closed (invalid)

ImageField with a ForeignKey disappears from the db

Reported by: anonymous Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords: ImageField
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

model (basicly the example from the docs, think BlogPost and Comments, but comments are images (perhaphs it's enough for them to have images)), my model:

class Offer(models.Model):
    name = models.CharField()
    ...
    class Admin:pass

class OfferImage(models.Model):
    off = models.ForeignKey(Offer, edit_inline=models.STACKED, num_in_admin=3)
    image = models.ImageField(upload_to='photos', inline_edit )
 

(recent svn version)

  1. I can create an Offer with say, two images.
  2. I can add an image to an offer if I define Admin class for images

*BUT*

  1. saving an offer in the admin interface causes the images to disapear from the db - seriously weird stuff

I didn't do any extensive testing (like if it happens while playing around in the interpreter too. The FileField is in the "stable" tarball versions, so I'm *guessing* this is specific to image's (although - again - didn't try it)

Change History (1)

comment:1 by anonymous, 16 years ago

Resolution: invalid
Status: newclosed

ok, so this is wrong, becouse there's no core=True defined. If that's indeed why the images are disapearing from the db, then i suppouse there should be some warning issued when there's no core=True field.

Note: See TracTickets for help on using tickets.
Back to Top