Hi all,

suppose I have the following model structure

    from django.db import models
    
    class Place(models.Model):
        name = models.CharField(max_length=50)
    
    class Restaurant(Place):
        ...
    
    class Hotel(Place):
        ...

I already have a Restaurant in my database. This Restaurant is now also 
becoming a Hotel. I would like to declare this in the database as follows:

    restaurant = Restaurant.objects.get(name='Will soon be a hotel')
    Hotel.objects.create(pk=restaurant.pk)

Is this a safe thing to do?

Thanks,
Michael

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a94e6a9a-919e-49ab-ac4c-e2e187a4f816%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to