Wednesday, October 27, 2010

Model Inheritance.

I'm working with model inheritance, and I need to convert my objects
into instances of its subclass. Is there an easy way to do this?


Looking at the example in:

> http://docs.djangoproject.com/en/1.2/topics/db/models/#multi-table-inheritance

I have a whole bunch of 'Place' objects that are in my database, and I
want to turn them into 'Restaurant' objects. How can I achieve this?

(I want to end up with the implicit one-to-one relation in 'Restaurant'
to be pointing to the already existing object in 'Place')

Cheers!

Tom

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

No comments:

Post a Comment