def add_apartment(self):
        print("Add Apartment")

        apartment = Apartment()
        apartment.name = get_string("Please, enter apt name: ")
        apartment.description = get_string("Please, enter apt description: ")
        apartment.price = get_price("Please, enter apt price: ")

        apartment.save()

        print("Apartment saved")
Esempio n. 2
0
    def add_guest(self):
        min_age = Guest.age.min_value
        age_retrieve_message = "Please, enter you age: {}".format(min_age)

        name = get_string("Please, enter you name: ")
        last_name = get_string("Please, enter you last name: ")
        age = get_age(age_retrieve_message, min_age=min_age)

        guest = Guest(name=name, last_name=last_name, age=age)

        guest.save()

        print(Fore.GREEN, "Guest added", Fore.RESET)
    def search_apartment(self):
        name = get_string("Please, enter apt name: ")

        apartment = Apartment.objects().filter(name__icontains=name)

        columns = ('Name', 'Description', 'Price')
        pretty_print(apartment, columns)
        return apartment
Esempio n. 4
0
    def search_guest(self):
        name = get_string("Please, enter guest name: ")

        guest = Guest.objects().filter(name__icontains=name)

        columns = ('Name', 'Age', 'Is_card')
        pretty_print(guest, columns)
        return guest
Esempio n. 5
0
    def add_guest(self):
        min_age = Guest.age.min_value

        name = get_string("Please, enter you name: ")

        age = get_age("Please, enter you age: ", min_age=min_age)

        guest = Guest(name=name, age=age)
        guest.save()

        print(Fore.GREEN, "Guest added", Fore.RESET)
        return guest