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 allowing outside admin to edit model information? In my opinion that's something very common. For example... For previous Person model, I want to allow in my website users to allow its own data. How can I do that? form_for_model doesn't work properly when editing existing data for FileFields (alse for ManyToManyFields). Not sure if creating my own form would work, but it would be a lot of repetitive work. Thanks! Marc On Nov 17, 8:30 pm, Thomas Steinacher <[EMAIL PROTECTED]> wrote: > Hello, > > Maybe the snippet which I created today can help you. It displays a > delete checkbox next to the <input > type="file">: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 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=True) > > > Imagine that I've created a person record with a picture of anoother > > person, and I want to delete it (the picture). How can I do? I think > > that in admin it should be a checkbox for FileFields to remove > > content. > > > Second problem that I have. With an example as well. > > > In last application I want my users to upload its own data, so I > > create a page with a form generated with form_for_model for previous > > model. > > > When displayed, for a user that already exists, and already has a > > picture, an empty <input type="file" ... /> is displayed for picture > > field. User can't see it's own picture with admin's link, and when > > saved, old picture is dropped. I think that it should work like in > > admin (with delete checkbox). > > > Please, comment me what you think about and if necessary I'll develop > > fixing patches. > > > Thanks! > > Marc --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" 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-developers?hl=en -~----------~----~----~----~------~----~------~--~---
