imip-agent

Change of imipweb/data.py

1253:333740ca50b6
imipweb/data.py
     1.1 --- a/imipweb/data.py	Tue Sep 12 18:33:53 2017 +0200
     1.2 +++ b/imipweb/data.py	Tue Sep 12 20:27:38 2017 +0200
     1.3 @@ -86,7 +86,7 @@
     1.4              isinstance(self.start, datetime) or isinstance(self.end, datetime),
     1.5              self.tzid,
     1.6              self.origin,
     1.7 -            self.replaced
     1.8 +            self.replaced and True or False
     1.9              )
    1.10  
    1.11      def get_form_date(self, dt, attr=None):
    1.12 @@ -119,6 +119,13 @@
    1.13      def __repr__(self):
    1.14          return "FormPeriod%r" % (self.as_tuple(),)
    1.15  
    1.16 +    def __cmp__(self, other):
    1.17 +        result = RecurringPeriod.__cmp__(self, other)
    1.18 +        if result:
    1.19 +            return result
    1.20 +        other = form_period_from_period(other)
    1.21 +        return cmp(self.replaced, other.replaced)
    1.22 +
    1.23      def as_event_period(self, index=None):
    1.24  
    1.25          """