mirror of https://gitlab.crans.org/bde/nk20
Translate some docs
This commit is contained in:
parent
d8a785d309
commit
0c00a934bd
|
@ -35,7 +35,7 @@ def get_current_authenticated_user():
|
||||||
|
|
||||||
class LogsMiddleware(object):
|
class LogsMiddleware(object):
|
||||||
"""
|
"""
|
||||||
Ce middleware permet de récupérer l'utilisateur actif ainsi que son adresse IP à chaque connexion.
|
This middleware get the current user with his or her IP address on each request.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, get_response):
|
def __init__(self, get_response):
|
||||||
|
|
|
@ -33,8 +33,7 @@ EXCLUDED = [
|
||||||
|
|
||||||
def pre_save_object(sender, instance, **kwargs):
|
def pre_save_object(sender, instance, **kwargs):
|
||||||
"""
|
"""
|
||||||
Avant la sauvegarde d'un modèle, on récupère l'ancienne instance actuellement en base de données
|
Before a model get saved, we get the previous instance that is currently in the database
|
||||||
que l'on garde en mémoire
|
|
||||||
"""
|
"""
|
||||||
qs = sender.objects.filter(pk=instance.pk).all()
|
qs = sender.objects.filter(pk=instance.pk).all()
|
||||||
if qs.exists():
|
if qs.exists():
|
||||||
|
@ -45,8 +44,8 @@ def pre_save_object(sender, instance, **kwargs):
|
||||||
|
|
||||||
def save_object(sender, instance, **kwargs):
|
def save_object(sender, instance, **kwargs):
|
||||||
"""
|
"""
|
||||||
Dès qu'un modèle est sauvegardé, une entrée dans la table `Changelog` est ajouté dans la base de données
|
Each time a model is saved, an entry in the table `Changelog` is added in the database
|
||||||
afin de répertorier chaque modification effectuée
|
in order to store each modification made
|
||||||
"""
|
"""
|
||||||
# noinspection PyProtectedMember
|
# noinspection PyProtectedMember
|
||||||
if instance._meta.label_lower in EXCLUDED:
|
if instance._meta.label_lower in EXCLUDED:
|
||||||
|
@ -102,7 +101,7 @@ def save_object(sender, instance, **kwargs):
|
||||||
|
|
||||||
def delete_object(sender, instance, **kwargs):
|
def delete_object(sender, instance, **kwargs):
|
||||||
"""
|
"""
|
||||||
Dès qu'un modèle est supprimé, une entrée dans la table `Changelog` est ajouté dans la base de données
|
Each time a model is deleted, an entry in the table `Changelog` is added in the database
|
||||||
"""
|
"""
|
||||||
# noinspection PyProtectedMember
|
# noinspection PyProtectedMember
|
||||||
if instance._meta.label_lower in EXCLUDED:
|
if instance._meta.label_lower in EXCLUDED:
|
||||||
|
|
Loading…
Reference in New Issue