Sunday, June 20, 2010

Document Editor: Week 4

I planned to implement revision control for Document model this week. New revision is now created on document creation. Revision creation on edit and view that shows all the revisions for current document are left.

To implement revision control for document I had to do the following stuff:
  1. Implement Revision, RevisionInfo and RevisionContent classes in soc.models.revision module
  2. Implement Logic class for revisions in soc.logic.models.revision. It overrides soc.logic.models.base.Logic.updateOrCreateFromFields and defines method to create new revision.
  3. Change forms configuration in soc.views.models.document.View
It was pretty hard to figure out all the dependencies between classes and methods in Melange. I didn't want to break existing code base, inheritance is so useful here :)

UPD: New version of Melange that supports revisions is available at appspot.

No comments:

Post a Comment