Re: after_acreate after_change

2006-07-05 Thread DavidA
Malcolm Tredinnick wrote: > You've drifted a bit from the original topic here, though, haven't you? Um, yes. Guilty as charged... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: after_acreate after_change

2006-07-04 Thread Malcolm Tredinnick
On Wed, 2006-07-05 at 01:59 +, DavidA wrote: > > Malcolm Tredinnick wrote: > > On Tue, 2006-07-04 at 02:11 +, DavidA wrote: > > I'm not sure a created() method is going to be the right API, since this > > event has very transitory relevance, but your example does suggest we > > may need

Re: after_acreate after_change

2006-07-04 Thread DavidA
Malcolm Tredinnick wrote: > On Tue, 2006-07-04 at 02:11 +, DavidA wrote: > I'm not sure a created() method is going to be the right API, since this > event has very transitory relevance, but your example does suggest we > may need something extra here at some point. I agree that created()

Re: after_acreate after_change

2006-07-03 Thread Malcolm Tredinnick
On Tue, 2006-07-04 at 02:11 +, DavidA wrote: > > Malcolm Tredinnick wrote: > > On Mon, 2006-07-03 at 08:54 -0700, Glenn Tenney wrote: > > > Perhaps instead of relying on the behavor of the object's ID not > > > existing until it's been created, that should become a method. > > > something

Re: after_acreate after_change

2006-07-03 Thread Don Arbow
On Jul 3, 2006, at 7:11 PM, DavidA wrote: > > In this case it would be up to the app or developer to populate the > slug primary key field before saving. But then just testing the pk > field wouldn't really tell me if it was saved, unless I misunderstand > what "self.pk" is actually doing behind

Re: after_acreate after_change

2006-07-03 Thread DavidA
Malcolm Tredinnick wrote: > On Mon, 2006-07-03 at 08:54 -0700, Glenn Tenney wrote: > > Perhaps instead of relying on the behavor of the object's ID not > > existing until it's been created, that should become a method. > > something like Model.created() returning true/flase or Model.is_created >

Re: after_acreate after_change

2006-07-03 Thread Glenn Tenney
On Tue, Jul 04, 2006 at 10:10:55AM +1000, Malcolm Tredinnick wrote: > I can't see any real advantage in this. As Ivan shows, it's only a > couple of lines of code anyway (and a more or less documented feature). > The boolean test for "not created" at the moment is "if not self.pk:", > which seems

Re: after_acreate after_change

2006-07-03 Thread Malcolm Tredinnick
On Mon, 2006-07-03 at 08:54 -0700, Glenn Tenney wrote: > On Mon, Jul 03, 2006 at 07:09:35AM -0500, James Bennett wrote: > > You can also differentiate between the initial save and later updates > > by checking -- before calling the parent class' 'save' method -- > > whether the object has an ID;

Re: after_acreate after_change

2006-07-03 Thread Spock
Yes yes :) That was the case :) It exactly fit my needs Thankyou very much.. Regards - Spock - male :P --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: after_acreate after_change

2006-07-03 Thread Glenn Tenney
On Mon, Jul 03, 2006 at 07:09:35AM -0500, James Bennett wrote: > You can also differentiate between the initial save and later updates > by checking -- before calling the parent class' 'save' method -- > whether the object has an ID; if it doesn't, then the object is being > created for the first

Re: after_acreate after_change

2006-07-03 Thread Malcolm Tredinnick
On Mon, 2006-07-03 at 16:16 +0400, Ivan Sagalaev wrote: > Malcolm Tredinnick wrote: > > However, I suspect that is not what you want (since I don't use Rails, I > > have to guess a bit from the names). We don't currently have any > > post_update and post_create signals being emitted. This sort of

Re: after_acreate after_change

2006-07-03 Thread Ivan Sagalaev
Malcolm Tredinnick wrote: > However, I suspect that is not what you want (since I don't use Rails, I > have to guess a bit from the names). We don't currently have any > post_update and post_create signals being emitted. This sort of > functionality will eventually be possible, but some reworking

Re: after_acreate after_change

2006-07-03 Thread James Bennett
And I also missed my footnoted reference: http://www.djangoproject.com/documentation/model_api/#overriding-default-model-methods -- "May the forces of evil become confused on the way to your house." -- George Carlin --~--~-~--~~~---~--~~ You received this

Re: after_acreate after_change

2006-07-03 Thread James Bennett
On 7/3/06, Spock <[EMAIL PROTECTED]> wrote: > after_create is a hook executed when commit in database is made when > new record is craeted: You can accomplish the same thing by adding a custom 'save' method on the model[1]; Django used to offer '_pre_save' and '_post_save' methods, but anything

Re: after_acreate after_change

2006-07-03 Thread Malcolm Tredinnick
On Mon, 2006-07-03 at 21:08 +1000, Malcolm Tredinnick wrote: > On Mon, 2006-07-03 at 03:55 -0700, Spock wrote: > > Hello, > > is there some equvalent to rails actions after_create,after_change ?? > > Or where start write such tasks ? > > > > I'll would like to send e-mails under some actions

Re: after_acreate after_change

2006-07-03 Thread Malcolm Tredinnick
On Mon, 2006-07-03 at 03:55 -0700, Spock wrote: > Hello, > is there some equvalent to rails actions after_create,after_change ?? > Or where start write such tasks ? > > I'll would like to send e-mails under some actions made in admin > interface - some specific updates or creations.. There is a

after_acreate after_change

2006-07-03 Thread Spock
Hello, is there some equvalent to rails actions after_create,after_change ?? Or where start write such tasks ? I'll would like to send e-mails under some actions made in admin interface - some specific updates or creations.. Regars Spock, --~--~-~--~~~---~--~~