Skip to content

Instantly share code, notes, and snippets.

@inesp
Last active October 20, 2019 08:12
Show Gist options
  • Save inesp/a085ff7ca1f52e7a015fefa05ce83827 to your computer and use it in GitHub Desktop.
Save inesp/a085ff7ca1f52e7a015fefa05ce83827 to your computer and use it in GitHub Desktop.
class PizzaMaker:
def create_pizza(self, **pizza_properties):
pizza_type = pizza_properties["ptype"]
pizza_class = get_pizza_class(pizza_type)
if pizza_class is None:
raise UnknownPizaType(pizza_type)
del pizza_properties["ptype"]
pizza = pizza_class(**pizza_properties)
return pizza
class PizzaMargherita(DBModel):
id = column.Int....
created_at = column.DateTime....
created_by = column.fk...
cheeze_type = column.Enum...
with_bazil = column.Bool...
....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment