diff -r 298df3d3116c -r c1a51436db9c doc/laxmanual_fr/04-develop-views.fr.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/laxmanual_fr/04-develop-views.fr.txt Wed Nov 12 16:58:35 2008 -0800 @@ -0,0 +1,103 @@ +.. -*- coding: utf-8 -*- + +Définir l'interface utilisateur avec des vues +============================================= + +`LAX` provides out-of-the-box a web interface that is generated from +the schema definition: entities can be created, displayed, updated and +deleted. As display views are not very fancy, it is usually necessary +to develop your own. + + +With `LAX`, views are defined by Python classes. A view includes : + +- an identifier (all objects in `LAX` are entered in a registry + and this identifier will be used as a key) + +- a filter to select the resulsets it can be applied to + +`LAX` provides a lot of standard views, for a complete list, you +will have to read the code in directory views (XXX improve doc). +For example, the view named ``primary`` is the one used to display +a single entity. + +If you want to change the way a ``BlogEntry`` is displayed, just +override the view ``primary`` in ``BlogDemo/views.py`` :: + + from ginco.web.views import baseviews + + class BlogEntryPrimaryView(baseviews.PrimaryView): + + accepts = ('BlogEntry',) + + def cell_call(self, row, col): + entity = self.entity(row, col) + self.w(u'