Django 1.2 Validation breaks __eq__ on Recurrance Model
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
django-recurrence |
Fix Committed
|
Undecided
|
tamask |
Bug Description
Was having some difficulty with Django Recurrence when upgrading to Django 1.2. Django added model validators which breaks the 'in' check below. Putting a typecheck at the beginning of the __eq__ method seems to solve it. Still testing. See the PROPOSED CHANGE BELOW for more info.
DJANGO 1.2 SOURCE - Django-
....
191 if not self.blank and value in validators.
192 raise exceptions.
PROPOSED CHANGE BELOW
class Recurrence(object):
....
....
def __eq__(self, other):
if type(other) != type(self): # <- Added
return False #<- Added
if not isinstance(other, Recurrence):
raise TypeError('object to compare must be Recurrence object')
return hash(self) == hash(other)
Changed in django-recurrence: | |
status: | New → In Progress |
assignee: | nobody → tamask (tamask) |
Changed in django-recurrence: | |
status: | In Progress → Fix Committed |
Thanks Tamas