Skip to content

Instantly share code, notes, and snippets.

@vsanjuan
vsanjuan / costactivitytool.py
Last active August 29, 2015 14:06
Product cost on ZODB
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:
@vsanjuan
vsanjuan / resources
Last active August 29, 2015 14:06
Cost calculation tool
# 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)
@vsanjuan
vsanjuan / catalogo
Last active August 29, 2015 14:05
A file to test ZODB storage an object retrieval
@vsanjuan
vsanjuan / peewee_resources
Created August 29, 2014 01:04
Try to combine a class __init__ with peewee methods
#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 is a python file
print "hello world"
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