Oh, and I've tried messing about with widget=... parameters, but that
throws errors (not surprisingly -- the admin interface doesn't even
use newforms yet).

On Feb 6, 6:35 pm, "Mae" <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> I need help to make my FileFields display nice "browse" buttons and be
> of type "file" in admin.
>
> I have a model class that looks like this:
> class Award(models.Model):
>         """
>         A film award.
>         """
>         name = models.CharField(maxlength=100, unique=True)
>         image = models.FileField('Image', upload_to="img/awards/", null=True,
> blank=True)
>
>         def __str__(self):
>                 return self.name
>
>         class Admin:
>                 pass
>
> In the settings.py file, I do define MEDIA_ROOT and MEDIA_URL.
>
> I'm using the newforms branch, and I've just updated to today's (Feb
> 6, 2007) version.
>
> Here's my problem:  in the admin interface, the image field is a text
> input field, not a file one.  The HTML source code for the change form
> page looks like:
> <label for="id_image">Image:</label><input type="text" name="image"
> value="" id="id_image" />
>
> If I run this code on my recent trunk django version, everything's
> fine.  The moment I switch to the newforms branch, FileFields stop
> displaying correctly in admin.
>
> Now, I've read this 
> thread:http://groups.google.com/group/django-users/browse_thread/thread/d3a6...
> and the poster reports a problem with his own forms, but says that
> "everything at the admin interface works fine".  So, if he can have
> FileFields on the newforms branch, why am I having a problem?  What am
> I missing?
>
> And I've tried to apply patch 3297 (http://code.djangoproject.com/
> ticket/3297), but that goes against an older version of the branch
> (4421 to be exact), and refuses to patch my version.
>
> I really need File fields to work in admin.  Help!
>
> Mae


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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