I mean "multiple types of objects." Basically, in the db, it looks a bit
like this:

create table address(id int primary key auto increment, name text, address
text);
create table person(id int primary key auto increment, first_name
varchar(30),
        last_name varchar(30), address_id int foreign key references
"address"("id"));
create table sighting(id int primary key auto increment, name varchar(30),
        address_id int foreign key references "address"("id"));


What I mean to say is that "Address" doesn't need to know in the database
that its owned by something else, that notion of ownership is indicated
elsewhere. Sure, in Django, you could climb "Address.person" to get to the
owning person. In any case, that's somewhat beyond the point.

The real point is that I shouldn't be getting errors if I want to have a
OneToOneField inline of an Address on a Person. No matter what side the
relation is declared on, inlines should just work™. Maybe it's not the best
idea for a data model, but if a user has this requirement, Django should be
flexible enough to meet it, and I do think it's a good idea.

Thanks,
 - TK



On Fri, Mar 30, 2012 at 1:49 PM, ptone <pres...@ptone.com> wrote:

>
>
> On Friday, March 30, 2012 11:44:29 AM UTC-7, Tyler Kocheran wrote:
>
>  There's really no reason for an `Address` to know of itself what it is
>> owned by, it could be owned by multiple different objects.
>>
>
> Not if you are using a OneToOneField...
>
> I think you are just looking for a FK to an address model on each of your
> other models.
>
> -Preston
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-developers/-/1qyvaXw39QsJ.
> To post to this group, send email to django-developers@googlegroups.com.
> To unsubscribe from this group, send email to
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=en.
>

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

Reply via email to