Creating a List in python for Google App Engine -


before go on, let me have searched internet clarification before asking here.i have class

class course(ndb.model):   tutor = ndb.stringproperty(required=true)   ... 

and student class. want include in course class list of students (represented id)registered on course.from search, came across options stringlistproperty() this website , class listproperty(item_type, verbose_name=none, default=none, ...) google tutorial on types , property classes.i still confused right way this.i need layman's explanation , possibly guide can find tutorial example.thanks

you've got bunch of options, straight forward use ndb.keyproperty repeated=true. values key of particular student. e.g.:

class student(ndb.model):     name = ndb.stringproperty()  class course(ndb.model):     students = ndb.keyproperty(repeated=true)  def create_course(students):     """create new course object , return it.      args:         students: iterable of `student` model instances.     """     c = course()     c.students = [s.key s in students]     return c 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -