Web
Programming

Fall 2012
course
navigation

Oct 25

Jim's comments on last week's work have been posted.
The next assignment (ORM, REST concepts, starting PHP) is posted.
We went over some python class (i.e. object) syntax. I've attached an example.

ORM wrap-up

Sam's take on Elixir
A little bit more experimentation with SqlSoup and Planet Express.
How can we set up object relations between Shipments and Clients?
First step :
Package.relate('shipment', Shipment, backref=backref("packages"))
However, the Package to Client relationship is tricker, because there are *two* of those foreign keys.
Package.relate('sender', Client, primaryjoin=Package.sender_id==Client.account_number, backref=backref("packages_sent"))
The shipment to client relationship is similar.
Shipment.relate('senders', Client, secondary=Package._table, secondaryjoin=Package.sender_id==Client.account_number, backref=backref("shipments_sent"))
Write some code to try these out and see how the objects work.

REST

PHP etc

Describe what it is; show some examples.
PHP likes MySQL, which is on csmarlboro.org.
Readings :
TODO in class:
http://cs.marlboro.edu/ courses/ fall2012/web/ notes/ Oct_25
last modified Thursday October 25 2012 4:48 pm EDT

attachments [paper clip]

     name last modified size
   python_objects.py Oct 25 2012 4:44 pm 553B