Hi,

First post, be gentle :), I cant find a solution here or on StackOverflow, 
which either means that I am missing something obvious, or the answer is 
'you cant', or I am googling for the wrong thing. I am using Django 1.6 on 
Kubuntu with PIL...

I have a simple UserProfile with an image field (and a Textfield), which 
uploads the file fine and displays it in the template from MEDIA_URL fine, 
all working great. I am using the UpdateView generic view to do it and all 
is dandy, except..

The 'fileupload' form field/widget {{ form.mugshot }} adds some extra HTML 
to the widget which I would prefer wasn't there:

"Currently: " <a href="path/to/file">path/to/file</a><br/>"Change: "

Is there a way to get rid of that extraneous HTML? It looks ugly and is 
unnecessary as far as I can see :( but this might not even be Django 
related.. sorry if I am barking up the wrong tree, but I have lost count of 
the trees now.. I have found some possible soultions, but some are really 
complicated and others just dont seem to work for me.

Here is a simplified version of my model and view:

*models.py*

> class UserProfile(models.Model):
>
>     user = models.OneToOneField(User, related_name='profile')
>
>     about_me = models.TextField(max_length="500")
>
>     mugshot = 
>> models.ImageField(max_length=1024,storage=OverwriteStorage(), 
>> upload_to=image_file_name, default = "images/profiles/anon.user.png")
>
>
*views.py*

> class ProfileUpdate(UpdateView):
>     model = UserProfile
>     fields = ['mugshot', 'about_me']
>     template_name_suffix = '_update_form'


Any clues or pointers? Even what to Google for would be good!

Thanks!
Jim

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a73810b0-0fc1-4ba2-abb4-3a86d9714153%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to