Ejemplo n.º 1
0
def remove_events():
    print("Here are the list of the events that are present: ")
    for event in EventList.select():
        print(f"'{event.event_name}'")

    event_name = input("Enter event name to remove: ")
    delete_event = EventList.get(event_name=event_name)
    EventList.delete_instance(delete_event)
Ejemplo n.º 2
0
def add_participants():
    participant_name = input("Enter the participant name: \n")

    # Getting data of all the events
    for event in EventList.select():
        print(event.id, event.event_name)

    event = int(
        input("Enter the choice event name from the events list above:\n"))

    # Getting the event name and the entry fees for that particular event
    selected_event = EventList.get(id=event)
    event_name = selected_event.event_name
    amount = selected_event.fees

    ph_no = int(input("Enter participant's phone number: "))

    # Saving the participant details to the database
    participant = ParticipantList.create(name=participant_name,
                                         event_name=event_name,
                                         price=amount,
                                         ph_no=ph_no)