Ejemplo n.º 1
0
 def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json):
     self.__recipe_id = parse_int(parsed_json.get('recipe_id'))
     self.__product_id = parse_int(parsed_json.get('product_id'))
     self.__amount = parse_float(parsed_json.get('amount'))
     self.__note = parsed_json.get('note', None)
     self.__qu_id = parse_int(parsed_json.get('qu_id'))
     self.__only_check_single_unit_in_stock = parse_bool(
         parsed_json.get('only_check_single_unit_in_stock'), False)
     self.__ingredient_group = parsed_json.get('ingredient_group', None)
     self.__not_check_stock_fulfillment = parse_bool(
         parsed_json.get('not_check_stock_fulfillment'), False)
     self.__variable_amount = parsed_json.get('variable_amount', None)
     self.__price_factor = parse_float(parsed_json.get('price_factor'))
     super().__init__(api, endpoint, parsed_json)
Ejemplo n.º 2
0
 def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json):
     self.__name = parsed_json.get('name')
     self.__description = parsed_json.get('description', None)
     self.__period_type = parsed_json.get('period_type')
     self.__period_config = parsed_json.get('period_config', None)
     self.__period_days = parse_int(parsed_json.get('period_days'), None)
     self.__track_date_only = parse_bool(parsed_json.get('track_date_only'),
                                         False)
     self.__rollover = parse_bool(parsed_json.get('rollover'), False)
     self.__assignment_type = parsed_json.get('assignment_type', None)
     self.__assignment_config = parsed_json.get('assignment_config', None)
     self.__next_execution_assigned_to_user_id = parse_int(
         parsed_json.get('next_execution_assigned_to_user_id'), None)
     super().__init__(api, endpoint, parsed_json)
Ejemplo n.º 3
0
 def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json):
     self.__name = parsed_json.get('name')
     self.__description = parsed_json.get('description', None)
     self.__location_id = parse_int(parsed_json.get('location_id'))
     self.__qu_id_purchase = parse_int(parsed_json.get('qu_id_purchase'))
     self.__qu_id_stock = parse_int(parsed_json.get('qu_id_stock'))
     self.__enable_tare_weight_handling = parse_int(
         parsed_json.get('enable_tare_weight_handling', None))
     self.__not_check_stock_fulfillment_for_recipes = parse_int(
         parsed_json.get('not_check_stock_fulfillment_for_recipes'), None)
     self.__product_group_id = parse_int(
         parsed_json.get('product_group_id'), None)
     self.__qu_factor_purchase_to_stock = parse_float(
         parsed_json.get('qu_factor_purchase_to_stock'))
     self.__tare_weight = parse_float(parsed_json.get('tare_weight', None))
     barcodes_raw = parsed_json.get('barcode', "")
     if barcodes_raw:
         self.__barcodes = barcodes_raw.split(",")
     else:
         self.__barcodes = None
     self.__min_stock_amount = parse_int(
         parsed_json.get('min_stock_amount', None), 0)
     self.__default_best_before_days = parse_int(
         parsed_json.get('default_best_before_days', None))
     self.__default_best_before_days_after_open = parse_int(
         parsed_json.get('default_best_before_days_after_open', None))
     self.__picture_file_name = parsed_json.get('picture_file_name', None)
     self.__allow_partial_units_in_stock = parse_bool(
         parsed_json.get('allow_partial_units_in_stock', False), False)
     super().__init__(api, endpoint, parsed_json)
Ejemplo n.º 4
0
 def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json):
     self.__name = parsed_json.get('name')
     self.__caption = parsed_json.get('caption')
     self.__description = parsed_json.get('description', None)
     self.__show_in_sidebar_menu = parse_bool(
         parsed_json.get('show_in_sidebar_menu'), False)
     self.__icon_css_class = parsed_json.get('icon_css_class', None)
     super().__init__(api, endpoint, parsed_json)
Ejemplo n.º 5
0
 def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json):
     self.__product_id = parse_int(parsed_json.get('product_id'), None)
     self.__note = parsed_json.get('note', None)
     self.__amount = parse_float(parsed_json.get('amount'), 0)
     self.__shopping_list_id = parse_int(
         parsed_json.get('shopping_list_id'))
     self.__done = parse_bool(parsed_json.get('done'), False)
     super().__init__(api, endpoint, parsed_json)
Ejemplo n.º 6
0
 def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json):
     self.__entity = parsed_json.get('entity')
     self.__name = parsed_json.get('name')
     self.__caption = parsed_json.get('caption')
     self.__type = parsed_json.get('type')
     self.__show_as_column_in_tables = parse_bool(
         parsed_json.get('show_as_column_in_tables'), False)
     self.__config = parsed_json.get('config', None)
     super().__init__(api, endpoint, parsed_json)
Ejemplo n.º 7
0
 def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json):
     self.__name = parsed_json.get('name')
     self.__description = parsed_json.get('description', None)
     self.__due_date = parse_date(parsed_json.get('due_date', None))
     self.__done = parse_bool(parsed_json.get('done'), False)
     self.__done_timestamp = parse_date(
         parsed_json.get('done_timestamp', None))
     self.__category_id = parse_int(parsed_json.get('category_id'), None)
     self.__assigned_to_user_id = parse_int(
         parsed_json.get('assigned_to_user_id'))
     super().__init__(api, endpoint, parsed_json)
Ejemplo n.º 8
0
 def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json):
     self.__name = parsed_json.get('name')
     self.__description = parsed_json.get('description', None)
     self.__picture_file_name = parsed_json.get('picture_file_name', None)
     self.__base_servings = parse_int(parsed_json.get('base_servings'))
     self.__desired_servings = parse_int(
         parsed_json.get('desired_servings'))
     self.__not_check_shoppinglist = parse_bool(
         parsed_json.get('not_check_shoppinglist'), False)
     self.__type = parsed_json.get('type')
     self.__product_id = parse_int(parsed_json.get('product_id'), None)
     super().__init__(api, endpoint, parsed_json)
Ejemplo n.º 9
0
 def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json):
     self.__name = parsed_json.get('name')
     self.__description = parsed_json.get('description', None)
     self.__is_freezer = parse_bool(parsed_json.get('is_freezer'), False)
     super().__init__(api, endpoint, parsed_json)