Hi,
I would like each uploaded test to go into a separate directory in my
media_root. In models.py I have:

class TestDetail(models.Model):
    test_grouping = models.ForeignKey(TestGrouping)
    test_name = models.CharField(maxlength=200)
    python_file = models.FileField("Python File",
upload_to='tests/%s/' % test_name)
    control_file = models.FileField("Control File",
upload_to='tests/%s/' % test_name)
    resources = models.FileField("Resource", upload_to='tests/%s/' % test_name)
    def __unicode__(self):
        return self.test_name

    class Admin:
        list_display = ('test_name',)

but in the admin this gives me
home/ian/Web/media/tests/<django.db.models.fields.CharField object at
0x8a3f68c>/fsfuzzer.py
when i try to upload files. This is probably very simple to solve but
i have looked through the docs and googled and nothing seems obvious
yet
thanks
Ian
-- 
http://ianlawrence.info

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