Schemes

This are classes to use for the communication between all functions

Allergie

Hint

This is an Enum

class schemes.Allergies(value)[source]

Filter for Allergies

LACTOSE

Defaults to Laktoseintoleranz

Type

str

WHEAT

Defaults to Glutenunvertraeglichkeit

Type

str

Pydantic Class

Warning

Pydantic class for ORM convertion

Class for the Allergies

Classes:

PydanticAllergies(*, name)

Needed class for revonvert orm models

class schemes.scheme_allergie.PydanticAllergies(*, name: str)[source]

Needed class for revonvert orm models

name

Only Schemes in the schemes.Allergies Enum are valid

Type

str

Methods:

allergie_values(value)

Check if the Allergie is in schemes.Allergies Enum

classmethod allergie_values(value: str)[source]

Check if the Allergie is in schemes.Allergies Enum

Parameters

value (str) – the name that got passed

Cuisine

class schemes.Cuisine(value)[source]

Only this Cuisine can be searched

ITALIAN
GERMAN
ASIAN
DOENER
TURKEY
GREEK
KOREAN
THAILAND
INDIAN
COFFE
BAKERY
BUTCHER
VEGAN
VEGETARIAN
FASTFOOD
AMERICAN
RESTAURANT

Pydantic Class

Warning

Pydantic class for ORM convertion

Class for the Cuisine

Classes:

PydanticCuisine(*, name)

Needed class for revonvert orm models

class schemes.scheme_cuisine.PydanticCuisine(*, name: str)[source]

Needed class for revonvert orm models

name

Only schemes.Cuisine Enum valid

Type

str

Methods:

cuisine_values(value)

Check if the cuisine is in schemes.cuisines Enum

classmethod cuisine_values(value: str)[source]

Check if the cuisine is in schemes.cuisines Enum

Parameters
  • cls (any) – Class of the method

  • value (str) – the name that got passed

Filter

Contains all Filter for the searches

Classes:

FilterBase(*, cuisines, rating[, allergies])

Base Filter for recepes and restaurant

FilterRecipe(*, keyword, total_time)

Extended Model for Recipe-Filter

FilterRest(*, cuisines, rating[, allergies])

Use this scheme to Search for a Restaurant in the Backend

FilterRestDatabase(*, cuisines, rating[, ...])

Use this scheme if you internact with the Filter that are saved in the DB

class schemes.scheme_filter.FilterBase(*, cuisines: List[schemes.scheme_cuisine.PydanticCuisine], rating: int, allergies: List[schemes.scheme_allergie.PydanticAllergies] = None)[source]

Base Filter for recepes and restaurant

cuisines

All cuisines to search

Type

List[scheme_cuisine.PydanticCuisine]

rating

Minimum rating

Type

int

allergies

All allergies to take care of

Type

Optional[List[scheme_allergie.PydanticAllergies]]

Methods:

rating_range(value)

Check if rating >= 1 and <= 5

classmethod rating_range(value: int) int[source]

Check if rating >= 1 and <= 5

Parameters

value (int) – Value of rating

Raises

ValueError – If wrong values

class schemes.scheme_filter.FilterRecipe(*, keyword: str, total_time: datetime.timedelta)[source]

Extended Model for Recipe-Filter

keyword

Keyword to search

Type

str

total_time

Max cook time

Type

datetime.timedelta

class schemes.scheme_filter.FilterRest(*, cuisines: List[schemes.scheme_cuisine.PydanticCuisine], rating: int, allergies: List[schemes.scheme_allergie.PydanticAllergies] = None, costs: int, radius: int, location: schemes.scheme_rest.LocationBase)[source]

Use this scheme to Search for a Restaurant in the Backend

costs

Maximum pricing

Type

int

radius

Radius of the search

Type

int

location

Position for the search

Type

schemes.scheme_rest.LocationBase

Methods:

costs_range(value)

Check if costs >= 0 and <= 4

classmethod costs_range(value: int)[source]

Check if costs >= 0 and <= 4

Parameters

value (int) – Value of costs

Raises

ValueError – If wrong values

class schemes.scheme_filter.FilterRestDatabase(*, cuisines: List[schemes.scheme_cuisine.PydanticCuisine], rating: int, allergies: List[schemes.scheme_allergie.PydanticAllergies] = None, costs: int, radius: int, manuell_location: str)[source]

Use this scheme if you internact with the Filter that are saved in the DB

costs

Maximum pricing

Type

int

radius

Radius of the search

Type

int

manuell_location

To save the location

Type

str

Methods:

costs_range(value)

Check if costs >= 0 and <= 4

classmethod costs_range(value: int)[source]

Check if costs >= 0 and <= 4

Parameters

value (int) – Value of costs

Raises

ValueError – If wrong values

Recipe

Contains the Class for Recipe

Classes:

Recipe(*, id, name, ingredients, url[, ...])

Class that you get from the backend to handle the recipe

RecipeBase(*, id)

Base class for the Recipes

RecipeBewertungBase(*, name[, comment, rating])

BaseClass for the Bewertung

RecipeBewertungCreate(*, name[, comment, rating])

Class to create a new Bewertung in the DB

RecipeBewertungReturn(*, name[, comment, rating])

Class to return to the frontend

class schemes.scheme_recipe.Recipe(*, id: str, name: str, ingredients: str, url: str, image: str = None, cookTime: datetime.timedelta = None, prepTime: datetime.timedelta = None)[source]

Class that you get from the backend to handle the recipe

id

id of the recipe

Type

str

name

name of the recipe

Type

str

ingredients

ingredients of the recipe

Type

str

url

url to the original page of the recipe

Type

str

image

url to an image if db contain one

Type

Optional[str]

cookTime

cooktime of the recipe if specified

Type

Optional[timedelta]

prepTime

preperation time of the recipe if specified

Type

Optional[timedelta]

class schemes.scheme_recipe.RecipeBase(*, id: str)[source]

Base class for the Recipes

id

id of the recipe

Type

str

class schemes.scheme_recipe.RecipeBewertungBase(*, name: str, comment: str = '', rating: float = 0)[source]

BaseClass for the Bewertung

name

Name of the restaurant

Type

str

comment

comment from the user. Defaults to “”.

Type

Optional[str]

rating

Rating of the user. Defaults to 0.

Type

Optional[float]

class schemes.scheme_recipe.RecipeBewertungCreate(*, name: str, comment: str = '', rating: float = 0, person: schemes.scheme_user.UserBase, recipe: schemes.scheme_recipe.RecipeBase)[source]

Class to create a new Bewertung in the DB

person

Owner of the assessment.

Type

scheme_user.UserBase

recipe

The recipe.

Type

scheme_recipe.RecipeBase

class schemes.scheme_recipe.RecipeBewertungReturn(*, name: str, comment: str = '', rating: float = 0, email: str, id: str, timestamp: datetime.datetime)[source]

Class to return to the frontend

email

Email of the User

Type

str

id

PlaceID of the recipe

Type

str

timestamp

Last Update of the assessment

Type

datetime.datetime

Restaurant

Contains all classes for the restaurant search

Classes:

Geometry(*, location)

Needed for better automation converting from the google api

LocationBase(*, lat, lng)

contain only coordinates

LocationRest(*, lat, lng[, adr])

Store further information about the location of the restaurant

RestBewertungBase(*, name[, comment, rating])

BaseClass for the Bewertung

RestBewertungCreate(*, name[, comment, rating])

Class to create a new Bewertung in the DB

RestBewertungReturn(*, name[, comment, rating])

Class to return to the frontend

Restaurant(*, place_id, name, geometry[, ...])

Class that got return to the website

RestaurantBase(*, place_id, name)

Scheme that is only needed for the DB

RestaurantCreate(*, place_id, name)

Scheme that is only needed for the DB

class schemes.scheme_rest.Geometry(*, location: schemes.scheme_rest.LocationRest)[source]

Needed for better automation converting from the google api

location
Type

schemes.scheme_rest.LocationRest

class schemes.scheme_rest.LocationBase(*, lat: str, lng: str)[source]

contain only coordinates

lat

Latitude

Type

str

lng

Longitude

Type

str

class schemes.scheme_rest.LocationRest(*, lat: str, lng: str, adr: str = None)[source]

Store further information about the location of the restaurant

adr

Address of the Restaurant. Defaults to None

Type

str

class schemes.scheme_rest.RestBewertungBase(*, name: str, comment: str = '', rating: float = 0)[source]

BaseClass for the Bewertung

name

Name of the restaurant

Type

str

comment

comment from the user. Defaults to “”.

Type

Optional[str]

rating

Rating of the user. Defaults to 0.

Type

Optional[float]

class schemes.scheme_rest.RestBewertungCreate(*, name: str, comment: str = '', rating: float = 0, person: schemes.scheme_user.UserBase, restaurant: schemes.scheme_rest.RestaurantBase)[source]

Class to create a new Bewertung in the DB

person

Owner of the assessment.

Type

scheme_user.UserBase

restaurant

The restaurant.

Type

RestaurantBase

class schemes.scheme_rest.RestBewertungReturn(*, name: str, comment: str = '', rating: float = 0, email: str, place_id: str, timestamp: datetime.datetime)[source]

Class to return to the frontend

email

Email of the User

Type

str

place_id

PlaceID of the Restaurant

Type

str

timestamp

Last Update of the assessment

Type

datetime.datetime

class schemes.scheme_rest.Restaurant(*, place_id: str, name: str, geometry: schemes.scheme_rest.Geometry, maps_url: str = None, rating: float = None, own_rating: float = None, phone_number: str = None, homepage: str = None)[source]

Class that got return to the website

name

Name of the Restaurant

Type

str

geometry

Postion of the Restaurant

Type

Geometry

maps_url

google maps url of the restaurant. Defaults to None.

Type

str

rating

google rating. Defaults. to None

Type

float

own_rating

User rating. Defgaults to None.

Type

float

phone_number

Phonenumber of the restaurant. Defgaults to None.

Type

str

homepage

Url of the homepage. Defgaults to None.

Type

str

class schemes.scheme_rest.RestaurantBase(*, place_id: str, name: str)[source]

Scheme that is only needed for the DB

place_id

ID from Google

Type

str

name

Name of the Restaurant

Type

str

class schemes.scheme_rest.RestaurantCreate(*, place_id: str, name: str)[source]

Scheme that is only needed for the DB

name

Name of the Restaurant

Type

str

User

Contains all classes for the user

Classes:

User(*, email, last_login)

User with mail an last_login

UserBase(*, email)

Base Class for all User

UserCreate(*, email, password)

Class to create an User.

UserLogin(*, email, hashed_password[, ...])

User if he try to login

class schemes.scheme_user.User(*, email: str, last_login: datetime.datetime)[source]

User with mail an last_login

last_login

Timestamp of last login

Type

datetime.datetime

class schemes.scheme_user.UserBase(*, email: str)[source]

Base Class for all User

email

Email of the User

Type

str

class schemes.scheme_user.UserCreate(*, email: str, password: str)[source]

Class to create an User.

password

Plaintext password

Type

str

class schemes.scheme_user.UserLogin(*, email: str, hashed_password: str, last_login: datetime.datetime = None)[source]

User if he try to login

hashed_password

Hashed user password

Type

str

last_login

Defaults to None

Type

Optional[datetime.datetime]