You can have a flag in cart class to mark if things are cleared. Then in the __iter__ function, check the flag before getting the keys.
If you do this you also need to add the check in add/remove and others accordingly.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a873da51-fe3b-4a75-ba40-7fe6d26fff31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment