From ae9a78f2e16837491e33de26e0b05ba5f90a87dc Mon Sep 17 00:00:00 2001 From: smilerz Date: Tue, 20 Feb 2024 17:47:23 -0600 Subject: [PATCH] remove commented out methods and functions --- cookbook/forms.py | 89 ----------------------------------------------- 1 file changed, 89 deletions(-) diff --git a/cookbook/forms.py b/cookbook/forms.py index 40237cae2..8071624fb 100644 --- a/cookbook/forms.py +++ b/cookbook/forms.py @@ -160,24 +160,6 @@ class StorageForm(forms.ModelForm): help_texts = {'url': _('Leave empty for dropbox and enter only base url for nextcloud (/remote.php/webdav/ is added automatically)'), } -# TODO: Deprecate -# class RecipeBookEntryForm(forms.ModelForm): -# prefix = 'bookmark' - -# def __init__(self, *args, **kwargs): -# space = kwargs.pop('space') -# super().__init__(*args, **kwargs) -# self.fields['book'].queryset = RecipeBook.objects.filter(space=space).all() - -# class Meta: -# model = RecipeBookEntry -# fields = ('book',) - -# field_classes = { -# 'book': SafeModelChoiceField, -# } - - class SyncForm(forms.ModelForm): def __init__(self, *args, **kwargs): @@ -194,7 +176,6 @@ class SyncForm(forms.ModelForm): labels = {'storage': _('Storage'), 'path': _('Path'), 'active': _('Active')} -# TODO deprecate class BatchEditForm(forms.Form): search = forms.CharField(label=_('Search String')) keywords = forms.ModelMultipleChoiceField(queryset=Keyword.objects.none(), required=False, widget=MultiSelectWidget) @@ -328,73 +309,3 @@ class SearchPreferenceForm(forms.ModelForm): 'search': SelectWidget, 'unaccent': MultiSelectWidget, 'icontains': MultiSelectWidget, 'istartswith': MultiSelectWidget, 'trigram': MultiSelectWidget, 'fulltext': MultiSelectWidget, } - - -# class ShoppingPreferenceForm(forms.ModelForm): -# prefix = 'shopping' - -# class Meta: -# model = UserPreference - -# fields = ( -# 'shopping_share', 'shopping_auto_sync', 'mealplan_autoadd_shopping', 'mealplan_autoexclude_onhand', -# 'mealplan_autoinclude_related', 'shopping_add_onhand', 'default_delay', 'filter_to_supermarket', 'shopping_recent_days', 'csv_delim', 'csv_prefix' -# ) - -# help_texts = { -# 'shopping_share': _('Users will see all items you add to your shopping list. They must add you to see items on their list.'), -# 'shopping_auto_sync': _( -# 'Setting to 0 will disable auto sync. When viewing a shopping list the list is updated every set seconds to sync changes someone else might have made. Useful when shopping with multiple people but might use a little bit ' -# 'of mobile data. If lower than instance limit it is reset when saving.' -# ), -# 'mealplan_autoadd_shopping': _('Automatically add meal plan ingredients to shopping list.'), -# 'mealplan_autoinclude_related': _('When adding a meal plan to the shopping list (manually or automatically), include all related recipes.'), -# 'mealplan_autoexclude_onhand': _('When adding a meal plan to the shopping list (manually or automatically), exclude ingredients that are on hand.'), -# 'default_delay': _('Default number of hours to delay a shopping list entry.'), -# 'filter_to_supermarket': _('Filter shopping list to only include supermarket categories.'), -# 'shopping_recent_days': _('Days of recent shopping list entries to display.'), -# 'shopping_add_onhand': _("Mark food 'On Hand' when checked off shopping list."), -# 'csv_delim': _('Delimiter to use for CSV exports.'), -# 'csv_prefix': _('Prefix to add when copying list to the clipboard.'), - -# } -# labels = { -# 'shopping_share': _('Share Shopping List'), -# 'shopping_auto_sync': _('Autosync'), -# 'mealplan_autoadd_shopping': _('Auto Add Meal Plan'), -# 'mealplan_autoexclude_onhand': _('Exclude On Hand'), -# 'mealplan_autoinclude_related': _('Include Related'), -# 'default_delay': _('Default Delay Hours'), -# 'filter_to_supermarket': _('Filter to Supermarket'), -# 'shopping_recent_days': _('Recent Days'), -# 'csv_delim': _('CSV Delimiter'), -# "csv_prefix_label": _("List Prefix"), -# 'shopping_add_onhand': _("Auto On Hand"), -# } - -# widgets = { -# 'shopping_share': MultiSelectWidget -# } - -# class SpacePreferenceForm(forms.ModelForm): -# prefix = 'space' -# reset_food_inherit = forms.BooleanField(label=_("Reset Food Inheritance"), initial=False, required=False, -# help_text=_("Reset all food to inherit the fields configured.")) - -# def __init__(self, *args, **kwargs): -# super().__init__(*args, **kwargs) # populates the post -# self.fields['food_inherit'].queryset = Food.inheritable_fields - -# class Meta: -# model = Space - -# fields = ('food_inherit', 'reset_food_inherit',) - -# help_texts = { -# 'food_inherit': _('Fields on food that should be inherited by default.'), -# 'use_plural': _('Use the plural form for units and food inside this space.'), -# } - -# widgets = { -# 'food_inherit': MultiSelectWidget -# }