Am Mittwoch, 25. Oktober 2006 03:20 schrieb Malcolm Tredinnick: > On Tue, 2006-10-24 at 19:10 +0200, Dirk Eschler wrote: > > Hi, > > > > i'm trying to store an uploaded image in a directory named after its id. > > Like in this simplified example: > > > > class Project(models.Model): > > image = models.ImageField(upload_to='upload/projects/'+self.id) > > > > Since self isn't defined, how can i access the id? > > Some of these articles might help: > > http://groups.google.com/group/django-users/search?q=customizing+file > +field+filename& > > Regards, > Malcolm
Thanks for the responses. What's a good place to keep custom Field classes like the AutoImageField? Do i just add them to the project root or a subdirectory and import them in the appropriate model, or is there a special directory where Django looks for them? Best Regards, Dirk Eschler -- Dirk Eschler <mailto:[EMAIL PROTECTED]> http://www.krusader.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---