On Wed, Oct 5, 2011 at 2:09 PM, Murph <paul.j.mu...@googlemail.com> wrote:

> Nick, any comment on my approach of changing the PolyModel's class via
> db.to_dict and creating a new model with the same key?  That seems to me
> like a relatively clean & safe way to do it.  The desire to be able to do
> this for my case, is to be able to move records from Person to User, then
> User to SuperUser, gaining extra fields needed as the person descends the
> hierarchy.  I suspect that's a fairly common scenario, and seems almost
> exactly the type of thing that PolyModel was designed for.


In that case you're not changing the class of an object, just creating a new
object with existing data, which is fine. It's still a very strange thing to
be doing, though, and you should just have the full set of fields on the
basic 'User' record, not using them where they're superfluous.

PolyModel is designed for the same sort of modelling situations that regular
OO is designed for. All Cars have LicenseNumbers, but different types of car
may have different properties - and a Porshe will never turn into an Audi.

-Nick Johnson


>
>  --
> 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/-/O3DQBp7xtBAJ.
>
> To post to this group, send email to google-appengine@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>



-- 
Nick Johnson, Developer Programs Engineer, App Engine

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

Reply via email to