Head First Python

Page 398

property types

Pool Puzzle Solution Your job was to take the properties from the pool and place them in the correct place in the class code, which is in a file called hfwwgDB.py. Your goal was to assign the correct property type to each of the attributes within your Sighting class.

from google.appengine.ext import db class Sighting(db.Model): db.StringProperty() name =

362   Chapter 10

email =

db.StringProperty()

date =

db.DateProperty()

time =

db.TimeProperty()

location =

db.StringProperty()

fin_type =

db.StringProperty()

whale_type =

db.StringProperty()

blow_type =

db.StringProperty()

wave_type =

db.StringProperty()

Everything is a “StringProperty”, except the “date” and “time” fields.


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.