Re: save() called 2 times.

2006-05-05 Thread Max Battcher

Jeremy Dunck wrote:
> On 5/5/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote:
> ...
> #Addedamorepowerfulwayofoverridingmodelmethodsremovedhardcoded_pre_save_post_saveetc.

You can thank Trac for that.  Apparently somebody forgot to tell them 
that it might be a good idea to truncate after so many characters just 
so that URLs don't get out of hand...  not to mention all the wasted 
characters sent in your HTTP responses and emails mentioning 
unrealistically long URLs.

-- 
--Max Battcher--
http://www.worldmaker.net/
"I'm gonna win, trust in me / I have come to save this world / and in 
the end I'll get the grrrl!" --Machinae Supremacy, Hero (Promo Track)

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: save() called 2 times.

2006-05-05 Thread Davide Bertola

Victor : in that post it says that _post_save() is called twice, I
tryed to create that _post_save() but I see nobody calls it.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: save() called 2 times.

2006-05-05 Thread Jeremy Dunck

On 5/5/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote:
...
#Addedamorepowerfulwayofoverridingmodelmethodsremovedhardcoded_pre_save_post_saveetc.

Does the Guinness  book of records have an entry for "longest anchor"?  ;-)

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: save() called 2 times.

2006-05-05 Thread Joseph Kocherhans

On 5/5/06, Davide Bertola <[EMAIL PROTECTED]> wrote:
>
> Victor : in that post it says that _post_save() is called twice, I
> tryed to create that _post_save() but I see nobody calls it.

_post_save is a hook method that was used before the magic-removal
branch was merged. Now you just override save() and call
super(MyModel, self).save() if necessary. See this for details:
http://code.djangoproject.com/wiki/RemovingTheMagic#Addedamorepowerfulwayofoverridingmodelmethodsremovedhardcoded_pre_save_post_saveetc.

Joseph

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: save() called 2 times.

2006-05-05 Thread Victor Kropp

dade wrote:

> In my model I have something like this :
> 
> def Image(modes.Model):
> ...
> 
> def save(self):
> print "I've been called"
> ...
> super(Image, self).save()
> 
> I see in the console the print is executed 2 times when I upload the
> image from the admin interface. Is that a bug ? known one ?

Yes, it's a known bug (ticket #639). Same problem was discussed on this 
list just some hours ago. Take a look at 
http://groups.google.com/group/django-users/browse_thread/thread/21acd8811b94d8b6/34bcfd67fec8c444#34bcfd67fec8c444

-- 
VK

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: save() called 2 times.

2006-05-05 Thread arthur debert

yes this is a known bug.

see ticket 639
http://code.djangoproject.com/ticket/639

currently I'm using an ugly work around such as

def save(self):
if self.imagefield :
#do whetever, files does exist...

also this seems to cause problems withe DateFields with auto_now...


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



save() called 2 times.

2006-05-05 Thread dade

In my model I have something like this :

def Image(modes.Model):
...

def save(self):
print "I've been called"
...
super(Image, self).save()

I see in the console the print is executed 2 times when I upload the
image from the admin interface. Is that a bug ? known one ?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---