Hello,

i want to do some validation before my models start.

Something like

class NegativeDoorNumber(BaseException): pass

class Car(db.Model):
   doors = db.IntegerPropery(required=True,default=4)
   
   def __init__(self,doors=4,**kwds):
      if(doors<0):
         raise NegativeDoorNumber("Hey, doors can't be negative")
      db.Model.__init__(self,doors,kwds)

This, of course doesn't work. 

Can you help me?

Thanks!

-- 
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/-/6IlkEdipQtYJ.
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