Google App Engine getting verbose_name of a property from an instance

Posted by Brian M. Hunt on Stack Overflow See other posts from Stack Overflow or by Brian M. Hunt
Published on 2010-04-23T23:34:08Z Indexed on 2010/04/23 23:53 UTC
Read the original article Hit count: 233

Given a model likeso:

 from google.appengine.ext import db
 class X(db.Model):
    p = db.StringProperty(verbose_name="Like p, but more modern.")

How does one access verbose_name from x=X() (an instance of X)?

One might expect that x.p.verbose_name would work, or alternatively x.properties()['p'].verbose_name, but neither seems to work.

Thanks!

EDIT: x.name.verbose_name => x.p.verbose_name

© Stack Overflow or respective owner

Related posts about google-app-engine

Related posts about gae-python