How is the property EmailProperty different from StringProperty?

How is EmailProperty different 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(" larry@example.com ") # example 2: store an e-mail address in a StringProperty class MyModel(db.Model): email_address = db.StringProperty() m = MyModel() m.email_address = " larry@example.com " 
+4
source share
1 answer

If you call entity.to_xml() , EmailProperty will return as gd: email in your person’s Atom view.

Please note that using EmailProperty does not automatically check the formatting of email addresses.

+3
source

Source: https://habr.com/ru/post/1315976/


All Articles