Re: ForeignKey model attribute value in save() method

2009-07-19 Thread onoxo
after some debugging i find that i had a bug in filebrowser app. the code from above is ok and self.photo_set is something that i forget to remove before posting. but can you tell me how should i convert to unicode? self.slug = unicode(self.photo_set)+unicode(self.photo_item) is this ok? On Jul

Re: ForeignKey model attribute value in save() method

2009-07-19 Thread Daniel Roseman
On Jul 17, 4:08 pm, onoxo wrote: > how can i access ForeignKey model attribute value in save() or > __unicode__ method? > some hint will help. > > here is my model.py: > > class PhotoSetPhotoItem(models.Model): >     photo_item = models.ForeignKey('Photo', related_name='photoitem') >     slug = m

Re: ForeignKey model attribute value in save() method

2009-07-19 Thread onoxo
does someone have a hint on this one? On Jul 17, 5:08 pm, onoxo wrote: > how can i access ForeignKey model attribute value in save() or > __unicode__ method? > some hint will help. > > here is my model.py: > > class PhotoSetPhotoItem(models.Model): >     photo_item = models.ForeignKey('Photo', r

ForeignKey model attribute value in save() method

2009-07-17 Thread onoxo
how can i access ForeignKey model attribute value in save() or __unicode__ method? some hint will help. here is my model.py: class PhotoSetPhotoItem(models.Model): photo_item = models.ForeignKey('Photo', related_name='photoitem') slug = models.SlugField(blank = True, null = True) de