Warnings sur les relations des membres #104

Open
opened 2 months ago by Darks · 0 comments
Darks commented 2 months ago
Owner

Initialiser les membres via le master script depuis une fresh install déclenche quelques warnings :

/home/lgatin/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:550: SAWarning: relationship 'Member.topics' will copy column user.id to column post.author_id, which conflicts with relationship(s): 'Post.author' (copies user.id to post.author_id), 'User.posts' (copies user.id to post.author_id). 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="author,posts"' to the 'Member.topics' relationship.

mapper = orm.class_mapper(type)

/home/lgatin/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:550: SAWarning: relationship 'Member.programs' will copy column user.id to column post.author_id, which conflicts with relationship(s): 'Post.author' (copies user.id to post.author_id), 'User.posts' (copies user.id to post.author_id). 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="author,posts"' to the 'Member.programs' relationship.

mapper = orm.class_mapper(type)

/home/lgatin/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:550: SAWarning: relationship 'Member.comments' will copy column user.id to column post.author_id, which conflicts with relationship(s): 'Post.author' (copies user.id to post.author_id), 'User.posts' (copies user.id to post.author_id). 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="author,posts"' to the 'Member.comments' relationship.

mapper = orm.class_mapper(type)

Les explications sont assez claires, c'est un problème de duplication de clé distante entre la classe Member, la classe User et les classes sus-citées.

Initialiser les membres via le master script depuis une fresh install déclenche quelques warnings : ``` /home/lgatin/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:550: SAWarning: relationship 'Member.topics' will copy column user.id to column post.author_id, which conflicts with relationship(s): 'Post.author' (copies user.id to post.author_id), 'User.posts' (copies user.id to post.author_id). 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="author,posts"' to the 'Member.topics' relationship. mapper = orm.class_mapper(type) /home/lgatin/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:550: SAWarning: relationship 'Member.programs' will copy column user.id to column post.author_id, which conflicts with relationship(s): 'Post.author' (copies user.id to post.author_id), 'User.posts' (copies user.id to post.author_id). 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="author,posts"' to the 'Member.programs' relationship. mapper = orm.class_mapper(type) /home/lgatin/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:550: SAWarning: relationship 'Member.comments' will copy column user.id to column post.author_id, which conflicts with relationship(s): 'Post.author' (copies user.id to post.author_id), 'User.posts' (copies user.id to post.author_id). 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="author,posts"' to the 'Member.comments' relationship. mapper = orm.class_mapper(type) ``` Les explications sont assez claires, c'est un problème de duplication de clé distante entre la classe `Member`, la classe `User` et les classes sus-citées.
Darks added the
bug
label 2 months ago
Lephenixnoir self-assigned this 2 months ago
Darks added
warning
and removed
bug
labels 2 months ago
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.