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.
J'ai un peu triché sur la façon de collecter les topics/programmes/commentaires des membres via les posts. Je m'en occupe à la prochaine séance, ça devrait pas être trop dur.
Conclusion : l'ORM c'est quand même pas pratique.
Edit : Et Gitea arrête pas de refuser mes commentaires parce que le CSRF est vieux de plus de 5 minutes. Chiiill.
J'ai un peu triché sur la façon de collecter les topics/programmes/commentaires des membres via les posts. Je m'en occupe à la prochaine séance, ça devrait pas être trop dur.
Conclusion : l'ORM c'est quand même pas pratique.
Edit : Et Gitea arrête pas de refuser mes commentaires parce que le CSRF est vieux de plus de 5 minutes. Chiiill.
Done. Rien n'a changé, il faut juste écrire user.comments(), user.topics(), user.programs() avec des parenthèses maintenant puisque c'est des méthodes.
Done. Rien n'a changé, il faut juste écrire `user.comments()`, `user.topics()`, `user.programs()` avec des parenthèses maintenant puisque c'est des méthodes.
Initialiser les membres via le master script depuis une fresh install déclenche quelques warnings :
Les explications sont assez claires, c'est un problème de duplication de clé distante entre la classe
Member
, la classeUser
et les classes sus-citées.J'ai un peu triché sur la façon de collecter les topics/programmes/commentaires des membres via les posts. Je m'en occupe à la prochaine séance, ça devrait pas être trop dur.
Conclusion : l'ORM c'est quand même pas pratique.
Edit : Et Gitea arrête pas de refuser mes commentaires parce que le CSRF est vieux de plus de 5 minutes. Chiiill.
Done. Rien n'a changé, il faut juste écrire
user.comments()
,user.topics()
,user.programs()
avec des parenthèses maintenant puisque c'est des méthodes.