On Jul 10, 5:37 pm, "Beetle B." <[EMAIL PROTECTED]> wrote:
> Hi,
>
> If I do some_object.users.add(user), it won't complain if the user was
> already in some_object.
>
> Likewise, if I do some_object.users.remove(user), it won't complain if
> the user was never there.
>
> Can I rely on this behavior in the future?
>
> I currently do explicit checks: I create a list of all the users, and
> manually check if user is in that list. I then execute the command
> based on that - but it would be nice if I could avoid coding in such
> checks...
It's not necessary to explicitly check this since the add and remove
methods already do exactly that.
And, in the very unlikely case that this behaviour is changed in the
future, you would certainly see it mentioned in the backwards
compatibility breakage list here:
http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---