-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hey,

to a model Event i attach some images. But how can I delete images  
from an Event?
If I use something like

        http://localhost:8000/moor/admin/doccms/eventimage/2/delete/

manually, the Image's sql entry will be removed, but a Error follows:

        AttributeError at /moor/admin/doccms/eventimage/
        'NoneType' object has no attribute 'manager'

How can I put a link/buttom for every EventImage on the Event admin  
site to remove it's entry?



Thanks, Manuel



class EventImage(models.Model):
     """
     """
     item = models.ForeignKey(Event, edit_inline=models.TABULAR,  
num_in_admin=1)
     picture = models.ImageField(null=True, upload_to='./images/',  
blank=True,core=True)
     caption = models.CharField(_("Optional  
caption"),maxlength=100,null=True, blank=True)
     sort = models.IntegerField(_("Sort Order"), help_text=_("Leave  
blank to delete"), core=True)

     def __str__(self):
         return "Picture of %s" % self.item.short_name

     def get_image_url(self):
         return self.picture

     def get_image_path(self):
         return "/media/"+self.picture

     class Meta:
         ordering = ['sort']
         verbose_name = _("Event Image")
         verbose_name_plural = _("Event Images") 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)

iQEVAwUBRmq+ljOKNHIOcnYMAQi+RQgAlys7Jyo5SgauX5mhKVA48yqZZyl6ejwx
wMRXghFJnuqf3cEJghaV7qbF+qNi2CZOWCBghOG4qyo2v9mWetIcXNinaldSYn6A
oXr/zcWdhSr3y4mLmGXNn+LdJt3t8sTon4gIC0t/2swSObHRsoc20+yIrF5enH9N
+gb0Jj+h3uZyY4B1RNN+lVtRDG/8Q63jNupGKUBhnfErxksJ37CSEPbQfWJSL5FZ
mctfrcKaSWuPJ0WU37hN82zLsyM0beE2brQJMd/Mda06rrRN1YMr9zTA0NypMJk5
wk5d/Zrje2J0tdNKMXOquNohQdb1s2WQ/c7ZnJxnzRwBgyYkESp2rw==
=GUDP
-----END PGP SIGNATURE-----

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to