Trying to learn how to deploy server apps on Google App Engine using their conference example.
In the example code, I see following line
# create Conference & return (modified) ConferenceForm
Conference(**data).put()
where 1. Conference is a class derived from ndb.Model with a list of members (see end of the question for its definition)
- data is a dictionary in which some keys are identical to the names of the members of Conference
So, basically it looks like above code is creating an instance of the Conference class with values set to the values associated with the keys in the dictionary data.
Is this a general Python code (i.e creating an instance of a class whose values are initialized with values from a dictionary) or is there something in the ndb.Model init function that uses gettattr/setattr to accomplish above?
definition of Conference class
class Conference(ndb.Model):
"""Conference -- Conference object"""
name = ndb.StringProperty(required=True)
description = ndb.StringProperty()
organizerUserId = ndb.StringProperty()
topics = ndb.StringProperty(repeated=True)
city = ndb.StringProperty()
startDate = ndb.DateProperty()
month = ndb.IntegerProperty()
endDate = ndb.DateProperty()