This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from persistent import Persistent | |
import transaction | |
import ZODB | |
import ZODB.FileStorage | |
class Product(Persistent): | |
"""Models a product composition by listing the materials and activities | |
needed to produce it. | |
Attributes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Persistent class is imported so the Class can | |
# be saved later in ZODB | |
from persistent import Persistent | |
from ZODB import FileStorage, DB | |
import transaction | |
from copy import deepcopy | |
storage = FileStorage.FileStorage('activity_costing.fs') | |
db = DB(storage) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Persistent class is imported so the Class can | |
# be saved later in ZODB | |
from persistent import Persistent | |
class Catalogo(Persistent): | |
def __init__(self): | |
self.catalogo = [] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import the model class from peewee to model the classes and properties as tables | |
#and fields in the Sqlite Database | |
from peewee import * | |
database = SqliteDatabase('productcost.db') | |
#model definitions -- the standard "pattern" is to define a base model class | |
#that specifies which database to use. Then, any subclasses will automatically | |
#use the correct storage. | |
class BaseModel(Model): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is a python file | |
print "hello world" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twilio.rest import TwilioRestClient | |
# Your Account Sid and Auth Token from twilio.com/user/account | |
account_sid = "AC6f5324f90ea19d268bc01915e1acfb34" | |
auth_token = "8ebc46ae27b58f6f8a373e33f643e900" | |
client = TwilioRestClient(account_sid, auth_token) | |
message = client.messages.create( | |
body="Messasge from Udacity", | |
to="+1617457392", # Replace with your phone number |