Skip to content

Commit

Permalink
Rename forms for Menu and Ticket
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Mar 5, 2024
1 parent a5c81e8 commit 33b5093
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions boxoffice/forms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down
4 changes: 2 additions & 2 deletions boxoffice/forms/item.py → boxoffice/forms/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -27,7 +27,7 @@
}


class ItemForm(forms.Form):
class TicketForm(forms.Form):
title = forms.StringField(
__("Item title"),
validators=[
Expand Down
6 changes: 3 additions & 3 deletions boxoffice/views/admin_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions boxoffice/views/admin_item_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 33b5093

Please sign in to comment.