Форум сайта python.su
вот такая вот модель
class image(models.Model): pub_date = models.DateTimeField() description_src = models.TextField() description = models.TextField() image = models.ImageField(upload_to = 'images') def save(self, request = None): if request != None and request.user.has_perm('gallery.add.image'): self.description_src = escape(request.POST['description']) self.description = markdown(self.description_src) self.pub_date = datetime.now() self.image = ???? super(image, self).save()
Офлайн