On Tue, Nov 09, 2010 at 05:17:17AM -0800, Yohann REBATTU wrote:
> Hello,
> 
> Thank you,
> your answer is really clear and does make sense for me!
> 
> but unfortunatly it does not fix the problem, using list(), I get an
> index out of range error in __delitem__ function.

D'oh.  I should've learned not to post late at night, when half of my
brain is not working.  Of course the indexes will shift if you remove
something.  How about this instead:

    def update_tags(self, id=None):
        ...
        for tag in list(page.tags):
            if tag.id not in self.form_result['tags']:
                page.tags.remove(tag)
        ...

?

Marius Gedminas
-- 
Never trust an operating system you don't have sources for.

Attachment: signature.asc
Description: Digital signature

Reply via email to