Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Toppings to Pizza #13

Open
PatOConnor43 opened this issue Mar 19, 2017 · 10 comments
Open

Adding Toppings to Pizza #13

PatOConnor43 opened this issue Mar 19, 2017 · 10 comments

Comments

@PatOConnor43
Copy link
Contributor

Hi @aluttik,

Did you have any ideas on how this should be implemented? It seems like picking toppings on the website and validating the order should have enough information to map what the letters mean for each topping. Is this something that you're already working on? If not, I may give it a shot this week.

@aluttik
Copy link
Collaborator

aluttik commented Mar 19, 2017

@PatOConnor43: actually, a Menu payload already contains descriptions for each topping under the top level "Toppings" object :) I just haven't put in the work yet, but implementing this should be pretty easy.

If you want to take a look, here's a pretty printed version of tests/fixtures/menu.json: https://gist.github.com/aluttik/515b8507210a0585c8a38bd43a3469c8

If you just want the names for each code, here's a snippet I found with jq:

{
  "Bread": {
    "Fe": {"Name": "Feta Cheese"},
    "J":  {"Name": "Jalapeno Peppers"},
    "K":  {"Name": "Bacon"},
    "Si": {"Name": "Spinach"}
  },
  "Pasta": {
    "B":  {"Name": "Beef"},
    "C":  {"Name": "Cheese"},
    "Cp": {"Name": "Shredded Provolone Cheese"},
    "Cs": {"Name": "Shredded Parmesan"},
    "Du": {"Name": "Premium Chicken"},
    "E":  {"Name": "Cheddar Cheese"},
    "Fe": {"Name": "Feta Cheese"},
    "G":  {"Name": "Green Peppers"},
    "H":  {"Name": "Ham"},
    "J":  {"Name": "Jalapeno Peppers"},
    "K":  {"Name": "Bacon"},
    "M":  {"Name": "Mushrooms"},
    "N":  {"Name": "Pineapple"},
    "O":  {"Name": "Onions"},
    "P":  {"Name": "Pepperoni"},
    "Pm": {"Name": "Philly Steak"},
    "R":  {"Name": "Black Olives"},
    "Rr": {"Name": "Roasted Red Peppers"},
    "S":  {"Name": "Italian Sausage"},
    "Si": {"Name": "Spinach"},
    "Td": {"Name": "Diced Tomatoes"},
    "Xf": {"Name": "Alfredo Sauce"},
    "Xm": {"Name": "Hearty Marinara Sauce"},
    "Z":  {"Name": "Banana Peppers"}
  },
  "Pizza": {
    "Ac": {"Name": "American Cheese"},
    "B":  {"Name": "Beef"},
    "Bq": {"Name": "BBQ Sauce"},
    "C":  {"Name": "Cheese"},
    "Cp": {"Name": "Shredded Provolone Cheese"},
    "Cs": {"Name": "Shredded Parmesan Asiago"},
    "Du": {"Name": "Premium Chicken"},
    "E":  {"Name": "Cheddar Cheese"},
    "Fe": {"Name": "Feta Cheese"},
    "G":  {"Name": "Green Peppers"},
    "H":  {"Name": "Ham"},
    "Ht": {"Name": "Hot Sauce"},
    "J":  {"Name": "Jalapeno Peppers"},
    "K":  {"Name": "Bacon"},
    "M":  {"Name": "Mushrooms"},
    "N":  {"Name": "Pineapple"},
    "O":  {"Name": "Onions"},
    "P":  {"Name": "Pepperoni"},
    "Pm": {"Name": "Philly Steak"},
    "R":  {"Name": "Black Olives"},
    "Rr": {"Name": "Roasted Red Peppers"},
    "S":  {"Name": "Italian Sausage"},
    "Sa": {"Name": "Salami"},
    "Sb": {"Name": "Sliced Italian Sausage"},
    "Si": {"Name": "Spinach"},
    "Td": {"Name": "Diced Tomatoes"},
    "X":  {"Name": "Robust Inspired Tomato Sauce"},
    "Xf": {"Name": "Alfredo Sauce"},
    "Xm": {"Name": "Hearty Marinara Sauce"},
    "Xw": {"Name": "Garlic Parmesan White Sauce"},
    "Z":  {"Name": "Banana Peppers"}
  },
  "Sandwich": {
    "Ac": {"Name": "American Cheese"},
    "Bd": {"Name": "Blue Cheese Sauce"},
    "C":  {"Name": "Cheese"},
    "Cs": {"Name": "Shredded Parmesan Asiago"},
    "Du": {"Name": "Premium Chicken"},
    "E":  {"Name": "Cheddar Cheese"},
    "Fe": {"Name": "Feta Cheese"},
    "G":  {"Name": "Green Peppers"},
    "H":  {"Name": "Ham"},
    "Ht": {"Name": "Hot Sauce"},
    "J":  {"Name": "Jalapeno Peppers"},
    "K":  {"Name": "Bacon"},
    "M":  {"Name": "Mushrooms"},
    "Mh": {"Name": "Mango Habanero Sauce"},
    "N":  {"Name": "Pineapple"},
    "O":  {"Name": "Onions"},
    "P":  {"Name": "Pepperoni"},
    "Pm": {"Name": "Philly Steak"},
    "Pv": {"Name": "Sliced Provolone"},
    "Rd": {"Name": "Ranch Dressing"},
    "Rr": {"Name": "Roasted Red Peppers"},
    "Sa": {"Name": "Salami"},
    "Sb": {"Name": "Sliced Italian Sausage"},
    "Si": {"Name": "Spinach"},
    "Td": {"Name": "Diced Tomatoes"},
    "X":  {"Name": "Pizza Sauce"},
    "Z":  {"Name": "Banana Peppers"}
  },
  "Wings": {
    "J":  {"Name": "Jalapeno Peppers"},
    "K":  {"Name": "Bacon"},
    "N":  {"Name": "Pineapple"},
    "Td": {"Name": "Diced Tomatoes"}
  }
}

