views:

33

answers:

1

How does EmailProperty differ from StringProperty? Consider these two examples:

# example 1: store an e-mail address in an EmailProperty
class MyModel(db.Model):
  email_address = db.EmailProperty()
m = MyModel()
m.email_address = db.Email("[email protected]")

# example 2: store an e-mail address in a StringProperty
class MyModel(db.Model):
  email_address = db.StringProperty()
m = MyModel()
m.email_address = "[email protected]"
+2  A: 

If you call entity.to_xml(), an EmailProperty will come back as gd:email in your entity's Atom representation.

Note that using an EmailProperty does not provide automatic validation of email address formatting.

Drew Sears
but atom format does not has gd:email , yes ?
zjm1126
gd:email is part of the GData API, which is fully compliant with AtomPub.
Drew Sears
so it is not useful for normal atom.
zjm1126