我已经确定了这些模式。
class Header(models.Model):
date1 = models.DateField()
class Details(models.Model):
header = models.ForeignKey(Header),
field1 = models.CharField(max_length=10),
archive = models.FileField(upload_to= x )
is it possible to set archive so that the upload_to is set to details.field1 + header.date1: e.g. if header.date1 = 2012-04-28 and details.field1 = sample , the file testing.doc being uploaded automatically stored under MEDIA_ROOT/2012-04-28/sample/testing.doc.