Re: FileField: id of row (like strftime)

2007-05-29 Thread Thomas Guettler
Am Freitag, 25. Mai 2007 10:51 schrieb Thomas Güttler: > Hi, > > the upload_to argument to FileField evals strftime formatting. > > I would like to have the ID of the belonging row. > > Example: One MyObject has N attachments. > > class Attachment(models.Model): >

FileField: id of row (like strftime)

2007-05-25 Thread Thomas Güttler
Hi, the upload_to argument to FileField evals strftime formatting. I would like to have the ID of the belonging row. Example: One MyObject has N attachments. class Attachment(models.Model): file=models.FileField(upload_to="%(myobject_id)s") myobject=models.ForeignKey(MyObject) This