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: get_absolute_url with custom extra parameter

2013-02-01 Thread Sammael
t it works. Thank you for your answer, I really appreciate your advice. четверг, 31 января 2013 г., 15:42:28 UTC+4 пользователь Daniel Roseman написал: > > On Thursday, 31 January 2013 05:35:05 UTC, Sammael wrote: > >> Thank you for your answer! >> >> I have a photo alb

Re: get_absolute_url with custom extra parameter

2013-02-01 Thread Sammael
> > The implementation of the filter is in python, and could pass the argument > when calling album's method. (I'd suggest not calling the method > "get_absolute_url", however, because that name is special to Django, and is > not expected to take such an argument.

Re: previous values of custom method in save

2013-01-31 Thread Sammael
nesday, 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. >&

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

Re: get_absolute_url with custom extra parameter

2013-01-30 Thread Sammael
ciated. среда, 30 января 2013 г., 23:34:38 UTC+4 пользователь somecallitblues написал: > > You can't pass parameters to model functions from within a template. What > exactly are you trying to achieve? > > > On 30 January 2013 21:34, Sammael > wrote: >

get_absolute_url with custom extra parameter

2013-01-30 Thread Sammael
Hello friends, Is the any way to pass an extra parameter to get_absolute_url method of a model instance from template? Thank you for your answer. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receivin

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()]

Re: ImageField upload_to issue

2013-01-26 Thread Sammael
ря 2013 г., 3:58:55 UTC+4 пользователь leonardo написал: > > There is no t_upload_path > > > 2013/1/25 Sammael > > >> Hello, folks! >> >> Here is the relevant part of my model: >> >> def i_upload_to(instance, filename): >> ret

ImageField upload_to issue

2013-01-25 Thread Sammael
Hello, folks! Here is the relevant part of my model: def i_upload_to(instance, filename): return '/'.join([strftime('i/%y%m/%d'), filename]) def t_upload_to(instance, filename): return '/'.join([strftime('t/%y%m/%d'), filename]) class Image(models.Model): ima

Re: django: creating tag groups

2013-01-17 Thread Sammael
аря 2013 г., 17:01:21 UTC+4 пользователь Amirouche написал: > > > 2013/1/16 Sammael > > >> Unfortunately, I don't know how it should be. Also I believe your idea of >> trees is much simpler and cleaner and thus much better. >> >> I've installed

Re: django: creating tag groups

2013-01-16 Thread Sammael
вторник, 15 января 2013 г., 16:34:36 UTC+4 пользователь Amirouche написал: > > > The example in the code is not working, <> class is not referenced > anywhere. I'm not familiar with multi-widgets but if a tree widgets is not > what you want or don't get it work, I think it's the right approach.

Re: django: creating tag groups

2013-01-15 Thread Sammael
вторник, 15 января 2013 г., 5:56:51 UTC+4 пользователь Amirouche написал: > Why are you creating two groups of tags ? Why not use a specific widgets > like a tree widget ? > Great idea! Think, I'll give this a try. I think that it would be useful. maybe try widgets attrs

django: creating tag groups

2013-01-14 Thread Sammael
*The models* class TagGroup(models.Model): name = models.SlugField(max_length=50, unique=True, db_index=True) class Tag(models.Model): name = models.SlugField(max_length=50, unique=True, db_index=True) group = models.ForeignKey(TagGroup) def __unicode__(sel

creating tag groups

2013-01-14 Thread Sammael
*The models* class TagGroup(models.Model): name = models.SlugField(max_length=50, unique=True, db_index=True) class Tag(models.Model): name = models.SlugField(max_length=50, unique=True, db_index=True) group = models.ForeignKey(TagGroup) def __unicode__(s