Modèle Evenement¶
Module contenant le modèle Evenement pour la gestion des événements sportifs.
Ce module définit la structure de données pour les événements qui se déroulent lors des Jeux Olympiques, incluant la gestion automatique des places restantes.
- class api.models.evenement.Evenement(*args, **kwargs)¶
Bases :
ModelModèle représentant un événement sportif.
Un événement est une session sportive qui se déroule à un lieu et à une heure précise, avec un nombre de places limité pour les spectateurs.
- Variables:
description – Description de l’événement
lieu – Lieu où se déroule l’événement
date – Date de l’événement
horraire – Heure de début de l’événement
nb_place_total – Nombre total de places disponibles
nb_place_restante – Nombre de places encore disponibles
- description¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- lieu¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parentis aForwardManyToOneDescriptorinstance.
- date¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- horraire¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- nb_place_total¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- nb_place_restante¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- save(*args, **kwargs)¶
Sauvegarde l’événement avec initialisation automatique des places restantes.
Lors de la création d’un nouvel événement, si le nombre de places restantes n’est pas spécifié, il est automatiquement initialisé avec le nombre total de places.
- Paramètres:
args (tuple) – Arguments positionnels pour la méthode save
kwargs (dict) – Arguments nommés pour la méthode save
- exception DoesNotExist¶
Bases :
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases :
MultipleObjectsReturned
- epreuves¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
- get_next_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=True, **kwargs)¶
- get_previous_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=False, **kwargs)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- lieu_id¶
- objects = <django.db.models.manager.Manager object>¶
- ticket_set¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
Fonctionnalités spéciales:
La méthode save() initialise automatiquement le nombre de places restantes avec le nombre total de places lors de la création.