Conditions in views

Hello, I am creating a website with Python/Django2.0.
I registered already in my database some restaurants names ( as restaurant_name) and the criteria if they offer vegan menu’s or not (as vegan_option=‘yes’ or vegan_options=‘no’)
When vegan people navigate through my website, I want to create for them a search bar (<input text…) where they enter the name of the restaurant they want to check if it has vegan options or not.

I succeeded representing it thanks to html, but I don’t know how to combine the conditions in my fonction in views.
Can you guys help me out please!

Here’s how I want it to look like on my website:

Do you want vegan option?
o yes ---- o no

l name of the restaurant l

l Search l

If the restaurant has the criteria you want, it will appear down below:
o
o
o

Click on it to make a reservation.

Create a form allowing the user to make their inputs, then when the form is submitted, build a query from the data entered into the form.

See Working with forms and Retrieving specific objects with filters.