Hi Federico,

Maby is better idea you use the models.ImageField(upload_to= path)

ie:
locandina = models.ImageField(upload_to= path)

then in the template you can get the path:

{{ object.locandina.url }}
 
Also, you need to read some about configuration on settings.MEDIA_ROOT and 
settings.MEDIA_URL, for use the imageField.


Regards,
Ronny


El jueves, 23 de mayo de 2013 03:57:02 UTC-4, Federico Erbea escribió:
>
> I'm not sure this is the correct method to use, so I'm open to suggestions.
> Practically I want to display the image retrieving the path where they are 
> saved from the database.
>
> In a class in models.py I have inserted:
>
> locandina = models.FilePathField( path = "C:/Users/Federico.Erbea/Google 
> Drive/Umore/apps/Database/static/Film/Locandina/", recursive=True)
>
> In the Admin the pull-down menu perfectly recovers the files I'm 
> interested in, allowing me to select the appropriate one
> I didn't understand very well how works FilePathField, so I don't know how 
> to pass the information to the template ... I need help, thanks
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to