[EMAIL PROTECTED] wrote:
> I have to keep the Address on Company... as Address will be being used
> in other places as well..and is not always related to a company... I
> have a Property and User classes as well..and each of them will have an
> Address foreign key.

Well, I think we'll have to wait the answer of some experienced django
user.

> In my form I'm using the following ( I tried putting a 0 in there like your
> sample..but it gave an unindexable object error )

In that sample I moved the foreign key on the other model.

> Now in my company definition I have:
> class Company(models.Model):
>    company_id = models.AutoField(primary_key=True)
>    parent_company = models.ForeignKey("self",null=True,blank=True)
>    address =models.ForeignKey(Address,unique=True,edit_inline=models.TABULAR)

You've got a one-to-one relation (unique=True).
I suppose that using the Address ChangeManipulator could do the trick.

> I can't use the address...because an address will be on a company object..
> as well as some others I have..not just only on a Company object.

You can use Address ChangeManipulator and hide fields from other models
with the follow argument.

> but maybe I just can't do this the way I'm wanting...

There's always a way !
Remember you can always code all by hand (like a lot of web-developer
usually do).
At the very beginning I was writing a lot of code to make the things
exactly like I wanted, but as time passed, I discovered that django
could do the same thing with less effort (and code).
And then... zac... dozens of lines of my code gone !  It's a great
pleasure. :-)

Massimiliano


--~--~---------~--~----~------------~-------~--~----~
 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to