> On Jun 13, 2011, at 5:57 PM, Pankaj Singh wrote:
>
>> yes even in get_image_url it will be
>>
>> return os.path.join(settings.MEDIA_URL, 'news',
>> self.image.name.split('/')[-1])
>
writing that function is not necessary.
from: https://docs.djangoproject.com/en/dev/ref/models/fiel
yes even in get_image_url it will be
return os.path.join(settings.MEDIA_URL, 'news',
self.image.name.split('/')[-1])
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/
On Jun 13, 2011, at 12:52 PM, Pulkit Mehrotra wrote:
> problem in using the address stored in imagefield
you should describe your problem a little better!
But I guess the URL is not working?
You shouldn’t use STATIC_URL but MEDIA_URL for the prefix in your template.
STATIC_URL is for static f
problem in using the address stored in imagefield
*this is the news.html:*
News
{% if news_list %}
{% for news in news_list %}
{{ news.image }} || {{ news.news }}
{% endfor %}
{% endif %}
*this is the views*:
from django.shortcuts import render_to_resp
You can't access the old value once you've sent in a new one, unless
you query the database again for the old record before you save the
new.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
Hi,
When I update a register that has a ImageField, the old file is not
deleted from the disk, so I have created a custom save method like
this:
def save( self ):
path = self.get_foto_filename()
delete_file(path)
super(Perfil, self).save()
But path is set to the new file
6 matches
Mail list logo