[gen] Bugfix in the Calendar field.

This commit is contained in:
Gaetan Delannay 2012-12-03 09:33:19 +01:00
parent 387fbaea7c
commit ed3a31ff29

View file

@ -215,7 +215,7 @@ class Calendar(Type):
def getEventsAt(self, obj, date, asDict=True): def getEventsAt(self, obj, date, asDict=True):
'''Returns the list of events that exist at some p_date (=day).''' '''Returns the list of events that exist at some p_date (=day).'''
obj = obj.o # Ensure p_obj is not a wrapper. obj = obj.o # Ensure p_obj is not a wrapper.
if not hasattr(obj, self.name): return if not hasattr(obj.aq_base, self.name): return
years = getattr(obj, self.name) years = getattr(obj, self.name)
year = date.year() year = date.year()
if year not in years: return if year not in years: return