[Schevo-devel] Public "plural" api?

Matthew Scott mscott at goldenspud.com
Mon Dec 12 08:48:53 EST 2005


On 12/12/05, Tom Locke <tom at livelogix.com> wrote:
> Hi folks, hope you had a good weekend :-)
>
> Is there a public api for, e.g. db.Person._plural? Could we drop the _
> on that attribute?

Yes, there is a public API :)

>>> from schevo.label import label, plural
>>> print label(db.Person)
Person
>>> print plural(db.Person)   # When you've defined _plural = 'People'
People
>>> print plural(db.Person)  # When you have not defined _plural
Persons

Extents are the only things that have plural labels, so far --
although I am sure queries should have them too, but the schevo.query
module is a recent addition to Schevo so we haven't put as much heavy
thought into it as the rest (yet!)

Other objects, such as fields instances, entities, transactions, etc.
all have labels.

--
Matthew R. Scott



More information about the Schevo-devel mailing list