class CarWrapper(object):

    def __init__(self,doors=4,**kwds):
       if door < 0:
           throw Exception() # throw whatever exception you want here.
       else:
           self.car = Car(door) # instantiate your db.Model instance.

       # This is an example of your own getter to expose the properties of
your underlying db.Model instance.
       def GetDoorNumber(self):
           if self.car:
               return self.car.doors

This may not be the best approach, but this is what I can think of for now.
The drawback is that you need to add your own getters/setters for each
property of your underlying db.Model instance that you want to expose, so it
can get very cumbersome if you have a lot of properties/models. But if you
just have a few it shouldn't be too bad to use.

Hope this helps.

[?]

On Wed, Aug 24, 2011 at 1:26 PM, Santiago Basulto <
[email protected]> wrote:

> I was doing that. But it seems weird. I'd like to have everything in one
> piece. I'd like to make my models "intelligent pieces" not just "data
> holders". You know what i mean?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/IFThVHNdAj0J.
>
> 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.
>



-- 
Yanzheng Li
Technical Solutions Engineer
Partner Solutions Organization
Google Inc.

-- 
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.

<<360.gif>>

Reply via email to