Model and submit API updates

NOTE: Not ready for merge because tests are incomplete, but I need to stop for the day, so sharing progress.

Changes to model and submit API that make submitting straightforward. Submission is the most common action, so I rewrote the model such that submitting doesn't need to change User or Assignment records.

Per Stephen's suggestions, all API code is back in api.py and the NDB interface is an object. Comments are welcome.

Testing is incomplete, but I won't get to finish it until tomorrow. 
At the very least, there will be multiple iterations of 61A. Hopefully,
other courses will use this software as well. A Course tracks enrollment.

-John


On Tue, Jul 29, 2014 at 7:24 AM, Stephen Martinis <notifications@github.com>
wrote:

> In server/app/models.py:
>
> >      """
> >      The Assignment Model
> >      """
> > -    name = ndb.StringProperty()
> > -    points = ndb.IntegerProperty()
> > -    submissions = ndb.StructuredProperty(Submission, repeated=True)
> > +    name = ndb.StringProperty() # Must be unique to support submission.
> > +    # TODO(denero) Validate uniqueness of name.
> > +    points = ndb.FloatProperty()
> > +    creator = ndb.StructuredProperty(User)
> > +
> > +
> > +class Course(Base):
>
> What is the purpose of a Course? What's the plan for using them?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Cal-CS-61A-Staff/ok/pull/38/files#r15506524>.
>