On Thu, Dec 4, 2008 at 7:11 AM, TLH <[EMAIL PROTECTED]> wrote:

> Consider the case where we have two (or more) properties that appear
> in a number of classes, such as a Point class:
>
> class Point(db.Model):
>  x = db.IntegerProperty()
>  y = db.IntegerProperty()
>
> I want a Circle class to have the members "center" and "radius," which
> is a point and an integer; Square to have the members "topleft" and
> "width", which is a point and an integer; Rectangle to have "topleft"
> and "bottomright" which is two points; and so forth.
>
> How should this family of classes be implemented?

You should implement a PointProperty class, inheriting from
db.Property. See this article:

http://code.google.com/appengine/articles/extending_models.html


Dave.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to