The Place/Restaurant sample is from the model doc under
multi table inheritance:

http://docs.djangoproject.com/en/dev/topics/db/models

It is a simple inherited model relationship:

class Place(models.Model):
    name = models.CharField(max_length=50)
    address = models.CharField(max_length=80)

class Restaurant(Place):
    serves_hot_dogs = models.BooleanField()
    serves_pizza = models.BooleanField()



On Dec 30 2008, 5:09 am, Briel <[email protected]> wrote:
> The first query looks at the restaurant attribute in the place model,
> and gets all that have a NULL value in that field. Now  I don't know
> the restaurant/place setup, the docs I read uses book/auther examples.
> It looks like that the restaurant field is ForeignKey, and should be
> able to work the way intended. It would do a lookup for all places
> that doen't have a restaurant object associate with it. But, if the
> restaurant field is a BoolianField instead, then you can't use
> is_null, as both True and False isn't Null.
>
> Hope this helps, else be a little more explicit about the
> relationships.
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to