Skip to content

Conversation

@omega
Copy link
Contributor

@omega omega commented Oct 17, 2024

Some hacks on cgi and crypt, which have been removed in core.

Some checks performed, but needs more testing. Some things can be serialized wrongly. Before serializing an entity would end up as the ID, now it will end up in an error, but most of those places can be changed to .id to get it similar to earlier.

@omega omega requested a review from trygvis October 17, 2024 20:10
@omega omega marked this pull request as draft October 17, 2024 20:10
omega and others added 3 commits October 22, 2025 22:07
Some hacks on cgi and crypt, which have been removed in core.

Some checks performed, but needs more testing. Some things can be
serialized wrongly. Before serializing an entity would end up as the ID,
now it will end up in an error, but most of those places can be changed
to `.id` to get it similar to earlier.
Fixing this warning (and real problem) by updating a couple of types to
use the current pattern for declaring relationships.

> web/src/p2k16/core/models.py:642: SAWarning: relationship
'CompanyEmployee.company' will copy column company.id to column
company_employee.company, which conflicts with relationship(s):
'Company.employees' (copies company.id to company_employee.company).
If this is not the intention, consider if these relationships should be
linked with back_populates, or if viewonly=True should be applied to one
or more if they are read-only. For the less common case that foreign key
constraints are partially overlapping, the orm.foreign() annotation can
be used to isolate the columns that should be written towards.
To silence this warning, add the parameter 'overlaps="employees"' to the
'CompanyEmployee.company' relationship. (Background on this warning at:
https://sqlalche.me/e/20/qzyx)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants