imagefield, admin, wrong link

67 просмотров
Перейти к первому непрочитанному сообщению

Gábor Farkas

не прочитано,
19 янв. 2006 г., 09:43:2919.01.2006
– Django users
hi,

i have an ImageField in a model.

when i use the admin interface, everything is fine, except one thing:

the ImageField part consists of:

======
Currently: LINK
Change: <textfield> <button>
======

and the LINK is wrong. it's content is ok, but the HREF is empty.
example:

Currently: <a href="" > logos/firstlogo.png </a><br />

so when you click on it, you just get the actual page.

i thought that it should take me to the submitted file...

MEDIA_URL, MEDIA_ROOT are set up correctly.
the file gets uploaded correctly to the designated folder.

any ideas what's wrong?

thanks,
gabor

Gábor Farkas

не прочитано,
19 янв. 2006 г., 09:48:2619.01.2006
– django...@googlegroups.com

one more thing. the same thing happens with my FileField field also.

so it really seems to be a config problem.. but which setting?

my settings:
MEDIA_ROOT = '/home/gabor/django/simple/static'
MEDIA_URL = 'http://localhost:8000/static/'


thanks,
gabor

arthur debert

не прочитано,
1 февр. 2006 г., 22:33:3501.02.2006
– Django users
Hi Gabor, I am dealing with the same issue here, and I've opened a
ticked for this : http://code.djangoproject.com/ticket/1315

It seems that on the admin's template ('file.html'), filefields are
susbtituted to "bound_field.original_url" which evaluates to blank....
even if you use the "bound_field.original_value" it's still doens't
work... somehow the admin is appending the url to the model's edit
view...

I am pretty clueless to what can this be...

Jakub Labath

не прочитано,
11 мар. 2006 г., 21:35:5511.03.2006
– django...@googlegroups.com
Hi,

I tracked this down.

You can overwrite the template that is responsible for the file
widget, like this.

1. in your templates directory create widget directory.
2. copy trunk/django/contrib/admin/templates/widget/file.html to the
widget folder you created.
3. edit as needed.

Regards

Ответить всем
Отправить сообщение автору
Переслать
0 новых сообщений