from datetime import datetime

class Base(object):
  def load(self, data):
    for name, value in data.items():
      if hasattr(self, name):
        setattr(self, name, value)

    return self

  def value_to_time(self, value):
    if value != None:
      return datetime.strptime(value, '%Y-%m-%dT%H:%M:%S+00:00')

from datetime import datetime

class Base(object):
  def load(self, data):
    for name, value in list(data.items()):
      if hasattr(self, name):
        setattr(self, name, value)

    return self

  def value_to_time(self, value):
    if value != None:
      return datetime.strptime(value, '%Y-%m-%dT%H:%M:%S+00:00')

Update dict.items() for Python 3 compatibility
Update dict.items() for Python 3 compatibility

In Python 3 `items()` return iterators, and a list is never fully
build. The `items()` method in Python 3 works like `viewitems()` in
Python 2.7.

For more information see:
https://docs.python.org/3/whatsnew/3.0.html#views-and-iterators-instead-of-lists
