-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor zds/tutorialv2/models/__init__.py #4762
Refactor zds/tutorialv2/models/__init__.py #4762
Conversation
9078922
to
07d7a89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merci pour ce refactoring, les noms des variables sont en effet bien plus cohérents !
('FORUM', _('Forum')), | ||
('CONTENT', _('Contenu')), | ||
) + TYPE_CHOICES | ||
] + TYPE_CHOICES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi utiliser une liste plutôt qu'un tuple ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parce qu’avant c’était un tuple litéral dans les réglages et que j’ai changé ça en liste et qu’on ne peut pas concaténer facilement un tuple avec une liste avec l’opérateur +
.
Puis j’imagine qu’en termes de performances, la différence entre un tuple et une liste est négligeable dans ce cas.
zds/tutorialv2/models/__init__.py
Outdated
content['name'] | ||
for content in CONTENT_TYPES | ||
if content['beta'] | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'avoue que je suis moyennement convaincu par le passage des compréhensions de liste sur plusieurs lignes. Je trouve que c'est largement lisible sur une ligne avec la limite des 120 caractères.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh pas de souci, je remet comme c’était avant 🙃
(J’ai passé de longues années bloqué à la colonne 79 et j’ai un peu du mal à m’y défaire)
e417996
to
7a84d98
Compare
7a84d98
to
7f51f51
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
N'oublie pas de générer les migrations avec python manage.py makemigrations
, elles sont manquantes. ;)
@artragis : tu as mis un 👎 plus haut, pourquoi ?
7f51f51
to
bbe38d0
Compare
@gcodeur C’est fait, mais là je ne comprends pas du tout pourquoi il y aurait besoin de migrations. Je n’ai pas touché au modèle, non ? |
Ah, je viens de comprendre. C’est une histoire de majuscules. |
bbe38d0
to
70c0ae6
Compare
70c0ae6
to
323e658
Compare
Renomme certaines variable que je trouvais bizarrement nommées.
323e658
to
099c5d9
Compare
Renomme certaines variable que je trouvais bizarrement nommées.