Hi,

http://www.djangoproject.com/documentation/files/,
section `The File Object' states that after opening
a file and passing it to File from django.core.files,
I should be able to use the File attributes like
size, url, etc.

I'm trying to do something similar:

>>> f = open('image.jpg', 'r')
>>> f
<open file '......'>
>>> from django.core.files import File
>>> File(f)
<File: image.jpg>
>>> File(f).url
Traceback (most recent call last):
  File "<console>", line 1, in <module>
AttributeError: 'File' object has no attribute 'url'

1. Investigating django/core/files/base.py shows that the
File class does not provide aforementioned attributes, but
maybe I am completely missing something?
(django svn-8684)

2. Is there another way to create a File object without
opening the file first? I just need the name, path and url
in a template, but I don't want to store these things in
an ImageField, instead just glob it from the directory.

--~--~---------~--~----~------------~-------~--~----~
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