MVC with Python

David Boddie david at boddie.org.uk
Mon Sep 15 17:40:13 EDT 2008


On Monday 15 September 2008 21:37, Georg Altmann wrote:

> I need some advice on how to implement model-view-controller. I am
> trying to develop a GUI application with PyQt, yet the problem rather
> applies to mvc in general, not just GUI applications.
> 
> Let's say the data is a list of objects with a common base class. The
> views are either a graphical representation of the objects or some form
> of textual input. The views shall change the model by using command
> objects (for undo, e.g. QUndoCommand).

[...]

> My problem is, how do the commands interact with the model?

One approach that combines the undo framework with the model/view framework
is described here:

  http://doc.trolltech.com/qq/qq25-undo.html

The implementation is in C++, but it may be possible to pick up some
useful tips from the article.

David



More information about the Python-list mailing list