I have a Django project that has an Address model. This is used in several places - according to the User Profile model, according to the Hospital model, according to the Fastening model, etc.
I use Django's general relationship so that each of these objects can create a foreign key for the address.
However, this seems to cause some oddities in Django Admin (or maybe I don't understand how this should be used). In Django Admin, if I try to create an address, I see the fields for "Content Type" and "Object ID". The model will not check / save if they are not filled. Not sure what to add to them.
The thing is, I wanted to be able to create standalone Address objects. Then, when I create a user profile or a hospital, I could associate them with Address objects, including the possibility of multiple connections to the same Address object.
How do I use a Django admin with general relationships?
In addition, I also intend to use django-reversion to control model versions, not sure if this will cause any problems with the generic relationship and the administrator?
Cheers, Victor
Edit: I should just add, here is an earlier question that I posted Addresses and lines:
Django - Designing Model Relationships - Admin and Inline Interface
, , Address . FK , .
// .. ( ) .
, , , , ?
, -- // .
, . , , GenericRelations , .