Re: previous values of custom method in save

2013-02-02 Thread Sammael
Now I'm trying to aviod using *TreeForeignKey. *Unfortunately, with usual * ForeignKey* the behaviuor is the same. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email t

Re: previous values of custom method in save

2013-02-01 Thread Sammael
I've also tried to use signals like this: *@receiver(post_save, sender=Album) def album_save_handler(sender, instance, **kwargs): json.dump( {'name': **instance**.name , 'tags': **instance**.tags_()} , open('/tmp/info.txt', 'wb'), sort_keys=True)* * * And even

Re: previous values of custom method in save

2013-01-31 Thread Sammael
Daniel, thank you for your response. I just use standard "edit album" page in admin interface without any special forms or widgets for ManyToManyField. Perhaps it worth mentioning, I also use django-mptt for Tag like this: *from mptt.models import MPTTModel, TreeForeignKey* * * *class Tag

Re: previous values of custom method in save

2013-01-31 Thread Daniel Roseman
On Wednesday, 30 January 2013 10:31:09 UTC, Sammael wrote: > > When I change 'tags' in admin panel and save my model, old tags are being > written to file 'info.txt' instead of new ones, but it works good with > regular fields like self.name. > How do I overcome this issue? > Thank you in adva

Re: previous values of custom method in save

2013-01-30 Thread Sammael
Any advice please? Still didn't find any solution nor workaround. Maybe it's some kind of query caching? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-u

previous values of custom method in save

2013-01-30 Thread Sammael
Dear friends, here is the relevant part of my model: *class Album(models.Model):* *name = models.CharField(max_length=64, blank=True) * *tags = models.ManyToManyField(Tag, blank=True) * *def tags_(self): * *return ', '.join([t.name for t in self.tags.all()]