Re: Problems with FileFields/ImageFields

2007-11-17 Thread Marc Garcia
Thanks a lot guys, I like many of your methods for solving the problem, and probably I'll implement one by now. But, I think that discusion should be about if it'll be good to change django itself in any way. May be form_for_model is behaving as expectly, but then, which method has Django for al

Re: Problems with FileFields/ImageFields

2007-11-17 Thread Thomas Steinacher
Hello, Maybe the snippet which I created today can help you. It displays a delete checkbox next to the : http://www.djangosnippets.org/snippets/469/ However, I'm not sure if it will work in admin. tom On 16.11.2007, at 18:12, Marc Garcia wrote: > > There are a couple of things about FileFie

Re: Problems with FileFields/ImageFields

2007-11-17 Thread Panos
> I've a model: > > class Person(model.Model): > name = models.CharField(maxlength=32) > [...] > picture = models.ImageField(upload_to='pictures', blank=True) > > Imagine that I've created a person record with a picture of anoother > person, and I want to delete it (the picture). How c

Re: Problems with FileFields/ImageFields

2007-11-16 Thread [EMAIL PROTECTED]
Every time I make a model with a File or Image Field I create a corresponding boolean field called clear_fileFieldName. And then I override the save action. Checking to see if that clear_fileFieldName is set to true. If it is I, clear the FileField Like this class Property(models.Model): t

Re: Problems with FileFields/ImageFields

2007-11-16 Thread Marty Alchin
On Nov 16, 2007 12:12 PM, Marc Garcia <[EMAIL PROTECTED]> wrote: > First one is about how to delete content in a FileField. With a > example: > > I've a model: > > class Person(model.Model): > name = models.CharField(maxlength=32) > [...] > picture = models.ImageField(upload_to='pictur

Problems with FileFields/ImageFields

2007-11-16 Thread Marc Garcia
There are a couple of things about FileFields that I want to comment. First one is about how to delete content in a FileField. With a example: I've a model: class Person(model.Model): name = models.CharField(maxlength=32) [...] picture = models.ImageField(upload_to='pictures', blank