- Notifications
You must be signed in to change notification settings - Fork302
Related Field class for representing external keys?#999
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Has anyone had luck adapting one of the related field classes to take a single "something_id" field that is not defined as a foreign key in the database or model, and generate output that fits into the relationships object? For example, if I have a Books model that has an author_id field, in which the Author model and related table don't exist. I still want to have a relationship property added for I didn't see an option for this in the docs, as they all seem to require an actual model. If that isn't available, my next option is to see if there is way to generate a fake model in django for objects that don't actually live in the db. If those don't work, I'll see about making a new Update: Any suggestions? |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 1 comment 2 replies
-
This question seems to be related to#942 where we are discussing what is currently working and what not. |
BetaWas this translation helpful?Give feedback.
All reactions
-
This might be a bit different because this is just a TextField not a GenericForeignKey. I already know the type, but the type doesn't actually have a table or model object anywhere. |
BetaWas this translation helpful?Give feedback.
All reactions
-
OK I see your point. This is certainly not gonna be easy and most likely you will need to have a custom json renderer class overwriting |
BetaWas this translation helpful?Give feedback.