@ggrammar
Copy link
Owner

ggrammar commented Feb 5, 2018

I got the API spitting toppings back to me by adding a 'Toppings' dict to the 'Tags' dict on a product, so like:
order.add_item('12THIN')
order.data['Products'][0]['Tags'][u'Toppings'] = u'Ac=1,B=1,Du=1,Fe=1'

So, we could modify the Order.add_item() method to allow it to accept toppings, or add a custom pizza to the Order.menu object, but neither of those seem super great.

@aluttik - would this be a good time to add a Pizza object, and allow the Order.add_item() method to process that object? I could probably knock that out tomorrow.

@aluttik
Copy link
Collaborator

aluttik commented Feb 5, 2018

@Gamagori I guess, but honestly I'm giving up on this project. I made this years ago as a learning experience and haven't really looked at it since. I work on a lot of professional projects now and I don't even live near a Dominos anymore, so I really don't have the time or motivation to worry about this one.

So yeah, if I were you I'd just fork the repo and change it however you like. It's probably only a matter of time until I delete the repo entirely.

@ggrammar
Copy link
Owner

ggrammar commented Feb 5, 2018

@aluttik I'm in the learning experience portion of my career - do you mind if I take it over? I live across the street from a Dominos, I've got plenty of time and reason to steward it.

@aluttik
Copy link
Collaborator

aluttik commented Feb 5, 2018

@Gamagori sure man, it's all yours :)

I'll send you a transfer request - you'll have to delete any existing fork of this project you have and accept the email within a day. Anyone who visits aluttik/pizzapi should then get redirected to gamagori/pizzapi.

All the credit I'd like is to be named in a Contributors list of some sort - you are more than welcome to change the "author" fields and stuff in the setup.py file.

@aluttik
Copy link
Collaborator

aluttik commented Feb 5, 2018

@Gamagori actually I can't request the transfer until you delete your fork on GitHub. Once you do that, feel free to send me an email at [email protected] so I can transfer ownership to you.

@ggrammar
Copy link
Owner

ggrammar commented Feb 5, 2018

@aluttik The fork has been deleted - I've got all my changes backed up locally. I'll spin up a CONTRIBUTORS.md and give you an appropriate shout-out for all your work on this!

@mojpg
Copy link

mojpg commented Aug 23, 2018

I'm interested in making a Python script similar to roulette.pizza, except with vegetarian toppings - and I'd love to help build the toppings feature or Pizza object! Let me know if you're interested.

@ggrammar
Copy link
Owner

@mozebdi Sure thing! Here are some ideas off the top of my head, but feel free to do a PR with whatever seems sensible:

  • Constructor with no args
  • Constructor with crust, sauce, and dict of toppings
  • Order.add_item() accepts a Pizza object as well as the existing code option

@itrussell15
Copy link

Has there been any progress made on this subject? I have looked into it and can't seem to find any portion that would allow me change the defaults to be something that is customized.

After the order has been placed with .pay_with(), I am returned with a more detailed description of the toppings, but they are still default. I even tried modifying the defaults to be a custom pizza.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants