From 33b5093ceda247ad52e849e5661835fe0779a344 Mon Sep 17 00:00:00 2001 From: Kiran Jonnalagadda Date: Tue, 5 Mar 2024 17:38:01 +0530 Subject: [PATCH] Rename forms for Menu and Ticket --- boxoffice/forms/__init__.py | 4 ++-- boxoffice/forms/{item_collection.py => menu.py} | 4 ++-- boxoffice/forms/{item.py => ticket.py} | 4 ++-- boxoffice/views/admin_item.py | 6 +++--- boxoffice/views/admin_item_collection.py | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) rename boxoffice/forms/{item_collection.py => menu.py} (96%) rename boxoffice/forms/{item.py => ticket.py} (98%) diff --git a/boxoffice/forms/__init__.py b/boxoffice/forms/__init__.py index f8112cda6..4dba61b22 100644 --- a/boxoffice/forms/__init__.py +++ b/boxoffice/forms/__init__.py @@ -2,9 +2,9 @@ from .category import * from .discount import * -from .item import * -from .item_collection import * +from .menu import * from .order import * from .order_refund import * from .participant import * from .price import * +from .ticket import * diff --git a/boxoffice/forms/item_collection.py b/boxoffice/forms/menu.py similarity index 96% rename from boxoffice/forms/item_collection.py rename to boxoffice/forms/menu.py index d1e61479b..fef062010 100644 --- a/boxoffice/forms/item_collection.py +++ b/boxoffice/forms/menu.py @@ -4,10 +4,10 @@ from ..data import indian_states, indian_states_dict -__all__ = ['ItemCollectionForm'] +__all__ = ['MenuForm'] -class ItemCollectionForm(forms.Form): +class MenuForm(forms.Form): title = forms.StringField( __("Item Collection title"), validators=[ diff --git a/boxoffice/forms/item.py b/boxoffice/forms/ticket.py similarity index 98% rename from boxoffice/forms/item.py rename to boxoffice/forms/ticket.py index 336eb58cd..6af39f055 100644 --- a/boxoffice/forms/item.py +++ b/boxoffice/forms/ticket.py @@ -5,7 +5,7 @@ from ..data import indian_states, indian_states_dict from ..models import Category, Menu, sa -__all__ = ['ItemForm'] +__all__ = ['TicketForm'] ASSIGNEE_DETAILS_PLACEHOLDER = { @@ -27,7 +27,7 @@ } -class ItemForm(forms.Form): +class TicketForm(forms.Form): title = forms.StringField( __("Item title"), validators=[ diff --git a/boxoffice/views/admin_item.py b/boxoffice/views/admin_item.py index 10f084ed1..fa818b780 100644 --- a/boxoffice/views/admin_item.py +++ b/boxoffice/views/admin_item.py @@ -6,7 +6,7 @@ from coaster.views import ReturnRenderWith, load_models, render_with, requestargs from .. import app, lastuser -from ..forms import ItemForm, PriceForm +from ..forms import PriceForm, TicketForm from ..models import Menu, Organization, Price, Ticket, db, sa from .utils import api_error, api_success, json_date_format, xhr_only @@ -117,7 +117,7 @@ def admin_item(ticket: Ticket) -> ReturnRenderWith: def jsonify_new_ticket(data_dict): menu = data_dict['menu'] - ticket_form = ItemForm(parent=menu) + ticket_form = TicketForm(parent=menu) if request.method == 'GET': return jsonify( form_template=render_form( @@ -153,7 +153,7 @@ def admin_new_item(menu: Menu) -> ReturnRenderWith: def jsonify_edit_ticket(data_dict): ticket = data_dict['ticket'] - ticket_form = ItemForm(obj=ticket) + ticket_form = TicketForm(obj=ticket) if request.method == 'GET': return jsonify( form_template=render_form( diff --git a/boxoffice/views/admin_item_collection.py b/boxoffice/views/admin_item_collection.py index 2eac035ba..45c8a12b3 100644 --- a/boxoffice/views/admin_item_collection.py +++ b/boxoffice/views/admin_item_collection.py @@ -6,7 +6,7 @@ from coaster.views import ReturnRenderWith, load_models, render_with from .. import app, lastuser -from ..forms import ItemCollectionForm +from ..forms import MenuForm from ..models import Menu, Organization, db from ..models.line_item import counts_per_date_per_item, sales_by_date, sales_delta from .admin_item import format_ticket_details @@ -66,7 +66,7 @@ def admin_menu(menu: Menu) -> ReturnRenderWith: def jsonify_new_menu(menu_dict): - ic_form = ItemCollectionForm() + ic_form = MenuForm() if request.method == 'GET': return jsonify( form_template=render_form( @@ -106,7 +106,7 @@ def admin_new_ic(organization: Organization) -> ReturnRenderWith: def jsonify_edit_menu(menu_dict): menu = menu_dict['menu'] - ic_form = ItemCollectionForm(obj=menu) + ic_form = MenuForm(obj=menu) if request.method == 'GET': return jsonify( form_template=render_form(