Reverse relation doesn’t seem to work - I must be missing something very basic #552
Unanswered
nicholasbutlin
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Hi, Hard to tell without a minimal reproducible example. Did you check if data is properly created in the database? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I have been using Ormar and love it. I realise that this is a very, very basic question, but for some reason I cannot get the result I expect.
Below is an example I made with the same setup as I have in my code and using the example from the tutorials:
This works fine, and when I look at depot, get the ‘weaker’ and the data populated, dep looks like this:
And when I check the related names, I get what I would expect - a relation each way
When I do the same in my actual code, where there are about 20 interrelated models, I don’t get weak refs, and no data - just the virtual field.
In a couple of case, the virtual side appears not to have been registered at all and there is no reverse relation, just an empty set e.g.:
I have the equivalent of models Department and Course, but now when I run a similar process to the above I get:
Department:
I have tried:
nothing I can do seems to work and I am truly, utterly confused.
I am using MariaDB 10, python 3.8, 0rmar 0.10.24
Any ideas as to why it just doesn’t work at all would be gratefully received.
Beta Was this translation helpful? Give feedback.
All reactions