Opened 17 years ago
Closed 17 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)
- I can create an Offer with say, two images.
- I can add an image to an offer if I define Admin class for images
*BUT*
- 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)
Note:
See TracTickets
for help on using tickets.
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.