Saturday, June 26, 2010

GSoC 2010 Data Seeder - Web Interface

A very, very, veeery early form of the web interface is ready. It's very ugly in the current form, I haven't applied any styling to it yet, but at least it's functional. You can check it out here.

One problem that's pretty obvious at first is the space management. For most useful models, there are a lot of properties which take up a lot of space, but only a few of them might actually be used. My solution for this would be to compact them into collapsible/foldable panels so that properties that are not useful and properties that have already been configured don't take up space. Expect this to change in the future.

The web interface currently produces a valid JSON configuration sheet, only including model and properties configuration (without references) and also has the ability to send it to the server backend, but that's it for now. If you want to take a look at the resulting JSON, there's a dump in the JavaScript debug console.

Stay tuned for more in the future!

Monday, June 21, 2010

GSoC 2010 Melange Testing Project: Week 4 of the Coding Period

In the last week, I further added more test cases to the user view test to test the views for administrator users. In order to test the operations of administrator users, an XSRF middleware token has to be manually generated and added to the post data so that the operation can pass authentication. Then, I added more test cases to the user logic test. This week, I will try to add test cases for more logic and view pairs.

One big thing for Melange next month is that each commit will be accompanied with tests. In order to contribute to the movement, I am preparing for a wiki page explaining the current testing environment (e.g. datastore), test runners (e.g. how to only run a single test case), available tools (e.g. pymox and Django test client), utilities (e.g. StuboutHelper), and so on.

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.