title: Convert db.Key to ndb.Key - Python on AppEngine
body: <p>It seems that db.Key and ndb.Key instances are not the same.</p>
  
  <p>I have a db.Key instance. How do I convert it to an ndb.Key?</p>
  
  <p>This is what I'm trying to do:</p>
  
  <pre><code>NDBEntity(ndb.Model):
    some_property = ndb.StringProperty()
  
  DBEntity(db.Model):
    some_property = ndb.StringProperty()
  
  # I have an instance of a DBEntity already saved in the datastore
  db_entity_instance = DBEntity.all().get()
  
  ndb_entity_instance = NDBEntity(id="some_id", parent=db_entity_instance.key(), some_property="foo").put()
  # The above line doesn't work because it expects a Key Instance for the parent, and it doesn't seem to recognize a db.Key instance.
  </code></pre>
  
  <p>Any ideas?</p>