[PyQt] Re: RAD with PyQt?

Alberto Berti alberto at metapensiero.it
Wed Jun 11 19:33:34 BST 2008


>>>>> "Aaron" == Aaron Digulla <digulla at hepe.com> writes:

    Aaron> Hello, I was wondering: Is there a Rapid Application
    Aaron> Development framework to quickly write apps with PyQt?

In PyPaPi something is done, something is not done yet:)

    Aaron> - Connect model fields (properties) to UI elements (for
    Aaron> example, string fields to text editors or to combo boxes).

- more than that, connect UI elements to instances attributes from the
  designer, connect forms do instance lists via configuration file.

    Aaron> - Connect a python list to a QListView including the
    Aaron> standard editor (add, move up/down, delete) including a
    Aaron> mapper to convert the objects in the list strings for
    Aaron> display in the view.  

- not done yet, but should be very simple:) oh, can also be contributed.

    Aaron> - Same for QTableView (this time, the
    Aaron> converter must return strings per column).  

- association from the designer from QTableView to models, define
  columns for TableModel via configuration file that links to instance
  attributes, support for rendering comboboxes inside TableViews as
  well as checkboxes for bool fields and spinboxes for int
  fields. Support for columns titles, hints and chance to define
  behavior for any other model item's role.

- we are working on d'n'd for rows reordering;

    Aaron> - Quickly assemble UI views from basic building blocks (like
    Aaron> master/detail views).  

- support for definition of object relationships between objects, with
  support for 1-1 and 1-n relations.

- Thanks to that, it's possible to define master-detail forms directly
  from the designer. At runtime the form will automatically render
  models, connect both simple widgets an tableviews and will manage
  change of currentIndex on the master model refreshing detail models.

- Support for SQLAlchemy models with automatic object relationship
  calculation.

- support for object association with definition of object "sources"
  per relationship path. Automatic dealing with single or multiple
  selection in case of 1-1 or 1-n relation. Automatic calculation of
  sources for ORM models. It in the work the feature of queryable
  sources to support S.A. queries.

    Aaron> - Automatic undo support (including moving of the focus)

- This is much more difficult to implement in a pleasant way. It also
  needs a more detailed description of what is the expected behavior
  especially for master-detail forms and other cases. PyPaPi has row
  level undo for now. This is due to the layout of models: actually,
  one TableModel per relation level. So a detail model is resetted
  when the currentIndex is changed on it's master. The most "natural"
  approach would be to use a single ItemModel for all the object tree
  and attaching TableViews to individual branches with setRootIndex(),
  but QAbstractItemModel is not thought to be used that way. 

  The next step will be to use a single S.A. Session per form, but i'm
  still thinking about a more generic way to do that.

    Aaron> These are all standard plumbing; yet, I haven't seen or
    Aaron> heard of a framework that supports these basic tasks so I
    Aaron> can concentrate on the app logic.

As i told before before, the PyPaPi framework is rapidly evolving to a
1.0 release. It is GPLv3 licensed. Unfortunately, until post 1.0
period, the framework and the application built on it are in the same
package. But the application is also a nice demo of PyPaPi's
features:)

To try it out without changing config files you need:

- darcs;

- PosgreSQL 7.4 or 8.x on localhost with your user configured to login
  without passord (in "trust", only needed to setup the
  database). Your user need also the permission to create new
  databases;

- Python 2.4 or 2.5 with PyQt4 4.3 and Qt4 4.3 or 4.4 (not tested with
  PyQt4 4.4 as a package is not yet available on debian or ubuntu).

Then run:

$ darcs get http://darcs.arstecnica.it/our/pypapi
$ cd pypapi/
$ python setup.py devel
$ cd docs/database 
$ make scratch
$ cd ../../
$ python tools/insert_demodata.py
$ python apps/ppp.py

happy testing:)





More information about the PyQt mailing list