You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Hi! I am trying to get some ormar model tests up and running and to test the foreign key relation and reverse-relation functionality. Currently I have a very simple test file copied mainly from the ormar tests themselves. It looks something like this:
My test simply asserts that both sides of the relation exist. That is that a pet has an owner and that a person can have some pets. Unfortunately, this test fails on the second assertion, there is no 'pets' pydantic field when calling get_pydantic() for Person. Maybe this is expected behaviour but some clarification on how it works would be nice (because I could have sworn that sometimes the 'pets' field appears when using get_pydantic).
To Reproduce
Steps to reproduce the behavior:
Copy above code, or look at test suite of ormar
run the test_fields_exist test
(Note: this should be a complete and concise piece of code that allows reproduction of an issue)
Expected behavior
Person get_pydantic() model should have a field 'pets' for the reverse-relation of the Pet foreign key.
Versions (please complete the following information):
Database backend used (mysql/sqlite/postgress): aiosqlite v0.19.0
Python version: 3.10.5
ormar version: 0.12.2
pydantic version: 1.10.8
The text was updated successfully, but these errors were encountered:
Describe the bug
Hi! I am trying to get some ormar model tests up and running and to test the foreign key relation and reverse-relation functionality. Currently I have a very simple test file copied mainly from the ormar tests themselves. It looks something like this:
My test simply asserts that both sides of the relation exist. That is that a pet has an owner and that a person can have some pets. Unfortunately, this test fails on the second assertion, there is no 'pets' pydantic field when calling get_pydantic() for Person. Maybe this is expected behaviour but some clarification on how it works would be nice (because I could have sworn that sometimes the 'pets' field appears when using get_pydantic).
To Reproduce
Steps to reproduce the behavior:
(Note: this should be a complete and concise piece of code that allows reproduction of an issue)
Expected behavior
Person get_pydantic() model should have a field 'pets' for the reverse-relation of the Pet foreign key.
Versions (please complete the following information):
ormar
version: 0.12.2pydantic
version: 1.10.8The text was updated successfully, but these errors were encountered: