On 13 Nov, 2009, at 14:12 , Remy Blank wrote:

> Andrea Tomasini wrote:
>> I know it might be a bit late, and out of plan, but I am looking
>> right now into the Milestone object, and I would like to add an
>> extension point to that as well, as there is none now. At least in
>> Agilo, and other plugins do that as well, would be nice to know
>> when a Milestone is renamed, so that we can react to that event.
>> Is someone objecting if I had extension points similar to the
>> ticket ones? (E.g.: milestone_created, milestone_changed,
>> milestone_deleted) ?
> 
> This has been discussed here:
> 
>  http://trac.edgewall.org/ticket/6543
> 
> but AFAICR we haven't reached a decision there about the "generic"
> notification interface.
That would be good :-)

> FWIW, I'd be ok with including a specialized notification interface for
> milestones, as first suggested by Erik Bray in the ticket above, in
> 0.12, and leave the generic interface for later.
Right, I can do that, I also found a kind of "bug" that is the following:

The milestone object assumes to be created, and used in two different requests, 
that might not always be the case:
- In the initialization the Milestone checks the "name" parameter and stores it 
- or not - as a copy in _old_name
- Once I insert a new Milestone, the insert method currently doesn't update the 
_old_name upon success...
- You can't update successfully a milestone after creation, unless you reload 
it again :-(

Index: trac/ticket/model.py
===================================================================
--- trac/ticket/model.py        (revision 8744)
+++ trac/ticket/model.py        (working copy)
@@ -693,7 +693,8 @@
                        "VALUES (%s,%s,%s,%s)",
                        (self.name, to_timestamp(self.due), 
to_timestamp(self.completed),
                         self.description))
-
+        self._old_name = self.name
+        
         if handle_ta:
             db.commit()
         TicketSystem(self.env).reset_ticket_fields()

Should I send all the patches always in here? Is there a sandbox where to check 
this in?

Thanks
ANdreaT
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to